Problem/Motivation

If a site has rows in the menu_link_content table with no equivalents in menu_link_content_data, then menu_link_content_post_update_make_menu_link_content_revisionable() will fail with an error like:

Failed: Drupal\Core\Entity\EntityStorageException: The entity update process    [error]
failed while processing the entity type menu_link_content, ID: 3. in
Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->copyData() (line
216 of
D:\FILES\REPOS\detroitmi-test\docroot\core\lib\Drupal\Core\Entity\Sql\SqlFieldableEntityTypeListenerTrait.php).

Reports of this case:

#3052318-6: Update from 8.6 to 8.7 fails due to corrupt menu_link_content or taxonomy_term entity data

#3052318-91: Update from 8.6 to 8.7 fails due to corrupt menu_link_content or taxonomy_term entity data

#3052318-100: Update from 8.6 to 8.7 fails due to corrupt menu_link_content or taxonomy_term entity data

Proposed resolution

Add a hook_requirements() that runs a query to see if this condition exists, and if so returns an error, pointing to a change record with instructions on how to fix/delete the data.

A similar hook_requirements() was added in #3052147: comment_update_8701 fails if there are comments without field_name.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

If you were unable to update to 8.7 due to issues with menu link or taxonomy term data, Drupal 8.8.4 now adds instructions for resolving this issue. Try installing 8.8.4 and running update.php again. If you see an error that there are "Integrity issues detected" for your site data, follow the instructions in the change record to attempt to repair the data so that updates can be run.

CommentFileSizeAuthor
#141 3052318-141.patch7.12 KBAndyF
#141 interdiff_134-141.txt6.05 KBAndyF
#134 interdiff_131-134.txt3.35 KBAndyF
#134 3052318-134.patch3.62 KBAndyF
#131 interdiff_128-131.txt3.84 KBAndyF
#131 3052318-131.patch3.38 KBAndyF
#128 interdiff_124-128.patch5.17 KBAndyF
#128 3052318-128.patch3.69 KBAndyF
#35 modules.txt8.48 KBcrifi
#35 views.view_.watchdog.yml18.87 KBcrifi
#38 modules-d8-6-15.txt8.48 KBcrifi
#38 views.view_.watchdog.yml18.95 KBcrifi
#102 drupal-menu_taxonomy_revision_fix_8.7.5-1054616-102.patch4.88 KBmr_fenix
#109 drupal-menu_taxonomy_revision_fix_8.7.5-1054616-109.patch5.05 KBAbdeI
#123 3052318-123.patch4.04 KBAndyF
#124 reroll_diff_123-124.txt585 bytesAndyF
#124 3052318-124.patch4.08 KBAndyF
#152 Drupal_database_update___Drupal_8_x.png267.09 KBplach
#154 3052318-154.8.8-drupal.patch7.13 KBmikelutz
#154 interdiff.3052318.141-154.txt3.09 KBmikelutz
#156 3052318-156.8.9.drupal.patch7.13 KBmikelutz
#160 interdiff.txt2.26 KBandypost
#160 3052318-160.patch7.1 KBandypost
#162 3052318-162.patch6.97 KBAndyF
#162 interdiff_160-162.txt4.73 KBAndyF
#163 3052318-163.8.9.patch7 KBAndyF
#166 interdiff-163-166.txt1.45 KBjungle
#166 3052318-166.patch7.2 KBjungle
#175 3052318-8.x.patch7.17 KBcatch
#181 reroll_diff_175-180.txt4.07 KBAndyF
#181 3052318-180.8.7.patch7.07 KBAndyF
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jedgar1mx created an issue. See original summary.

cilefen’s picture

Priority: Normal » Major
xjm’s picture

Priority: Major » Critical
Status: Active » Postponed (maintainer needs more info)
Issue tags: +8.7.0 update

Setting critical until proven otherwise for update path bugs. :)

@jedgar1mx, can you provide some more information? A backtrace, specific errors in the logs or shell output, installed modules, etc.? Thanks in advance!

alexpott’s picture

Looks likely to occurring during menu_link_content_post_update_make_menu_link_content_revisionable()

jedgar1mx’s picture

Not much on the logs other than what I originally posted

jedgar1mx’s picture

It seems there was some issues with menu_link_content table. Row with id 3 had no pair in menu_link_content_data. Once I deleted the row, the database update works. I will run some test and post my findings 😁

amateescu’s picture

That sounds really weird, I'm curios to see if you manage to figure out how that happened.

vuil’s picture

I have the same issue somewhere in menu_link_content.post_update with the following error:

 ------------------- ----------------- ------------- --------------------------
  Module              Update ID         Type          Description
 ------------------- ----------------- ------------- --------------------------
  menu_link_content   make_menu_link_   post-update   Update custom menu links
                      content_revisio                 to be revisionable.
                      nable
  system              add_expand_all_   post-update   Initialize
                      items_key_in_sy                 'expand_all_items'
                      stem_menu_block                 values to
                                                      system_menu_block.
  system              clear_menu_cach   post-update   Clear the menu cache.
                      e                               @see
                                                      https:www.drupal.orgproj
                                                      ectdrupalissues3044364
  taxonomy            make_taxonomy_t   post-update   Update taxonomy terms to
                      erm_revisionabl                 be revisionable.
                      e
  taxonomy            remove_hierarch   post-update   Remove the 'hierarchy'
                      y_from_vocabula                 property from
                      ries                            vocabularies.
  views               exposed_filter_   post-update   Update exposed filter
                      blocks_label_di                 blocks label display to
                      splay                           be disabled.
  views               make_placeholde   post-update   Rebuild cache to allow
                      rs_translatable                 placeholder texts to be
                                                      translatable.
 ------------------- ----------------- ------------- --------------------------


 // Do you wish to run the specified pending updates?: yes.

