Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When running drush y2wm
on a site I'm getting the following error:
Are you sure you want to migrate from YAML Form 8.x-1.x to Webform 8.x-5.x? The migration may take a few minutes. (y/n): y
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.' in /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Statement.php:59 [error]
Stack trace:
#0 /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Statement.php(59): PDOStatement->execute(Array)
#1 /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Connection.php(610): Drupal\Core\Database\Statement->execute(Array, Array)
#2 /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81): Drupal\Core\Database\Connection->query('ALTER TABLE nod...', Array, Array)
#3 /var/www/[redacted]/build/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(370): Drupal\Core\Database\Driver\mysql\Connection->query('ALTER TABLE nod...')
#4 /var/www/[redacted]/build/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(228): Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->renameColumns('node__yamlform')
#5 /var/www/[redacted]/build/modules/contrib/yamlform/modules/yamlform_to_webform/yamlform_to_webform.drush.inc(68): Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->migrate()
#6 [internal function]: drush_yamlform_to_webform_migrate()
#7 /var/www/[redacted]/build/vendor/drush/drush/includes/command.inc(422): call_user_func_array('drush_yamlform_...', Array)
#8 /var/www/[redacted]/build/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#9 [internal function]: drush_command()
#10 /var/www/[redacted]/build/vendor/drush/drush/includes/command.inc(199): call_user_func_array('drush_command', Array)
#11 /var/www/[redacted]/build/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#12 /var/www/[redacted]/build/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /var/www/[redacted]/build/vendor/drush/drush/drush.php(12): drush_main()
#14 {main}
Next exception 'Drupal\Core\Database\DatabaseExceptionWrapper' with message 'SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.: ALTER TABLE node__yamlform CHANGE yamlform_target_id
webform_target_id varchar(255); Array
(
)
' in /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Connection.php:671
Stack trace:
#0 /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Connection.php(635): Drupal\Core\Database\Connection->handleQueryException(Object(PDOException), 'ALTER TABLE nod...', Array, Array)
#1 /var/www/[redacted]/build/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81): Drupal\Core\Database\Connection->query('ALTER TABLE nod...', Array, Array)
#2 /var/www/[redacted]/build/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(370): Drupal\Core\Database\Driver\mysql\Connection->query('ALTER TABLE nod...')
#3 /var/www/[redacted]/build/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(228): Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->renameColumns('node__yamlform')
#4 /var/www/[redacted]/build/modules/contrib/yamlform/modules/yamlform_to_webform/yamlform_to_webform.drush.inc(68): Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->migrate()
#5 [internal function]: drush_yamlform_to_webform_migrate()
#6 /var/www/[redacted]/build/vendor/drush/drush/includes/command.inc(422): call_user_func_array('drush_yamlform_...', Array)
#7 /var/www/[redacted]/build/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#8 [internal function]: drush_command()
#9 /var/www/[redacted]/build/vendor/drush/drush/includes/command.inc(199): call_user_func_array('drush_command', Array)
#10 /var/www/[redacted]/build/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#11 /var/www/[redacted]/build/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 /var/www/[redacted]/build/vendor/drush/drush/drush.php(12): drush_main()
#13 {main}
I took a look at this possibly related issue: https://www.drupal.org/node/2834129 and tried removing the deleted field tables locally, but still received the same error.
I'm not sure if this is related, but the site was previously running version 8.1.0-beta14
. It seemed like all the update hooks ran successfully after upgrading, but I did get the following error during the database updates (several updates after yamlform_update_8078
had already run):
PHP Fatal error: Call to a member function getId() on null in /var/www/nyunursing/build/core/modules/user/src/PrivateTempStore.php on line 204
Fatal error: Call to a member function getId() on null in /var/www/nyunursing/build/core/modules/user/src/PrivateTempStore.php on line 204
Comment | File | Size | Author |
---|---|---|---|
#2 | Screen Shot 2016-12-23 at 5.13.49 PM.png | 279.98 KB | jrockowitz |
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer commentedThe node__yamlform.yamlform_target_id needs to be changed from 255 characters to 32 characters. There is an updated hook that is suppose to fix this.
Still, you can do it manually using the below code snippet which I pulled from PHPMyAdmin.
If the manual approach works you might just want to go with it. Please make sure to clear cache, run cron, and check the status report to make sure your fields are up-to-date.
Comment #3
bobbygryzyngerI was able to run that query without any trouble.
But I have a error occurring (unrelated to yamlform) when I attempt to run
drush entity-updates
that appears to be preventing theyamlform_submission entity type
from getting its update andy2wm
is still failing with the same error.Is there anything I can run manually to update that to determine if that is what is holding up the
drush y2wm
command?Comment #4
bobbygryzyngerI also attempted to do the migration through the UI and got the WSOD with this message:
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer commentedDid you install and then uninstall the webform module before the migration? I am guessing that it left records in the key_value and key_value_expire table.
Comment #6
bobbygryzynger@jrockowitz - manually running:
as well as:
appears to address this issue for me.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer commented@bobby.gry After manually fixing the columns, did you confirm that the 'Status report' does not display any warnings about pending field updates?
Comment #8
bobbygryzynger@jrockowitz - even after the manual update and running the migration command, I still see these entries on my site's status report:
Comment #9
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedThe update hook which changes the column size wasn't working for me. #2879356: yamlform_update_8075 checks incorrect column description when doing updb fixed it.
Comment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer commented