I received this error when trying to upgrade using the UI. Restored and tried again with the same result:
The website encountered an unexpected error. Please try again later.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: ALTER TABLE node__yamlform CHANGE yamlform_target_id webform_target_id varchar(255); Array ( ) in Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->renameColumns() (line 349 of modules/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php).
I just upgraded the Drupal core 8.2.4 which came out 12/7.
After this error, if I try to do anything else on the site, it just gives this error:
Fatal error: Class name must be a valid object or a string in /home/.../public_html/core/modules/field/src/FieldStorageConfigStorage.php on line 155
Comment | File | Size | Author |
---|---|---|---|
#11 | website_encountered_an-2834129-11.patch | 869 bytes | jrockowitz |
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz commentedI think the issue is you must have YAML forms with very long machine names. Am I right?
I will try to replicate the issue locally. I suspect I am going to be forced to limit YAML form machine names to 128 characters instead of 255.
http://stackoverflow.com/questions/1814532/1071-specified-key-was-too-lo...
Comment #3
jrockowitz CreditAttribution: jrockowitz commentedYep, the yamlform field's target id is currently 255 character when it needs to be 32 characters. I am going to have to write an update hook to fix this.
Hopefully I can use system_update_8007 as starting point for the needed update hook.
Comment #4
jrockowitz CreditAttribution: jrockowitz commentedI could not replicate the issue but I am willing to bet the yamlform target_id's field length being 255 characters when it should 32 characters is causing the problem.
Please test #2834203: Convert yamlform field target_id from 255 characters to 32 characters. and see if it fixes your migration.
Comment #5
javjaff CreditAttribution: javjaff commentedThanks. Migration without the patch to yamlform throw error "Fatal error: Class name must be a valid object or a string" indeed.
I had restored backup which I made before migration, applied the patch, then I used Drupal update.php and migrated Yaml form to Webform.
Second time everything went smoothly.
Comment #6
jrockowitz CreditAttribution: jrockowitz commented@javjaff Thanks for the confirmation. I committed the patch and will mark this issue as fixed.
Comment #7
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedI got the same problem. After trying this patch (meaning the dev version dev-8.x-1.x b9b1c55) did not solve my problem to migrate the forms. Also went through long machine names but I don't think I have any what might have something to do which yamlform module.
How ever when debugging (see below) the solution was to drop table "field_deleted_data_fd554c0f39" and "field_deleted_revision_fd554c0f39" tables. After that the migrate went fine. I don't what the yamlform_to_webform module exactly does which these database tables because the table was empty anyway.
I don't know if this helps to clarify something but at least I want to say a lot of thanks to you @jrockowitz for the effort!
---
...
Next Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.: ALTER TABLE field_deleted_data_021965de79 CHANGE yamlform_target_id
webform_target_id varchar(255); Array ()
in /var/www/finn-us/web/core/lib/Drupal/Core/Database/Connection.php:671
Stack trace:
#0 /var/www/finn-us/web/core/lib/Drupal/Core/Database/Connection.php(635): Drupal\Core\Database\Connection->handleQueryException(Object(PDOException), 'ALTER TABLE fie...', Array, Array)
#1 /var/www/finn-us/web/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php(81): Drupal\Core\Database\Connection->query('ALTER TABLE fie...', Array, Array)
#2 /var/www/finn-us/web/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(353): Drupal\Core\Database\Driver\mysql\Connection->query('ALTER TABLE fie...')
#3 /var/www/finn-us/web/modules/contrib/yamlform/modules/yamlform_to_webform/src/YamlFormToWebformMigrateManager.php(223): Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->renameColumns('field_deleted_d...')
#4 /var/www/finn-us/web/modules/contrib/yamlform/modules/yamlform_to_webform/yamlform_to_webform.drush.inc(68): Drupal\yamlform_to_webform\YamlFormToWebformMigrateManager->migrate()
#5 /var/www/finn-us/vendor/drush/drush/includes/command.inc(422): drush_yamlform_to_webform_migrate()
#6 /var/www/finn-us/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#7 /var/www/finn-us/vendor/drush/drush/includes/command.inc(199): drush_command()
#8 /var/www/finn-us/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#9 /var/www/finn-us/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#10 /var/www/finn-us/vendor/drush/drush/drush.php(12): drush_main()
#11 {main}
Comment #8
jrockowitz CreditAttribution: jrockowitz commented@TipiT Before deleting the field_deleted_data_021965de79 table did you check and see if you had any fields pending deletion in the Status Report.
Your error makes sense because the field_deleted_data_021965de79 contains an old broken yamlform field definition where the target_id column is still 255 characters when it needs to be changed to 32 characters. Instead of deleting the table next time change the target_id character limit from 255 to 32 and see if that fixes the issue.
Comment #9
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedI don't think there was none and I can't seems to think why there might be. But I am not 100% sure. I even deleted all submitted forms before the migration because because I thought that might be the obstacle.
Comment #10
jrockowitz CreditAttribution: jrockowitz commentedThe field_deleted_data tables are created when you delete a field. These table should be deleted when cron is run.
Comment #11
jrockowitz CreditAttribution: jrockowitz commentedAttached patch requires all pending field deletions to occur before a migration and might prevent this error from happening.
Comment #12
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedVery good. I think that was it! Nice job.
Comment #13
jrockowitz CreditAttribution: jrockowitz commented