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
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bobby.gry created an issue. See original summary.

jrockowitz’s picture

The 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.

ALTER TABLE `node__yamlform` CHANGE `yamlform_target_id` `yamlform_target_id` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The ID of the form entity.';

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.

bobbygryzynger’s picture

I 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 the yamlform_submission entity type from getting its update and y2wm 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?

bobbygryzynger’s picture

I also attempted to do the migration through the UI and got the WSOD with this message:

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'update_fetch_task-webform' for key 'PRIMARY': UPDATE key_value SET name = REPLACE(name, 'yamlform', 'webform'); Array ( ) in Drupal\Core\Database\Connection->handleQueryException() (line 668 of core/lib/Drupal/Core/Database/Connection.php).
jrockowitz’s picture

Did 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.

bobbygryzynger’s picture

Version: 8.x-1.0-beta28 » 8.x-1.0-beta29

@jrockowitz - manually running:

ALTER TABLE `node__yamlform` CHANGE `yamlform_target_id` `yamlform_target_id` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The ID of the form entity.';

as well as:

ALTER TABLE `node_revision__yamlform` CHANGE `yamlform_target_id` `yamlform_target_id` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL COMMENT 'The ID of the form entity.';

appears to address this issue for me.

jrockowitz’s picture

@bobby.gry After manually fixing the columns, did you confirm that the 'Status report' does not display any warnings about pending field updates?

bobbygryzynger’s picture

@jrockowitz - even after the manual update and running the migration command, I still see these entries on my site's status report:

The node.webform field needs to be updated.
The Webform submission entity type needs to be updated.
Sam152’s picture

The 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.

jrockowitz’s picture

Status: Active » Closed (outdated)