"The installed version of the <Module> module is too old to update" makes no sense to site administrators

Created on 29 March 2021, over 3 years ago
Updated 22 April 2024, 5 months ago

Problem/Motivation

I've recently upgraded from 8.9 to 9.1.5. I went to enable Layout Builder and all is seemingly well. But when running update.php I get the following errors:

```
MISSING UPDATES FOR: CONTEXTUAL LINKS
The installed version of the Contextual Links module is too old to update. Update to a version prior to 9.0.0 first (missing updates: contextual_post_update_fixed_endpoint_and_markup).
```

```
MISSING UPDATES FOR: LAYOUT DISCOVERY
The installed version of the Layout Discovery module is too old to update. Update to a version prior to 9.0.0 first (missing updates: layout_discovery_post_update_recalculate_entity_form_display_dependencies, layout_discovery_post_update_recalculate_entity_view_display_dependencies).
```

Everything is up to date.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Database updateΒ  β†’

Last updated 9 days ago

No maintainer
Created by

πŸ‡©πŸ‡°Denmark Nicolaj

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States cilefen
  • πŸ‡©πŸ‡ͺGermany geek-merlin Freiburg, Germany

    I encountered exactly this message.

     [error]  The installed version of the /Layout Discovery/ module is too old to update. 
    Update to a version prior to 9.0.0 first (missing updates: 
    layout_discovery_post_update_recalculate_entity_form_display_dependencies, 
    layout_discovery_post_update_recalculate_entity_view_display_dependencies).
    
    

    It makes no sense a i never had a D8 installed.

    Consulted the source. There is a list of performed updates maintained by UpdateRegistry service.
    So in my case, This can happen when module install crashes and \Drupal\Core\Update\UpdateRegistry::onConfigSave did not do its job.
    According to #3130037-10: system.schema information gets out of sync with module list β†’ module install is not atomic / not in a transaction.

    So did that manually and the error is gone:

    vendor/bin/drush eval "\Drupal::service('update.post_update_registry')->register
    InvokedUpdates(['layout_discovery_post_update_recalculate_entity_form_display_dependencies', 'layout_discovery_post_update_recalculate_entity_view_display_dependencies']);"
  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    FWIW. We ran into this issue with the Module Filter β†’ module upgrading from 4.0.1 to 5.0.0. In that case, the module implements hook_update_last_removed(), after removing some update hooks.

    Uninstalling and reinstalling the module appears to fix the issue.

Production build 0.71.5 2024