>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  Exception thrown while performing a schema update. The table tmp_3297damenu_link_content_revision can not be renamed to menu_link_content_revision: The table menu_link_content_revision already exists.
>  [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Finished performing updates.

And, after execute:

$ drush php-eval "var_export(array_keys(\Drupal::service('entity.last_installed_schema.repository')->getLastInstalledDefinition('menu_link_content')->getKeys()));"
array (
  0 => 'id',
  1 => 'label',
  2 => 'langcode',
  3 => 'uuid',
  4 => 'bundle',
  5 => 'revision',
  6 => 'default_langcode',
  7 => 'revision_translation_affected',
  8 => 'published',

I need to find where in menu_link_content.post_update is the problem...

vuil’s picture

I found a similar issue https://www.drupal.org/project/drupal/issues/3052204 but for file_entity.

vuil’s picture

Assigned: Unassigned » vuil
Status: Postponed (maintainer needs more info) » Active
mixerowsky’s picture

I have same issue on drush updb. I'm getting:

>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  Error: Class 'Drupal\menu_item_extras\Entity\MenuItemExtrasMenuLinkContent' not found in Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords() (line 530 of /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php) #0 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(449): Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords(Array)
> #1 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(415): Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array)
> #2 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(291): Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array)
> #3 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php(175): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
> #4 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php(66): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->copyData(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #5 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(449): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->traitOnFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #6 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1542): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->onFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #7 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1607): Drupal\Core\Entity\Sql\SqlContentEntityStorage->Drupal\Core\Entity\Sql\{closure}()
> #8 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1543): Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException(Object(Closure))
> #9 /var/www/web/core/lib/Drupal/Core/Entity/EntityTypeListener.php(134): Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #10 /var/www/web/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php(229): Drupal\Core\Entity\EntityTypeListener->onFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #11 /var/www/web/core/modules/menu_link_content/menu_link_content.post_update.php(100): Drupal\Core\Entity\EntityDefinitionUpdateManager->updateFieldableEntityType(Object(Drupal\Core\Entity\ContentEntityType), Array, Array)
> #12 /var/www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(289): menu_link_content_post_update_make_menu_link_content_revisionable(Array)
> #13 /var/www/vendor/drush/drush/includes/batch.inc(251): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('menu_link_conte...', Object(DrushBatchContext))
> #14 /var/www/vendor/drush/drush/includes/batch.inc(196): _drush_batch_worker()
> #15 /var/www/vendor/drush/drush/includes/batch.inc(99): _drush_batch_command('39')
> #16 /var/www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(155): drush_batch_command('39')
> #17 [internal function]: Drush\Commands\core\UpdateDBCommands->process('39', Array)
> #18 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
> #19 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #20 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #21 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #22 /var/www/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #23 /var/www/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #24 /var/www/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #25 /var/www/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #26 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #27 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #28 /var/www/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
> #29 /var/www/vendor/drush/drush/includes/preflight.inc(18): require('/var/www/vendor...')
> #30 phar:///usr/local/bin/drush/bin/drush.php(141): drush_main()
> #31 /usr/local/bin/drush(10): require('phar:///usr/loc...')
> #32 {main}. 
amateescu’s picture

@mixerowsky, your problem seems to come from the Menu Item Extras contrib module. Is it currently installed on the site or was it installed at some point and then uninstalled?

azovsky’s picture

Have the similar issue on `drush updb`:

Failed: Drupal\Core\Entity\Query\QueryException: No revision table for menu_link_content, invalid query. in                  [error]
Drupal\Core\Entity\Query\Sql\Query->prepare() (line 98 of /var/www/.../core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
amateescu’s picture

@azovsky, can you post the full backtrace for that error?

azovsky’s picture

Sure, here is:

$ drush updb -y
The following updates are pending:

layout_builder module :
  Set the layout builder field as non-translatable where possible.
  Clear caches due to changes to annotation changes to the Overrides plugin.
  Clear caches due to the removal of the layout_is_rebuilding query string.
  Clear caches due to routing changes to changing the URLs for defaults.
  Clear caches due to routing changes to move the Layout Builder UI to forms.
  Clear caches due to changes to section storage annotation changes.
  Clear caches due to config schema additions.
  Add new custom block permission to all roles with 'configure any layout'.

layout_discovery module :
  Recalculate dependencies for the entity_form_display entity.
  Recalculate dependencies for the entity_view_display entity.

menu_link_content module :
  Update custom menu links to be revisionable.

system module :
  Initialize 'expand_all_items' values to system_menu_block.
  Clear the menu cache.   @see https:www.drupal.orgprojectdrupalissues3044364
  Clear the library cache and ensure aggregate files are regenerated.

taxonomy module :
  Update taxonomy terms to be revisionable.
  Remove the 'hierarchy' property from vocabularies.

views module :
  Update exposed filter blocks label display to be disabled.
  Rebuild cache to allow placeholder texts to be translatable.

Do you wish to run all pending updates? (y/n): y
Post updating layout_builder                                                                                                 [ok]
Failed: Drupal\Core\Entity\Query\QueryException: No revision table for menu_link_content, invalid query. in                  [error]
Drupal\Core\Entity\Query\Sql\Query->prepare() (line 98 of /var/www/.../core/lib/Drupal/Core/Entity/Query/Sql/Query.php).
Cache rebuild complete.                                                                                                      [ok]
Finished performing updates.                                                                                                 [ok]
amateescu’s picture

@azovsky, thanks, that was very helpful. Your error does not come from the menu_link_content update path, but from Layout Builder. Opened a separate issue for it: #3052431: layout_builder_post_update_make_layout_untranslatable() still attempts to query all revisions for non-revisionable entities

vuil’s picture

jedgar1mx’s picture

I did see #3039586, but the suggestion was to delete all the data that was there already

I deleted the menu_link_content and menu_link_content_revisions tables before re-importing the database and then it ran successfully.

Seems like a multiple try error, I did multiple database imports but still was getting this error.

waverate’s picture

Assigned: vuil » Unassigned
rshafakian’s picture

I'm getting a similar error: Ran composer update for core and then on updatedb i get the following:

[notice] Update started: system_update_8701
>  [notice] Update completed: system_update_8701
>  [notice] Update started: comment_update_8700
>  [notice] Update completed: comment_update_8700
>  [notice] Update started: system_update_8702
>  [notice] Update completed: system_update_8702
>  [notice] Update started: comment_update_8701
>  [notice] Update completed: comment_update_8701
>  [notice] Update started: content_moderation_update_8700
>  [notice] Update completed: content_moderation_update_8700
>  [notice] Update started: file_update_8700
>  [notice] Update completed: file_update_8700
>  [notice] Update started: node_update_8700
>  [notice] Update completed: node_update_8700
>  [notice] Update started: taxonomy_update_8701
>  [notice] Update completed: taxonomy_update_8701
>  [notice] Update started: comment_post_update_add_ip_address_setting
>  [notice] Update completed: comment_post_update_add_ip_address_setting
>  [notice] Update started: content_moderation_post_update_entity_display_dependencies
>  [notice] Update completed: content_moderation_post_update_entity_display_dependencies
>  [notice] Update started: content_moderation_post_update_set_default_moderation_state
>  [notice] Update completed: content_moderation_post_update_set_default_moderation_state
>  [notice] Update started: content_moderation_post_update_set_views_filter_latest_translation_affected_revision
>  [notice] Update completed: content_moderation_post_update_set_views_filter_latest_translation_affected_revision
>  [notice] Update started: layout_discovery_post_update_recalculate_entity_form_display_dependencies
>  [notice] Update completed: layout_discovery_post_update_recalculate_entity_form_display_dependencies
>  [notice] Update started: layout_discovery_post_update_recalculate_entity_view_display_dependencies
>  [notice] Update completed: layout_discovery_post_update_recalculate_entity_view_display_dependencies
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Custom menu links have been converted to be revisionable.
>  [notice] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  Placeholders must have a trailing [] if they are to be expanded with an array of values. 
>  [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Finished performing updates. 

I then have old_menu_link tables, but no tmp tables. If i run updatedb again then i get the tmp tables and i get the error Cannot rename tmp_57da5fmenu_link_content_revision to menu_link_content_revision: table menu_link_content_revision already exists.

waverate’s picture

@rshafakian. The table menu_link_content_revision already exists error comes from re-running updb a second time.

I would recommend either deleting the tmp_/old_ tables or restoring your db from backup and trying again to troubleshoot the root cause.

It looks like it is in:

>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  Placeholders must have a trailing [] if they are to be expanded with an array of values. 
>  [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable 
rshafakian’s picture

@waverate Yeah that comes from running it a second time. I've tried deleting the old/tmp tables (in all combinations, once just old, once just tmp, once both) and I still get errors. I've even tried emptying the tables to no avail. Any other suggestions?

amateescu’s picture

@rshafakian, you need to find the backtrace of the error that you posted in the other issue:

Placeholders must have a trailing [] if they are to be expanded with an array of values.

That's the real problem that needs to be fixed in order to be able to run the updates properly.

Matombo’s picture

I have the same issue,
i already tried deleting every entry in menu_link_content and menu_link_content_data as well as all colums exept the primary ones
still get the same error

amateescu’s picture

@Matombo, that means the problem is most likely not caused by the conversion of menu_link_content entities to revisionable, but by some other code which reacts to an entity type update. Can you post the full output of the first time you ran the update?

amateescu’s picture

@rshafakian, can you put this code in \Drupal\Core\Database\Connection on line 735, before the exception is thrown?

print_r(\Drupal\Core\Utility\Error::formatBacktrace(debug_backtrace()));

And paste the resulting backtrace here so we can try to figure out what's going on.

crifi’s picture

I also have this issue in two of my twenty multisite installations. The first PHP error is the following:

InvalidArgumentException: Placeholders must have a trailing [] if they are to be expanded with an array of values. in Drupal\Core\Database\Connection->expandArguments() (Line 735 in /var/www/drupal/web/core/lib/Drupal/Core/Database/Connection.php).

The update procedure is for make_menu_link_content_revisionable.

amateescu’s picture

@crifi, can you try the debugging steps from #26 and post the backtrace for that error?

crifi’s picture

Here is the backtrace as suggested by @amateescu:

Drupal\Core\Database\Connection->expandArguments('UPDATE {locales_target} SET translation=:db_update_placeholder_0, customized=:db_update_placeholder_1
WHERE (lid = :db_condition_placeholder_0) AND (language = :db_condition_placeholder_1)', Array) (Line: 619)
Drupal\Core\Database\Connection->query('UPDATE {locales_target} SET translation=:db_update_placeholder_0, customized=:db_update_placeholder_1
WHERE (lid = :db_condition_placeholder_0) AND (language = :db_condition_placeholder_1)', Array, Array) (Line: 358)
Drupal\Core\Database\Driver\mysql\Connection->query('UPDATE {locales_target} SET translation=:db_update_placeholder_0, customized=:db_update_placeholder_1
WHERE (lid = :db_condition_placeholder_0) AND (language = :db_condition_placeholder_1)', Array, Array) (Line: 148)
Drupal\Core\Database\Query\Update->execute() (Line: 393)
Drupal\Core\Database\Query\Merge->execute() (Line: 508)
Drupal\locale\StringDatabaseStorage->dbStringUpdate(Object) (Line: 125)
Drupal\locale\StringDatabaseStorage->save(Object) (Line: 185)
Drupal\locale\StringBase->save() (Line: 109)
Drupal\locale\TranslationString->save() (Line: 223)
Drupal\locale\LocaleConfigSubscriber->saveCustomizedTranslation('views.view.watchdog', 'No log messages available.', '', Array, 'de') (Line: 155)
Drupal\locale\LocaleConfigSubscriber->processTranslatableData('views.view.watchdog', Array, Array, 'de', Array) (Line: 152)
Drupal\locale\LocaleConfigSubscriber->processTranslatableData('views.view.watchdog', Array, Array, 'de', Array) (Line: 152)
Drupal\locale\LocaleConfigSubscriber->processTranslatableData('views.view.watchdog', Array, Array, 'de', Array) (Line: 152)
Drupal\locale\LocaleConfigSubscriber->processTranslatableData('views.view.watchdog', Array, Array, 'de', Array) (Line: 152)
Drupal\locale\LocaleConfigSubscriber->processTranslatableData('views.view.watchdog', Array, Array, 'de', Array) (Line: 152)
Drupal\locale\LocaleConfigSubscriber->processTranslatableData('views.view.watchdog', Array, Array, 'de', Array) (Line: 121)
Drupal\locale\LocaleConfigSubscriber->updateLocaleStorage(Object, 'de') (Line: 84)
Drupal\locale\LocaleConfigSubscriber->onConfigSave(Object, 'config.save', Object)
call_user_func(Array, Object, 'config.save', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('config.save', Object) (Line: 231)
Drupal\Core\Config\Config->save(1) (Line: 284)
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('watchdog', Object) (Line: 448)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 263)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 394)
Drupal\Core\Entity\EntityBase->save() (Line: 613)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 202)
Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber->onEntityTypeUpdate(Object, Object) (Line: 47)
Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber->onEntityTypeEvent(Object, 'entity_type.definition.update', Object)
call_user_func(Array, Object, 'entity_type.definition.update', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('entity_type.definition.update', Object) (Line: 138)
Drupal\Core\Entity\EntityTypeListener->onFieldableEntityTypeUpdate(Object, Object, Array, Array, Array) (Line: 229)
Drupal\Core\Entity\EntityDefinitionUpdateManager->updateFieldableEntityType(Object, Array, Array) (Line: 100)
menu_link_content_post_update_make_menu_link_content_revisionable(Array) (Line: 247)
update_invoke_post_update('menu_link_content_post_update_make_menu_link_content_revisionable', Array) (Line: 295)
_batch_process() (Line: 137)
_batch_do() (Line: 93)
_batch_page(Object) (Line: 186)
Drupal\system\Controller\DbUpdateController->handle('start', Object)
call_user_func_array(Array, Array) (Line: 115)
Drupal\Core\Update\UpdateKernel->handleRaw(Object) (Line: 76)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 28)
waverate’s picture

@crifi, @matombo, @i.vochkof and @rshafakian:

As noticed in #44 here #3039586: Cannot rename tmp_2362aemenu_link_content_revision to menu_link_content_revision, is your site in a non-English language without English enabled?

It seems that could be behind the Placeholders must have a trailing [] if they are to be expanded with an array of values. errors.

sallakane’s picture

Hi all,

I have the same problem, I deleted all tables tmp / old it did not change anything. I got backups of the menu_link_content tables and menu_link_content_revision still have the same problem. Other ideas to get us out of there?

 [notice] Update completed: media_post_update_enable_standalone_url
 [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Placeholders must have a trailing [] if they are to be expanded with an array of values.
 [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Finished performing updates.
Script bash ./bin/site-update.bash handling the site-update event returned with error code 1
 updates?: yes.
Matombo’s picture

@waverate
The workaround from that thread worked like a charm, thanks for pointing it out.

To repeat the solution in this thread:
1. If you had a previous failed update attempt and did not backup your database to roll back to: Delete the menu_link_content_revision and menu_link_content_field_revision tables and the corresponding tmp... and old... tables from your database.
2. Add english as a language to your site and make it the default language.
3. Run the database update
4. Change back the language settings

plach’s picture

@crifi:

Could you post the export of your views.view.watchdog and the list of installed modules? Also, could you specify whether the site is monolingual or multilingual? Is de the main language or a secondary language?

plach’s picture

Status: Active » Postponed (maintainer needs more info)
crifi’s picture

FileSize
8.48 KB
18.87 KB

See the attachments for the needed informations.

crifi’s picture

Status: Postponed (maintainer needs more info) » Active

The language de is the primary language. There is no secondary one.

crifi’s picture

crifi’s picture

FileSize
8.48 KB
18.95 KB

Sorry. In #35 I uploaded the files already in 8.7.0 after using the workaround of #32. So here are the files in the state of 8.6.15

plach’s picture

@crifi:

Thanks for the additional info! I was finally able to reproduce the Placeholders must have a trailing [] if they are to be expanded with an array of values. error, although while importing the config rather than during the update. However this shouldn't be relevant because in both cases we would be saving that config, so fixing the issue in the former case will work also in the latter. I think you're correct and the failed update is actually a combination of #2998103: dblog_update_8600() breaks views.view.watchdog config entity, leading to PHP warning on admin/reports/dblog and configuration import errors and #3052492: ViewsEntitySchemaSubscriber should not make an entity update fail if a view cannot be resaved. The patch posted in the latter issue should allow you to complete your upgrade successfully.

Tomorrow I will dig deeper into the error, but I suspect that this will turn out to be a "duplicate" of the two issues mentioned above.

VladimirAus’s picture

Here's what I get when running ./vendor/bin/drush -l site1 -y updatedb --debug

 // Do you wish to run the specified pending updates?: yes.                                                             

 [info] Executing: /projects/site1/vendor/drush/drush/drush updatedb:batch-process 9 --uri=site1 --root=/projects/site1/web [10.75 sec, 46.26 MB]
>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  Error: Class 'Drupal\menu_item_extras\Entity\MenuItemExtrasMenuLinkContent' not found in Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords() (line 530 of /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php) #0 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(449): Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords(Array)
> #1 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(415): Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array)
> #2 /projects/site1/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(291): Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array)
> #3 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php(175): Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array)
> #4 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php(66): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->copyData(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #5 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php(449): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->traitOnFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #6 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1542): Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->onFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #7 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1607): Drupal\Core\Entity\Sql\SqlContentEntityStorage->Drupal\Core\Entity\Sql\{closure}()
> #8 /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1543): Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException(Object(Closure))
> #9 /projects/site1/web/core/lib/Drupal/Core/Entity/EntityTypeListener.php(134): Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #10 /projects/site1/web/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php(229): Drupal\Core\Entity\EntityTypeListener->onFieldableEntityTypeUpdate(Object(Drupal\Core\Entity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType), Array, Array, Array)
> #11 /projects/site1/web/core/modules/menu_link_content/menu_link_content.post_update.php(100): Drupal\Core\Entity\EntityDefinitionUpdateManager->updateFieldableEntityType(Object(Drupal\Core\Entity\ContentEntityType), Array, Array)
> #12 /projects/site1/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(289): menu_link_content_post_update_make_menu_link_content_revisionable(Array)
> #13 /projects/site1/vendor/drush/drush/includes/batch.inc(251): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('menu_link_conte...', Object(DrushBatchContext))
> #14 /projects/site1/vendor/drush/drush/includes/batch.inc(196): _drush_batch_worker()
> #15 /projects/site1/vendor/drush/drush/includes/batch.inc(99): _drush_batch_command('9')
> #16 /projects/site1/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(155): drush_batch_command('9')
> #17 [internal function]: Drush\Commands\core\UpdateDBCommands->process('9', Array)
> #18 /projects/site1/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
> #19 /projects/site1/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #20 /projects/site1/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #21 /projects/site1/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #22 /projects/site1/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #23 /projects/site1/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #24 /projects/site1/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #25 /projects/site1/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #26 /projects/site1/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #27 /projects/site1/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #28 /projects/site1/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
> #29 /projects/site1/vendor/drush/drush/drush(4): require('/projects/site1...')
> #30 {main}. 
>  [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

In ProcessBase.php line 184:
                                      
  [InvalidArgumentException]          
  Unable to decode output into JSON.  
                                      

Exception trace:
 () at /projects/site1/vendor/consolidation/site-process/src/ProcessBase.php:184
 Consolidation\SiteProcess\ProcessBase->getOutputAsJson() at /projects/site1/vendor/drush/drush/includes/batch.inc:154
 _drush_backend_batch_process() at /projects/site1/vendor/drush/drush/includes/batch.inc:79
 drush_backend_batch_process() at /projects/site1/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php:429
 Drush\Commands\core\UpdateDBCommands->updateBatch() at /projects/site1/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php:69
 Drush\Commands\core\UpdateDBCommands->updatedb() at n/a:n/a
 call_user_func_array() at /projects/site1/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /projects/site1/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /projects/site1/vendor/consolidation/annotated-command/src/CommandProcessor.php:178
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /projects/site1/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:302
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /projects/site1/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /projects/site1/vendor/symfony/console/Application.php:978
 Symfony\Component\Console\Application->doRunCommand() at /projects/site1/vendor/symfony/console/Application.php:255
 Symfony\Component\Console\Application->doRun() at /projects/site1/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /projects/site1/vendor/drush/drush/src/Runtime/Runtime.php:118
 Drush\Runtime\Runtime->doRun() at /projects/site1/vendor/drush/drush/src/Runtime/Runtime.php:49
 Drush\Runtime\Runtime->run() at /projects/site1/vendor/drush/drush/drush.php:72
 require() at /projects/site1/vendor/drush/drush/drush:4

VladimirAus’s picture

@plach applying patch and cleaning up the views as per 2 issues you mentioned didn't help.

In addition getOutputAsJson() in ProcessBase gets

Error: Class 'Drupal\menu_item_extras\Entity\MenuItemExtrasMenuLinkContent' not found in Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords() (line 530 of /projects/site1/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
cilefen’s picture

@VladimirAus Does the class that is missing in the exception not exist? This seems like a separate issue.

plach’s picture

@VladimirAus:

That indeed seems another issue wrt what we were troubleshooting here, can you check whether the menu_item_extras module is enabled and exists in the file system?

VladimirAus’s picture

@plach @cilefen - module is not enabled on my site.

VladimirAus’s picture

VladimirAus’s picture

VladimirAus’s picture

Seems like MenuItemExtrasMenuLinkContent definition is in value column of key_value table

  • collection: entity.definitions.installed
  • name: menu_link_content.entity_type
mixerowsky’s picture

@amateescu currently it's not installed, not even files of it (not in composer). It was installed for some reason but removed right after.

sklompar’s picture

I'm having the same issue. Menu Item Extras was installed and removed. Getting the same error when trying to update the database after upgrading to 8.7.0.

rshafakian’s picture

@waverate thanks for the help! your help in comment #30 did the trick! I made english the default language and then ran the update and everything worked as it should!

Suvikki’s picture

The workaround in #32 worked for me too, but I restored the old database from backup after deleting menu_link_content_revision and menu_link_content_field_revision tables and the corresponding tmp tables.

oukjweather’s picture

I'm also having issues with the update to Drupal 8.7.0 from Drupal 8.6.15. My update runs alright, but I'm experiencing other issues:

$ drupal update:execute all

 Switch site into maintenance mode

 Executing required previous updates
 Executing update function "8701" of module "system"
 Executing update function "8700" of module "comment"
 Executing update function "8702" of module "system"
 Executing update function "8701" of module "comment"
 Executing update function "8700" of module "file"
 Executing update function "8700" of module "media"
 Executing update function "8700" of module "node"
 Executing update function "8701" of module "taxonomy"
 Executing update function "add_ip_address_setting" of module "comment"
 Executing update function "cancel_link_to_discard_changes_form" of module "layout_builder"
 Executing update function "discover_blank_layout_plugin" of module "layout_builder"
 Executing update function "discover_new_contextual_links" of module "layout_builder"
 Executing update function "fix_tempstore_keys" of module "layout_builder"
 Executing update function "layout_builder_dependency_change" of module "layout_builder"
 Executing update function "make_layout_untranslatable" of module "layout_builder"
 Executing update function "overrides_view_mode_annotation" of module "layout_builder"
 Executing update function "remove_layout_is_rebuilding" of module "layout_builder"
 Executing update function "routing_defaults" of module "layout_builder"
 Executing update function "routing_entity_form" of module "layout_builder"
 Executing update function "section_storage_context_definitions" of module "layout_builder"
 Executing update function "section_third_party_settings_schema" of module "layout_builder"
 Executing update function "update_permissions" of module "layout_builder"
 Executing update function "recalculate_entity_form_display_dependencies" of module "layout_discovery"
 Executing update function "recalculate_entity_view_display_dependencies" of module "layout_discovery"
 Executing update function "enable_standalone_url" of module "media"
 Executing update function "make_menu_link_content_revisionable" of module "menu_link_content"
 Executing update function "add_expand_all_items_key_in_system_menu_block" of module "system"
 Executing update function "clear_menu_cache" of module "system"
 Executing update function "make_taxonomy_term_revisionable" of module "taxonomy"
 Executing update function "remove_hierarchy_from_vocabularies" of module "taxonomy"
 Executing update function "exposed_filter_blocks_label_display" of module "views"
 Executing update function "make_placeholders_translatable" of module "views"

 Operating in maintenance mode off

 // update:entities
 Operating in maintenance mode on

 Starting the entity updates
 Finished the entity updates

 Operating in maintenance mode off
 // cache:rebuild

So as best as I can tell that works out ok. Not seeing any errors from it. However, when I load a page, I get an error:

The website encountered an unexpected error. Please try again later.
AssertionError: $attributes, if set, must be an array or object of type \Drupal\Core\Template\Attribute in assert() (line 285 of core/lib/Drupal/Core/Template/TwigExtension.php).
assert(, '$attributes, if set, must be an array or object of type \Drupal\Core\Template\Attribute') (Line: 285)
Drupal\Core\Template\TwigExtension->getLink('Contact', Object, NULL) (Line: 145)
__TwigTemplate_e6b3441e43e4fac415c94b23d48fe344bd92ad3d18066d4becb52be709db47c4->getmenu_links(Array, Object, 1, Array, Array) (Line: 692)
Twig\Template->getAttribute(Object, 'menu_links', Array, 'method') (Line: 152)
__TwigTemplate_e6b3441e43e4fac415c94b23d48fe344bd92ad3d18066d4becb52be709db47c4->getmenu_links(Array, Object, 0, Array, Array) (Line: 692)
Twig\Template->getAttribute(Object, 'menu_links', Array, 'method') (Line: 58)
__TwigTemplate_e6b3441e43e4fac415c94b23d48fe344bd92ad3d18066d4becb52be709db47c4->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array, Array) (Line: 63)
__TwigTemplate_b1b24ca43b3f2ead5631364fa7916d23fcda3ecf400a5233a468e5afcaea1c94->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array) (Line: 422)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/custom/{{ project }}/templates/menu--main.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('menu__main', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 93)
__TwigTemplate_dbf9fe3d442f37d35fa337b2b65baccd2021c03b14b8b35aac368de6efa88fcc->block_content(Array, Array) (Line: 216)
Twig\Template->displayBlock('content', Array, Array) (Line: 82)
__TwigTemplate_dbf9fe3d442f37d35fa337b2b65baccd2021c03b14b8b35aac368de6efa88fcc->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array) (Line: 422)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/bootstrap/templates/block/block--system-menu-block--main.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 142)
__TwigTemplate_865f192006a3adf63b94981ea3acff61adddf4a4daedb6995f66b33c2a142c38->block_navbar(Array, Array) (Line: 216)
Twig\Template->displayBlock('navbar', Array, Array) (Line: 69)
__TwigTemplate_865f192006a3adf63b94981ea3acff61adddf4a4daedb6995f66b33c2a142c38->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array) (Line: 422)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/custom/{{ project }}/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 102)
__TwigTemplate_1d8b245e8a9b3bdaa81512e702f4fe2662b0deba91e9d468a8c4c54b7052264f->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array) (Line: 422)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/bootstrap/templates/system/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

So inspected the twig template and found that when I commented out: {{ page.navigation_collapsible }}, I can get the page to render. So I go to the admin and try to look at the menu configuration and get this:

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Component\Plugin\Exception\PluginException</em>: Entity not found through the menu link plugin definition and could not fallback on UUID &#039;552f3361-0539-42c4-86bc-3247fcfdc355&#039; in <em class="placeholder">Drupal\menu_link_content\Plugin\Menu\MenuLinkContent-&gt;getEntity()</em> (line <em class="placeholder">157</em> of <em class="placeholder">core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php</em>). <pre class="backtrace">Drupal\menu_link_content\Plugin\Menu\MenuLinkContent-&gt;getEditRoute() (Line: 441)
Drupal\menu_ui\MenuForm-&gt;buildOverviewTreeForm(Array, 72) (Line: 478)
Drupal\menu_ui\MenuForm-&gt;buildOverviewTreeForm(Array, 72) (Line: 288)
Drupal\menu_ui\MenuForm-&gt;buildOverviewForm(Array, Object) (Line: 149)
Drupal\menu_ui\MenuForm-&gt;form(Array, Object) (Line: 117)
Drupal\Core\Entity\EntityForm-&gt;buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 519)
Drupal\Core\Form\FormBuilder-&gt;retrieveForm(&#039;menu_edit_form&#039;, Object) (Line: 276)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;menu_edit_form&#039;, Object) (Line: 93)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

So I think there must be some sort of error with what is in the database and what the code is expecting. Something that is not migrating well perhaps?

sklompar’s picture

@mixerowsky, a workaround for your issue is here: https://www.drupal.org/project/menu_item_extras/issues/3052746#comment-1...

marcus0263’s picture

OK I'm also running into the issue when upgrading from v8.6.15 > v8.7.0 with it blowing up with this error -

Failed: Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. Cannot rename tmp_c3fd10menu_link_content_revision to menu_link_content_revision: table menu_link_content_revision already exists. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1611 of /var/www/html/drupal-8.7.0/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

I've run the patch no luv ..
My site is also default English, I don't have multilingual core module installed

flocondetoile’s picture

Also running in this issue when upgrading 8.6.15 > 8.7.0 on a french only site.

[notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  Placeholders must have a trailing [] if they are to be expanded with an array of values. 
>  [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable 
 [error]  Finished performing updates. 

The error Placeholders must have a trailing [] if they are to be expanded with an array of values. broke the update and then can not anymore apply pending updates.

Applying the patch #13 from #3052492: ViewsEntitySchemaSubscriber should not make an entity update fail if a view cannot be resaved solved the issue.

Edit: Of course I have to start from a clean DB (drop everything and reimport a clean DB) on the dev environment, apply the patch and then run the updates.

Mars0test’s picture

Hi

Comment #55 work for me.

Thanks @flocondetoile

John_B’s picture

Edit: Of course I have to start from a clean DB (drop everything and reimport a clean DB) on the dev environment, apply the patch and then run the updates.

Maybe that is worth putting that in bold to save others time, since it another of many D8 gotchas whose cost my non-profit client cannot afford and I must absorb. Rolling back code and re-importing a db which previously worked is not sufficient to repair the site, unless all tables have been dropped first.

ifrik’s picture

I get the same issue on a site installed in German, with English as a second language.
Admin toolbar module and Admin toolbar extra tools module was installed initially, but has been uninstalled. There are no custom menu items anymore.
Uninstalling the Menu Content link module worked, but then a similar error happens with making the taxonomy terms revisionable #3052464: Cannot update to 8.7.0 because of taxonomy_post_update_make_taxonomy_term_revisionable.

jenger1965’s picture

Got the same error with D8.7.1.
Here the watchdog output:

Drupal\Core\Entity\EntityStorageException: The entity update process failed while processing the entity type menu_link_content, ID: 47. in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->copyData() 
(Zeile 216 in ***/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php).

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'enabled' cannot be null: 
INSERT INTO {tmp_fbd019menu_link_content_data} (id, revision_id, bundle, langcode, title, description, menu_name, link__uri, link__title, link__options, external, rediscover, weight, expanded, enabled, parent, changed, default_langcode, revision_translation_affected) 
VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18); Array ( [:db_insert_placeholder_0] => 47 [:db_insert_placeholder_1] => 47 [:db_insert_placeholder_2] => menu_link_content [:db_insert_placeholder_3] => de [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => N; [:db_insert_placeholder_10] => [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => [:db_insert_placeholder_15] => [:db_insert_placeholder_16] => [:db_insert_placeholder_17] => [:db_insert_placeholder_18] => 1 ) in Drupal\Core\Database\Connection->handleQueryException() 
(Zeile 689 in ****/core/lib/Drupal/Core/Database/Connection.php).
calbasi’s picture

I run in this issue and fix from #32 does the trick.

My site is part of a multisite. And I have found this error only in the default site (it has Spanish as the only language). But one of the other 2 sites has Spanish as the only language, and don't run into this issue.

aerozeppelin’s picture

@Matombo, thank you for the listing the steps in #32, it fixed the issue on my end.

Tritof’s picture

I have the same error on 2 sites. It may be the dumbest observation of all time, but I noticed that the 7 db updates not working are the ones without numeric ids. The 5 other updates stating with a numeric ids are passing through the update process:

system module

  • 8701 - Remove the unused 'system.theme.data' from state.
  • 8702 - Add the 'revision_translation_affected' entity key.
  • Initialize 'expand_all_items' values to system_menu_block.
  • Clear the menu cache. @see https:www.drupal.orgprojectdrupalissues3044364

file module

  • 8700 - Set the 'owner' entity key and update the field.

node module

  • 8700 - Set the 'owner' entity key and update the field.

taxonomy module

  • 8701 - Add an index on the 'taxonomy_term__parent' field table.
  • Update taxonomy terms to be revisionable.
  • Remove the 'hierarchy' property from vocabularies.

menu_link_content module

  • Update custom menu links to be revisionable.

views module

  • Update exposed filter blocks label display to be disabled.
  • Rebuild cache to allow placeholder texts to be translatable.
tzsl’s picture

I have the same problem with 1 of my 4 sites. It.s the site I have updated from D7 to D8. The other sites are build in D8.

menu_link_content-module
make_menu_link_content_revisionable bijwerken

Mislukt: InvalidArgumentException: Placeholders must have a trailing [] if they are to be expanded with an array of values. in Drupal\Core\Database\Connection->expandArguments() (regel 735 van /var/www/html/mv8/core/lib/Drupal/Core/Database/Connection.php).

13-5-2019 patch 3052492-13.patch solved the problem for me.

ru.bsv’s picture

Hello!
Comment #55 work for me.
Thanks a lot @flocondetoile

alfonsotem’s picture

Hello!
I have same issue on drush updb.My error is "[error] Update aborted by:
menu_link_content_post_update_make_menu_link_content_revisionable"
I tried to change default language but don't work.
i tried to delete the tmp_/old_ tables but I have the same issue.
thanks to everyone!

idanse’s picture

May be interesting for others too. For me the solution was:
uninstalling Database Logging, as suggested in #31 of
https://www.drupal.org/project/drupal/issues/3052542

flocondetoile’s picture

@idanse Yes because the view dblog generate an error during the update process. But it can have some others views with similar errors on a project. The best is then to apply the patch from #3052492: ViewsEntitySchemaSubscriber should not make an entity update fail if a view cannot be resaved or wait for 8.7.2

saganakat’s picture

Hello!
I have the same issue, when I tried update 8.6.15 to 8.7.1. I execute updatedb and my error is "[error] Update aborted by:
menu_link_content_post_update_make_menu_link_content_revisionable the table already exists"
I tried drop the tables and I have the same error.
I tried to change default lenguage and don't work for me.
Thanks to everyone.

alfonsotem’s picture

Hello!
Applying the patch https://www.drupal.org/project/drupal/issues/3052492 work for me.

saganakat’s picture

Thanks! The comment #69, the patch work for me

slashrsm’s picture

Patch mentioned in #70 fixed the issue for me as well.

vinyl_roads’s picture

Same problem, can't rename table, table exists (it seems to be the same issue here)
I've restored a back up, deleted manually the tables but still have issue.

Finally, thanks to this answer, I've installed English language and set it as defaults language (the website was in French). I've successfully updated DB with Drush and then delete English and restore French as default language.

renderfreak’s picture

If this can help anyone... Comment #6 here worked like a charm for me... I had to rollback my database to 8.6.15... But once i ran the update... No errors!!

VladimirAus’s picture

If you are getting

> [error] Error: Class 'Drupal\menu_item_extras\Entity\MenuItemExtrasMenuLinkContent' not found in Drupal\Core\Entity\Sql\SqlContentEntityStorage->mapFromStorageRecords()

I had to delete all menu items and then run drush updb to fix it.

SivaRam89’s picture

I was trying to update from 8.6.16 > 8.7.1. The patch at https://www.drupal.org/project/drupal/issues/3052492 did not work for me unfortunately, may be because I am using php 7.2. I had to manually drop the following tables and its corresponding temp ones to run the database update completely.

menu_link_content_revision
menu_link_content_field_revision

taxonomy_term_revision__parent
taxonomy_term_revision
taxonomy_term_field_revision
taxonomy_term_revision__field_order

The temp tables will look something like "tmp_8458d9menu_link_content_revision".

Note: These tables are not present in 8.6.* versions. So, for this approach to work, you have to wait until it fails during the DB update and drop the corresponding table and its temp ones. For example, when the update fails with an error regarding 'menu_link_*' tables, drop both the above mentioned menu_link tables and its temp ones and try running the update. Then, if it fails later in the 'taxonomy_term_*' tables, drop all the above mentioned taxonomy_term tables and its temp ones and run the update again.

Use this approach only if #55 does not work. I am still testing the application and looks good so far. Will update if I run into any issues because of this workaround.

davo20019’s picture

I got the same problem because the VBO contrib module is in my repo and it needed to be updated before running the drush updb -y command (update.php). Steps to fix:

  1. composer require 'drupal/views_bulk_operations:2.x-dev'
  2. If you don't use composer in your project, you can update the module manually.

  3. drush sql-query "DROP TABLE menu_link_content_revision"
  4. drush sql-query "DROP TABLE menu_link_content_field_revision"

After the steps above I was able to run:
drush updb -y

baltazarz3’s picture

I faced same issues, the only way I could make this to work is similar procedure as posted on #75.

- run db update
- delete the tpm table that just failed ( ex: tmp_dca0aftaxonomy_term_field_revision )
- delete the main table ( ex: taxonomy_term_field_revision )
- delete the previous main table that failed ( ex: taxonomy_term_revision )
- run db update again to check next failure

The latest release 8.7.2 didn't help here because the problem comes from v 8.7.0 (I was upgrading from 8.6.x).

About "drush entup" being deprectaed, I used the devel_entity_updates module that helped me with pending entities updates.

marcus0263’s picture

I was banging my head with this, here's what worked for me finally following this solution from another thread

https://www.drupal.org/project/drupal/issues/3052542#comment-13112594

I finally was able to upgrade 8.6.16 > 8.7.2

FirstSanny’s picture

If your database is located in a different scheme, than 'website', then maybe you should read my comment here.

With this you probably can run the update successfully, but most of the tables are going in the wrong scheme. So i wouldn't recommend to update now.

vuil’s picture

Status: Active » Needs review

That works for us (Drupal core 8.6.16 update to 8.7.2, main language DE + second EN):

  1. drush sql-query "DROP TABLE menu_link_content_revision"
  2. drush sql-query "DROP TABLE menu_link_content_field_revision"
  3. drush updb -y

Thanks @davo20019 (#76)!

Erso’s picture

Had same issue, #76 / #80 worked for me too. But i hope this solution won't make another problem in future patches. ( Main language: English , there are 4 more languages)

hs@henrikstrindberg.se’s picture

Updated successfully from 8.6.16 to 8.7.2 after simply changing the default language from Swedish to English.

But before that I tried #80 without changing the default language and update failed:

>  [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
>  [error]  The entity update process failed while processing the entity type menu_link_content, ID: 249.
>  [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Finished performing updates.

I rolled back the database, changed the default language to English and successfully run drush updb -y

psf_’s picture

#82 don't work for me :(:

[notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Exception thrown while performing a schema update. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base_table.revision_id' in 'field list': SELECT base_table.revision_id AS revision_id, base_table.id AS id
FROM
{menu_link_content} base_table
GROUP BY base_table.revision_id, base_table.id
LIMIT 1 OFFSET 0; Array
(
)
 
 [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable 
SIPS’s picture

Try this (after backup) :

Go to https://xxxxx.xxx/update.php, don't touch anything.

drop table dp_menu_link_content_field_revision, dp_menu_link_content_revision;
drop table dp_tmp_xxxxxmenu_link_content_field_revision, dp_tmp_xxxxxxmenu_link_content_revision;

refresh https://xxxxx.xxx/update.php and finish the update process.

catch’s picture

Status: Needs review » Active

Moving back to active since there's no patch to review here yet.

vuil’s picture

Status: Active » Fixed
vuil’s picture

Status: Fixed » Closed (fixed)
FMB’s picture

How can this be fixed? There might be workarounds, but no patch has been pushed yet.

cilefen’s picture

Status: Closed (fixed) » Active
hs@henrikstrindberg.se’s picture

#84 That's very good if you have already run the update process. But those tables are created during the update process. I haven't seen them in any D8.6.x database.

joegl’s picture

We had this issue on a site we started building a few years ago with Drupal 8.2. What happened (and I don't know how) is we had two rows in the menu_link_content table that weren't in the menu_link_content_data table. The menu items didn't exist "on-site" as far as pulling them up by ID. I dropped the two rows from the menu_link_content table and was able to upgrade successfully after. I'm not sure how it happened though.

joelseguin’s picture

I was waiting for another 8.7 release to see if this was addressed because I ran into the same issue with 8.7's first release.

I have tried locally to update from 8.6.16 to 8.7.3 just now ... and it just worked! I did run into some composer issues while updating ended up removing vendor directory and core directory to get composer to update without errors.

So far so good. I'll be deploying to our server shortly and would assume that I'll get the same results since I pulled in the latest version of our database when doing this locally.

stevieb’s picture

joelseguin you should test in a dev environment first. just to be safe..

joelseguin’s picture

stevieb - just deployed on staging without any real issues. The only thing I noticed was that my primary home link has been deleted. All of my other nav items are there though. I just recreated my home menu item and back to normal.

yuseferi’s picture

after tried

drush sql-query "DROP TABLE menu_link_content_revision"
drush sql-query "DROP TABLE menu_link_content_field_revision"
drush updb -y

faced " [error] Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable"

any solution or patch?

this issue is preventing us to update from 8.6.14 to 8.7.3

mlhyyl’s picture

I managed to "solve" it by uninstalling the module "Custom Menu Links" and then updating the database via the UI. The drawback, you will/might lose most menu links.

joegl’s picture

We also had the Custom Menu Links module installed when we got this issue. See my original comment here (#91): https://www.drupal.org/project/drupal/issues/3052318#comment-13142344

I wonder the Custom Menu Links module is related.

jedgar1mx’s picture

It is possible that any other modules that affect menus could break this update.

John_B’s picture

FWIW I was seeing this problem when trying to run updates before ensuring that all my entities were updated: there were mismatched entity definitions. drush entup would not run. Dropping an index on users table as per https://drupal.stackexchange.com/questions/221930/mismatched-entity-and-... allowed me to run drush entup *before* updating code, after which I updated code then drush updb worked. That particular small D8 core update cost me several days debugging the issue (as well as multiple composer bugs) and a phpStorm licence :-)

Why sorting out my other updates problems apparently cured the menu_link_content update error is not clear.

blink38’s picture

I have the same error when trying to update database on drupal 8.7.3.

After menu_link_content udate 
Failed: Drupal\Core\Entity\EntityStorageException : The entity update process failed while processing the entity type menu_link_content, ID: 12. dans Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema-&gt;copyData()

The reason was I had an entry in the menu_link_content table with ID = 12 but no entry in the menu_link_content_data.

After removing all entries in menu_link_content which have no entry in menu_link_content_data, drush updb work perfectly.

This SQL will give you all entries to remove :

select m.id as id from menu_link_content m where m.id not in ( select id from menu_link_content_data);

vuil’s picture

mr_fenix’s picture

Added a patch that will remove problem tables

vuil’s picture

Status: Active » Needs review
catch’s picture

Issue tags: +Drupal 8 upgrade path
catch’s picture

Issue tags: +WI critical
RedLucas25’s picture

I'm battling with this similar problem. Tried to patch and for whatever reason am getting Failed: Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. Cannot rename menu_link_content_revision to old_3c3aa8menu_link_content_revision: table menu_link_content_revision doesn't exist. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1607 of /var/aegir/platforms/dev2-lucas/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Going to be investigating further, since I really need this fixed, but if anyone has any ideas... Ya, I'll keep y'all posted as well.

And yes, in the DB this table does indeed exist.

q__nt_n’s picture

#102 Thanks for your patch but it didn't work the first time. I had to modify it by updating the list of tables to be deleted.
This is specific to each project so I don't propose a patch.

FYI : I add tables like taxonomy_term_r__* and all tables like taxonomy_term_revision__

prsnjtbarman’s picture

I got an error while running "drush updb"

[error] It is not possible to change the entity type schema outside of a batch context. Use EntityDefinitionUpdateManagerInterface::updateFieldableEntityType() instead.

The module "menu_link_extras" which is not getting uninstalled with below command,

drush pm-uninstall menu_item_extras

Shows error like,

In SqlContentEntityStorageSchema.php line 408:

It is not possible to change the entity type schema outside of a batch context. Use EntityDefinitio
nUpdateManagerInterface::updateFieldableEntityType() instead.

AbdeI’s picture

Hello,

Thanks to #102 for the patch, however ive had to update it as well. Here it is.

q__nt_n’s picture

Hi Abdel,

Could you add an interdiff please ?
And as I said in #107, your tables in taxonomy_post_update_make_taxonomy_term_revisionable_patched method are specific to your project. For example, this is my table's list :

  $tables = [
    'taxonomy_term_r__7c531264f3',
    'taxonomy_term_r__cce99ae37d',
    'taxonomy_term_revision__field_code',
    'taxonomy_term_field_revision',
    'taxonomy_term_revision',
    'taxonomy_term_revision__field_all',
    'taxonomy_term_revision__field_baseline',
    'taxonomy_term_revision__field_bloc',
    'taxonomy_term_revision__field_body',
    'taxonomy_term_revision__field_highlight',
    'taxonomy_term_revision__field_is_displayed',
    'taxonomy_term_revision__field_is_displayed_en',
    'taxonomy_term_revision__field_metatags',
    'taxonomy_term_revision__field_pole',
    'taxonomy_term_revision__field_subtitle',
    'taxonomy_term_revision__parent',
    'taxonomy_term_r__73a57a736d',
    'taxonomy_term_r__c35172942d'
  ];

May be we could do this dynamically ? I'll try this week-end

plach’s picture

Title: update from 8.6.15 to 8.7 fails due to menu_link_content » Update from 8.6.15 to 8.7 fails due to menu_link_content
Status: Needs review » Active

Guys, no point in working on a patch that's removing tables as it won't be accepted, since the update is meant to be run just once. See #3039586-103: Cannot rename tmp_2362aemenu_link_content_revision to menu_link_content_revision for more details. What we need is to figure what's causing the error reported in the IS, #100 is helpful from this POV. We need to figure out how to make sure that the SqlContentEntityStorageSchema::copyData() doesn't fail when dealing with corrupt entity data.

Setting back to active since the current patches are going in a completely different direction and are only useful as workarounds.

plach’s picture

Title: Update from 8.6.15 to 8.7 fails due to menu_link_content » Update from 8.6.15 to 8.7 fails due to corrupt "menu_link_content" entity data
owenbush’s picture

I am currently seeing this upgrading to 8.7.8

Drupal\Core\Entity\EntityStorageException: The entity update process failed while processing the entity type menu_link_content, ID: 1. in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->copyData() (line 216 of /path/to/site/docroot/core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php).

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null: INSERT INTO {tmp_cb7316menu_link_content} (id, revision_id, bundle, uuid, langcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
                        t                   (
                                                [:db_insert_placeholder_0] => 1
                                                [:db_insert_placeholder_1] => 1
                                                [:db_insert_placeholder_2] =>
                                                [:db_insert_placeholder_3] => 02a23cb1-78c1-4faa-891e-4126cf35da82
                                                [:db_insert_placeholder_4] => en

All of my rows in menu_link_content have a bundle field value so I am not sure what is going on here. Also, all my menu_link_content entries have a corresponding menu_link_content_data entry.

I'll investigate a little and see if I can figure anything out.

John_B’s picture

Maybe experiment with dropping index on the problem table, using a safe copy of the db, *before* any other attmept attempt at db updates? It worked for me in #99. Dropping the index is probably wrong, we should 'optimize table'. However, if dropping the index on a copy of the db allows entity update to run, it helps diagnose the cause of the issue.

Quite why D8 appears susceptible to corrupt db indexes is a bigger question.

owenbush’s picture

I think I have found what is causing my particular issue in #113. But I haven't quite figured out what to do about it.

It looks like the bundle field for menu_link_content is now an entity reference field, but the active field definition being used is a string. So when SqlContentEntityStorage::mapToStorageRecord() is called the column name it is attempting to use is 'value' (taken from the active field storage definitions), but given that the field is an entity_reference field that returns NULL. In this case it would need to use target_id rather than value.

$last_installed_schema_repository = \Drupal::service('entity.last_installed_schema.repository');
$last_installed_defs = $last_installed_schema_repository->getLastInstalledFieldStorageDefinitions('menu_link_content');
var_dump($last_installed_defs['bundle']->getType());

$field_storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions('menu_link_content');
var_dump($field_storage_definitions['bundle']->getType());

Results in:

eval()'d code:3:string 'string' (length=6)
eval()'d code:6:string 'entity_reference' (length=16)

EDIT: I finally managed to get D8.7.8 to install and updates to run after updating the menu_item_extras module. Ugh.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.9 was released on November 6 and is the final full bugfix release for the Drupal 8.7.x series. Drupal 8.7.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.8.0 on December 4, 2019. (Drupal 8.8.0-beta1 is available for testing.)

Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

gourav.yadav’s picture

Thanks #80 worked for me!

Wim Leers’s picture

@gourav.yadav See @plach's explanation in #111 for why this is not considered an acceptable solution for Drupal core.

catch’s picture

DamienMcKenna’s picture

Tagging as a requirement for Drupal 9.0-beta1.

catch’s picture

Issue summary: View changes

Updated the issue summary to try to make it clearer what actually needs fixing in this issue.

heddn’s picture

Part of the issue seems from menu_item_extras

From slack:

René Wolf 3 hours ago
It was caused by an uninstalled module (menu_item_extras) that left some leftovers in the database (already reported in bugs). Adding the module again, installing and deinstalling solved that problem.

AndyF’s picture

Status: Active » Needs review
FileSize
4.04 KB

Updated the issue summary to try to make it clearer what actually needs fixing in this issue.

Thanks! I've started the ball rolling with the hook_requirements() code. It's my first time writing an update test so careful review welcome (: There's no interdiff as I think it's a different approach to the others.

Some things I wasn't sure about:

  1. Rather than use the DB API to detect the problem in hook_requirements, I used an entity query testing if enabled is null.
  2. Should menu_link_content_field_revision and/or menu_link_content_revision be populated in \Drupal\Tests\menu_link_content\Functional\Update\MenuLinkContentUpdateTest::testMissingDataUpdateRequirementsCheck?
  3. A clear helpful message to display on failing the requirement (:

We still need to write a change record with instructions IIUC. Thanks!

AndyF’s picture

FileSize
4.08 KB
585 bytes

Oops, reroll against 8.8.x...

alexpott’s picture

  1. +++ b/core/modules/menu_link_content/menu_link_content.install
    @@ -18,6 +18,39 @@ function menu_link_content_install() {
    +  // Check for invalid data before making links revisionable.
    +  /** @var \Drupal\Core\Update\UpdateRegistry $registry */
    +  $registry = \Drupal::service('update.post_update_registry');
    +  $pending_updates = $registry->getPendingUpdateFunctions();
    +  $update_name = 'menu_link_content_post_update_make_menu_link_content_revisionable';
    +  if ($phase === 'update' && in_array($update_name, $pending_updates, TRUE)) {
    

    I wonder if it is worth not only doing this on update. Like it might be nice to have this error on system status before running updates. I agree with only making the check if the menu_link_content_post_update_make_menu_link_content_revisionable is pending.

  2. +++ b/core/modules/menu_link_content/menu_link_content.install
    @@ -18,6 +18,39 @@ function menu_link_content_install() {
    +    $is_broken = \Drupal::entityQuery('menu_link_content')
    +      ->condition('enabled', NULL, 'IS NULL')
    +      ->range(0, 1)
    +      ->accessCheck(FALSE)
    +      ->execute();
    

    Do we need to worry about the situation where there are no menu_link_content entities? I think we might - we could make this a count query.

  3. +++ b/core/modules/menu_link_content/tests/src/Functional/Update/MenuLinkContentUpdateTest.php
    @@ -103,6 +103,28 @@ public function testConversionToRevisionable() {
    +    require_once __DIR__ . '/../../../fixtures/update/drupal-8.corrupt-menu-link-content-data.3052318.php';
    

    I think given this is a single query I'd inline it into the test as it makes it easy to see what is going on.

  4. The test looks good. Let's see what DrupalCI thinks
  5. I agree working out what to say to a user if going to be hard. +1 for pointing to CR on d.o that we can update with further helpful info as we work stuff out.
catch’s picture

Like it might be nice to have this error on system status before running updates.

Do you mean without checking if the post update has run so it's a permanent data-integrity checker? If so that seems like a good idea yeah.

Linking to a CR is the best we can do for more information.

catch’s picture

Created a stub CR we can link to at https://www.drupal.org/node/3117753

AndyF’s picture

Addresses points in #125 + #126:

  1. I agree with only making the check if the menu_link_content_post_update_make_menu_link_content_revisionable is pending.

    Do you mean without checking if the post update has run so it's a permanent data-integrity checker? If so that seems like a good idea yeah.

    (:
    I've updated it to check at runtime as well, but have left it checking if the post_update_hook has run for the time being.

  2. Totally happy to make the change, but... what's the issue with having no menu_link_content entities?! I would just expect an empty result from the entity query?
  3. Thanks, done.
catch’s picture

I've updated it to check at runtime as well, but have left it checking if the post_update_hook has run for the time being.

That will be a no-op on runtime, because every site that updates to the version with this code in, will run the post update at the same time, if they haven't run it already.

catch’s picture

Status: Needs review » Needs work

Moving to needs work for #129. If we check this outside update, we shouldn't also check for the post update having not run, otherwise that code will never get executed.

AndyF’s picture

Status: Needs work » Needs review
FileSize
3.38 KB
3.84 KB

Thanks @catch for the review!

That will be a no-op on runtime, because every site that updates to the version with this code in, will run the post update at the same time, if they haven't run it already.

This is I think what was suggested in #125-1. I was imagining it was a bit like the database updates check in system_requirements() (ie if you've done everything correctly you shouldn't really see it I don't think?). Anyway I've updated it to be a general runtime and install data integrity check. I haven't added an explicit test for the runtime check.

Also still curious if we need to do anything with the query per #125-2? Thanks!

alexpott’s picture

  • So my idea of using a count query is unnecessary. I thought no rows might set $is_broken to TRUE - but that's not the case. I've tested locally an no entities the entity query returns an empty array.
  • @catch is correct in #126 that checking on runtime only when the update hasn't run is pointless. So now we're left with the question of whether the permanent check is worth it.

@catch has pointed out that the patch in #131 means if someone runs into the data integrity issue in the future, they won't be able to run any updates.

Sorry I've sidetracked things a bit but I think we should go back to checking the update hasn't run and only during updates. My bad. And thanks @AndyF for all the patches.

catch’s picture

Status: Needs review » Needs work

Maybe a follow-up for a runtime data-integrity checker? We could do this for all content entity types too.

Back to needs work again, sorry for confusion.

AndyF’s picture

Status: Needs work » Needs review
FileSize
3.62 KB
3.35 KB

Thanks both, we're getting there (:

catch’s picture

+++ b/core/modules/menu_link_content/menu_link_content.install
@@ -18,6 +18,40 @@ function menu_link_content_install() {
+
+  // Check for invalid data before making links revisionable.
+  /** @var \Drupal\Core\Update\UpdateRegistry $registry */
+  $registry = \Drupal::service('update.post_update_registry');
+  $pending_updates = $registry->getPendingUpdateFunctions();
+  $update_name = 'menu_link_content_post_update_make_menu_link_content_revisionable';
+  if ($phase === 'update' && in_array($update_name, $pending_updates, TRUE)) {

One more thing - we should check $phase === 'update' before we get pending update functions - this might require a nested if, but it will reduce the work we're doing for other hook_requirements() calls.

Apart from that I think this is ready.

plach’s picture

Status: Needs review » Needs work

I discussed this a bit with @catch: we agreed that it would be good to implement the exact same check also for taxonomy terms, for good measure.

@AndyF:

I'm available to work on this myself if you don't have time for it.

AndyF’s picture

Thanks @plach! Just double-checking, is that meant to be for this issue, or as part of the follow-up issue mentioned in #133?

plach’s picture

@AndyF:

In this issue we need to apply the check for both entity types by simply duplicating the logic, while in the follow-up we will work on the generic data-integrity checker.

AndyF’s picture

Thanks @plach. Ah, I presume connected with taxonomy_post_update_make_taxonomy_term_revisionable()? Happy to add that: do we want to direct folk to the same CR in both situations, or does it make sense to have a more targeted one for each situation?

plach’s picture

Correct, taxonomy_post_update_make_taxonomy_term_revisionable() is doing the same operation, so theoretically people can experience the same issues with missing data table records. The issue reported in #3056543: taxonomy_post_update_make_taxonomy_term_revisionable() and the menu link content equivalent fail when entities have no default translation might actually be an instance of that.

I'd go with a single CR and maybe add an example for each entity type just in case.

AndyF’s picture

Cheers!

  • Only check pending updates in update phase.
  • Add check and test for taxonomy_post_update_make_taxonomy_term_revisionable().
plach’s picture

Code looks great, I updated the CR to mention also taxonomy terms.

The last submitted patch, 141: 3052318-141.patch, failed testing. View results

AndyF’s picture

catch’s picture

Status: Needs review » Reviewed & tested by the community

I think this is ready to go!

xjm’s picture

It looks like we also need a 9.0.x-specific version of this since #141 did not apply to 9.0.x?

xjm’s picture

(Because of the removed pre-8.8.0 upgrade paths, presumably.)

catch’s picture

The post updates will be removed from 9.0.x (and already don't run), so this is an 8.8/8.9-only patch.

xjm’s picture

+++ b/core/modules/menu_link_content/menu_link_content.install
@@ -18,6 +18,41 @@ function menu_link_content_install() {
+          'description' => t('The %update_name function cannot be run until the data has been fixed. See the <a href=":change_record">change record</a> for more information.', [

+++ b/core/modules/taxonomy/taxonomy.install
@@ -10,6 +10,41 @@
+    $update_name = 'taxonomy_post_update_make_taxonomy_term_revisionable';
...
+          'description' => t('The %update_name function cannot be run until the data has been fixed. See the <a href=":change_record">change record</a> for more information.', [

One concern with the description here. A site owner isn't going to know what "The taxonomy_post_update_make_taxonomy_term_revisionable() function" is, or why they would care if they could run it or not. Wouldn't it be better to simply tell the user that database updates can't be run?

I've also some concerns with #148, but discussing that with @catch now.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Or, if we want to include the function name for debugging purposes:

The taxonomy_post_update_make_taxonomy_term_revisionable() database update cannot be run until...

Sorted #148 and all good on that front.

catch’s picture

#150 looks like a good wording change. I think it's worth leaving the function name in for debugging and googling purposes. This alerts site owners to one data integrity issue, but we also have #3056543: taxonomy_post_update_make_taxonomy_term_revisionable() and the menu link content equivalent fail when entities have no default translation and potential issues with contrib modules too, so a very unlucky person might see that function name a couple of times, first time as update requirements warning, second time as backtrace for a database exception.

plach’s picture

The database updates report looks like this:

So for consistency we could display:

The make_taxonomy_term_revisionable database update cannot be run until...

xjm’s picture

Yep, I was actually thinking of suggesting removing the parentheses, so +1.

mikelutz’s picture

mikelutz’s picture

Status: Needs work » Needs review
mikelutz’s picture

And a re-roll for 8.9?

The last submitted patch, 154: 3052318-154.8.8-drupal.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 156: 3052318-156.8.9.drupal.patch, failed testing. View results

xjm’s picture

Yep. We'll also need to update the tests to check for the new message.

xjm’s picture

Status: Needs review » Needs work

We should also still remove the parentheses as suggested by @plach. (If we remove the module prefix, it's no longer a valid function name.)

AndyF’s picture

Status: Needs work » Needs review
FileSize
6.97 KB
4.73 KB

Remove parentheses and correct the check if the post update has run, thanks.

AndyF’s picture

And #162 rerolled for 8.9.

catch’s picture

Status: Needs review » Reviewed & tested by the community

The new message in #162 is a good improvement. Also the change record now has examples for both menu links and taxonomy terms.

Back to RTBC.

xjm’s picture

+++ b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyTermUpdatePathTest.php
@@ -209,6 +210,35 @@ public function testConversionToRevisionable() {
+    Database::getConnection()->insert('taxonomy_term_data')
+      ->fields([
+        'tid' => '6',
+        'vid' => 'tags',
+        'uuid' => 'd5fd282b-df66-4d50-b0d1-76bf9eede9c5',
+        'langcode' => 'en',
+      ])
+      ->execute();

A nitpick is that it might have been good to have a comment here something like "Insert invalid data for a non-existent taxonomy term." (And the same but "non-existent menu link" for the menu link test.)

jungle’s picture

xjm’s picture

That looks great, thank you @jungle!

xjm’s picture

Title: Update from 8.6.15 to 8.7 fails due to corrupt "menu_link_content" entity data » Update from 8.6 to 8.7 fails due to corrupt menu_link_content or taxonomy_term entity data
xjm’s picture

Saving issue credit.

xjm’s picture

A few more.

xjm’s picture

Issue tags: +8.8.4 release notes

We'll want to mention this in the 8.8.4 release notes, because it's just giving them additional information on how to run their updates, rather than actually resolving the issue for them. Something like:

If you were unable to update to 8.7 due to issues with menu link or taxonomy term data, Drupal 8.8.4 now adds instructions for resolving this issue. Try installing 8.8.4 and running update.php again. If you see an error that there are "Integrity issues detected" for your site data, follow the instructions in the change record to attempt to repair the data so that updates can be run.

  • xjm committed 89898f0 on 8.9.x
    Issue #3052318 by AndyF, mikelutz, andypost, jungle, AbdeI, mr_fenix,...
xjm’s picture

Version: 8.8.x-dev » 8.9.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Patch (to be ported)

Meanwhile, the test runs have passed on all three databases supported by Drupal 8, so committed and pushed to 8.9.x!

Can we get an 8.8.x version of the latest patch in #166?

xjm’s picture

Version: 8.9.x-dev » 8.8.x-dev
catch’s picture

Status: Patch (to be ported) » Needs review
FileSize
7.17 KB

Applied with patch -p1 with a bit of fuzz.

xjm’s picture

Status: Needs review » Reviewed & tested by the community

Did a diff -uP locally to confirm the two patches are the same thing. Waiting on the bot, though.

  • xjm committed 65740f7 on 8.8.x
    Issue #3052318 by AndyF, mikelutz, andypost, jungle, catch, AbdeI,...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

..Which is done now. Committed the backport to 8.8.x. (I published the CR already.) Thanks!

xjm’s picture

Status: Fixed » Patch (to be ported)

Meant to leave this open for a potential 8.7.x backport.

catch’s picture

Version: 8.8.x-dev » 8.7.x-dev
AndyF’s picture

Status: Patch (to be ported) » Needs review
FileSize
7.07 KB
4.07 KB

Rolled against 8.7, thanks.

plach’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

  • catch committed bc042bd on 8.7.x
    Issue #3052318 by AndyF, mikelutz, andypost, jungle, catch, AbdeI,...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +8.7.12 release notes

Committed bc042bd and pushed to 8.7.x. Thanks!

jedgar1mx’s picture

This is awesome, great work everyone!!

vuil’s picture

Well done! Congratulations!

#181 works perfectly on Drupal 8.7.11
(the patch will be published in the 8.7.12 stable release)

vuil’s picture

xjm’s picture

Issue tags: -8.8.4 release notes, -8.7.12 release notes +8.8.5 release notes, +8.7.13 release notes

Because CKEditor.

xjm’s picture

Issue tags: +8.9.0 release notes

Also putting this in the 8.9.0-beta1 release notes since that release is going to be out before 8.8.5.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dadderley’s picture

Hi,

This issue is marked as being fixed.

But after several days of trying, I am unable to update a site from drupal-8.6.17 to 8.7.7 (or any version)

I did patch apply this patch (#181 3052318-180.8.7.patch) to my 8.7.11 installation.
https://www.drupal.org/project/drupal/issues/3052318#comment-13495986

I also enabled the language module so the taxonomies have English set as the default language.

This is the last output when trying to update a happy 8.6.17 install to 8.7.11

[success] Finished performing updates.
➜  snowseekers-2 drush st
 Drupal version   : 8.7.11
 Site URI         : default
 DB driver        : mysql
 DB port          : 3306
 DB username      : root
 DB name          : snow22
 Database         : Connected
 Drupal bootstrap : Successful
 Default theme    : bartik
 Admin theme      : seven
 PHP binary       : /Applications/MAMP/bin/php/php7.2.22/bin/php
 PHP config       : /Applications/MAMP/bin/php/php7.2.22/conf/php.ini
 PHP OS           : Darwin
 Drush script     : /usr/local/bin/drush
 Drush version    : 9.5.0
 Drush temp       : /tmp
 Drush configs    : /Users/dadder/Sites/snowseekers-2/vendor/drush/drush/drush.yml
 Install profile  : standard
 Drupal root      : /Users/dadder/Sites/snowseekers-2
 Site path        : sites/default
 Files, Public    : sites/default/files
 Files, Private   : sites/default/files/private
 Files, Temp      : /tmp

➜  snowseekers-2 drush cr
 [success] Cache rebuild complete.

➜  snowseekers-2 drush updatedb
 ------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------
  Module              Update ID                                       Type            Description
 ------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------
  system              8701                                            hook_update_n   Remove the unused 'system.theme.data' from state.
  system              8702                                            hook_update_n   Add the 'revision_translation_affected' entity key.
  comment             8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  comment             8701                                            hook_update_n   Make the 'entity_type' and 'field_name' comment fields required.
  file                8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  media               8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  media_library       8701                                            hook_update_n   Create the 'media_library' image style.
  media_library       8702                                            hook_update_n   Updates the media library view widget display (contextual) filters.
  node                8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  taxonomy            8701                                            hook_update_n   Add an index on the 'taxonomy_term__parent' field table.
  taxonomy            8702                                            hook_update_n   Fix the parent field langcode data.
  comment             add_ip_address_setting                          post-update     Add comment settings.
  layout_discovery    recalculate_entity_form_display_dependencies    post-update     Recalculate dependencies for the entity_form_display entity.
  layout_discovery    recalculate_entity_view_display_dependencies    post-update     Recalculate dependencies for the entity_view_display entity.
  media_library       add_media_library_image_style                   post-update     Create the 'media_library' image style if necessary.
  media_library       display_modes                                   post-update     Create and configure Media Library form and view displays for media types.
  media_library       table_display                                   post-update     Add a table display to the media library view and link gridtable displays.
  media               enable_standalone_url                           post-update     Keep media items viewable at media{id}.
  menu_link_content   make_menu_link_content_revisionable             post-update     Update custom menu links to be revisionable.
  system              add_expand_all_items_key_in_system_menu_block   post-update     Initialize 'expand_all_items' values to system_menu_block.
  system              clear_menu_cache                                post-update     Clear the menu cache.   @see https:www.drupal.orgprojectdrupalissues3044364
  taxonomy            make_taxonomy_term_revisionable                 post-update     Update taxonomy terms to be revisionable.
  taxonomy            remove_hierarchy_from_vocabularies              post-update     Remove the 'hierarchy' property from vocabularies.
  views               exposed_filter_blocks_label_display             post-update     Update exposed filter blocks label display to be disabled.
  views               make_placeholders_translatable                  post-update     Rebuild cache to allow placeholder texts to be translatable.
 ------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------

 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > yes

 [notice] Update started: system_update_8701
 [ok] Update completed: system_update_8701
 [notice] Update started: comment_update_8700
 [ok] Update completed: comment_update_8700
 [notice] Update started: media_library_update_8701
 [ok] Update completed: media_library_update_8701
 [notice] Update started: taxonomy_update_8701
 [ok] Update completed: taxonomy_update_8701
 [notice] Update started: system_update_8702
 [ok] Update completed: system_update_8702
 [notice] Update started: comment_update_8701
 [ok] Update completed: comment_update_8701
 [notice] Update started: file_update_8700
 [ok] Update completed: file_update_8700
 [notice] Update started: media_update_8700
 [ok] Update completed: media_update_8700
 [notice] Update started: media_library_update_8702
 [ok] Update completed: media_library_update_8702
 [notice] Update started: node_update_8700
 [ok] Update completed: node_update_8700
 [notice] Update started: taxonomy_update_8702
 [ok] Update completed: taxonomy_update_8702
 [notice] Update started: comment_post_update_add_ip_address_setting
 [ok] Update completed: comment_post_update_add_ip_address_setting
 [notice] Update started: layout_discovery_post_update_recalculate_entity_form_display_dependencies
 [ok] Update completed: layout_discovery_post_update_recalculate_entity_form_display_dependencies
 [notice] Update started: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [ok] Update completed: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [notice] Update started: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [ok] Update completed: layout_discovery_post_update_recalculate_entity_view_display_dependencies
 [notice] Update started: media_library_post_update_add_media_library_image_style
 [notice] The Media Library (220x220) image style has been created successfully.
 [ok] Update completed: media_library_post_update_add_media_library_image_style
 [notice] Update started: media_library_post_update_display_modes
 [notice] Media Library form and view displays have been created for the following media types: Video.
 [ok] Update completed: media_library_post_update_display_modes
 [notice] Update started: media_library_post_update_table_display
 [ok] Update completed: media_library_post_update_table_display
 [notice] Update started: media_post_update_enable_standalone_url
 [ok] Update completed: media_post_update_enable_standalone_url
 [notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Exception thrown while performing a schema update. Cannot rename tmp_b3876amenu_link_content_revision to menu_link_content_revision: table menu_link_content_revision already exists.
 [error]  Update failed: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable
 [error]  Finished performing updates.
.

I have scoured the issue pages and have not found a solution. I have spent a couple of days on this already.

And as I was about to publish this, I noticed the blurb on the top of the page:

If you were unable to update to 8.7 due to issues with menu link or taxonomy term data, Drupal 8.8.4 now adds instructions for resolving this issue. Try installing 8.8.4 and running update.php again. If you see an error that there are "Integrity issues detected" for your site data, follow the instructions in the change record to attempt to repair the data so that updates can be run

.

So, starting with a clean 8.6.12 DB. I try to do an update to 8.8.4
When I run the update db I get this:

Update make_menu_link_content_revisionable
Failed: Drupal\Core\Entity\EntityStorageException: Exception thrown while performing a schema update. Cannot rename tmp_8c0b2emenu_link_content_revision to menu_link_content_revision: table menu_link_content_revision already exists. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->wrapSchemaException() (line 1615 of /Users/dadder/Sites/snowseekers-2/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Same error.

I have a site with about a dozen vocabularies and hundreds of terms.
I really do not want to rebuild this from scratch.

Can someone tell me a way to make the migration work.

amateescu’s picture

@dadderley, the root cause for these errors is usually some field storage definitions that are not installed or updated correctly, either by a contrib module or a custom one, and the fix can be either individual for each site that experiences a problem with an entity type conversion, or a patch for a contrib module.

If you can send me a copy of your codebase and a sanitized database dump (e.g. all the nodes/users/etc. deleted), feel free to contact me in the Drupal slack or using drupal.org's personal contact form, and I can try to help out. This worked out well for a similar issue with the Entityqueue module, where it turned out the problem was in another contrib module, see #3128057-37: Error updating to v1.0 and #3126343-11: Scheduler needs to maintain its base fields properly.