0

I'm new to drupal and was recently tasked with upgrading the drupal core version of one of our sites. I upgraded from 8.3 to 8.9.13 and everything went smooth enough until it came time to update the database. Here, I was told that two updates had failed.

system module
Update #8501
Failed: Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: ALTER TABLE {content_moderation_state_field_data} ADD UNIQUE KEY content_moderation_state__lookup (content_entity_type_id, content_entity_id, content_entity_revision_id, workflow, langcode); Array ( ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1619 of /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

content_moderation module
Update #8700
Failed: Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: ALTER TABLE {content_moderation_state_field_data} ADD UNIQUE KEY content_moderation_state__lookup (content_entity_type_id, content_entity_id, content_entity_revision_id, workflow, langcode); Array ( ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1619 of /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php)

The table in question is InnoDB and utf8mb4_general_ci.

Does anyone know what could be causing this issue and how I might go about fixing it?

4
  • 2
    v8.3 to 8.9.13 Dont bump to many versions. Perform incremental upgrades. You will probably resolve your issue. Try with one or 2 versions upgrade once. and continue the same. Feb 5, 2021 at 9:44
  • 1
    Drupal composer project changed with 8.8. Have you done the necessary steps? Otherwise you should do those, they may be the cause of your problems.
    – Giuseppe
    Feb 5, 2021 at 9:53
  • Thanks for answers. Does rolling back to my previous version just involve returning all previous v8.3 core files and then reverting database using my sql backup?
    – IeuanByers
    Feb 5, 2021 at 10:37
  • Yes, you need to revert core files and restore database as well. before reverting drop all the tables in the current database as restoring wont drop tables which are not present in the backup. you can drop all tables using drush sql-drop command. Feb 5, 2021 at 13:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.