Errors when upgrading from Module Filter 4.0 to 5.0

Created on 23 April 2024, 7 months ago
Updated 1 July 2024, 5 months ago

Problem/Motivation

When I updated from 4.0.1 to 5.0.0 and run drush updb I get a weird error message that won't go away unless I first downgrade to 4.1.1. This makes deploying updates to a PROD server a two step process. Why was this done? And why do I need to do an incremental upgrade to a minor release before doing the major upgrade? If this is only because some hook_update_N scripts were removed, could you consider adding them back?

 [error]  The installed version of the /Module Filter/ module is too old to update.
Update to an intermediate version first (last removed version: 9403,
installed version: 8000).

Steps to reproduce

$ ddev composer outdated "drupal/*"
Color legend:
- patch or minor release available - update recommended
- major release available - update possible

Direct dependencies required in composer.json:
drupal/module_filter       4.0.1  5.0.0  Filter the modules list.

Transitive dependencies not required in composer.json:
Everything up to date

$ ddev composer require drush/module_filter:^5
./composer.json has been updated
Running composer update drupal/link_attributes
Gathering patches for root package.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading drupal/link_attributes (1.14.0 => 2.1.0)

$ ddev drush updb -y

 [error]  The installed version of the /Module Filter/ module is too old to update.
Update to an intermediate version first (last removed version: 9403,
installed version: 8000).

 // Requirements check reports errors. Do you wish to continue?: yes.

 [success] No pending updates.

Proposed resolution

Be able to upgrade major versions from 4.x to 5.x without multiple code releases and redundant deployments.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

5.0

Component

Code

Created by

πŸ‡ͺπŸ‡¨Ecuador jwilson3

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

Comments & Activities

  • Issue created by @jwilson3
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    We created 4.1x as we were doing major updates with the js files and merging in a number of backlogged items after I joined as co maintainer.

    5.0x though is the same just dropping D9 support

  • Status changed to Postponed: needs info 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Wonder if still an issue. I'm hesitant of adding back the updates as don't know the impact it will have for those on 5.0.x

  • πŸ‡ΊπŸ‡ΈUnited States bygeoffthompson

    Encountered this issue today while upgrading from 4.0.1 to recommended/support 5.0.

    Here's what I see after upgrading directly to 5.0:

    interpathway@system76-pc:~/projects/vt(VT-44)$ ddev drush cr && ddev drush updb
     [success] Cache rebuild complete.
     [error]  The installed version of the /Module Filter/ module is too old to update. 
    Update to an intermediate version first (last removed version: 9403, 
    installed version: 8000).
     
    
     Requirements check reports errors. Do you wish to continue? (yes/no) [yes]:
     > yes
    
     [success] No pending updates.
    

    After encountering this issue I adjusted my version constraint to get 4.1 which allowed the database updates to apply:

    interpathway@system76-pc:~/projects/vt(VT-44)$ ddev composer update drupal/module_filter -W
    Gathering patches for root package.
    Loading composer repositories with package information
    Updating dependencies                                 
    Lock file operations: 0 installs, 1 update, 0 removals
      - Downgrading drupal/module_filter (5.0.0 => 4.1.1)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 0 installs, 1 update, 0 removals
      - Downloading drupal/module_filter (4.1.1)
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Downgrading drupal/module_filter (5.0.0 => 4.1.1): Extracting archive
    Generating optimized autoload files
    68 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    > DrupalProject\composer\ScriptHandler::createRequiredFiles
    No security vulnerability advisories found.
    interpathway@system76-pc:~/projects/vt(VT-44)$ ddev drush cr && ddev drush updb
     [success] Cache rebuild complete.
     --------------- ----------- --------------- -------------------------------------------------------------------- 
      Module          Update ID   Type            Description                                                         
     --------------- ----------- --------------- -------------------------------------------------------------------- 
      module_filter   9401        hook_update_n   9401 - Add the filters_enabled.permission default configuration.    
      module_filter   9402        hook_update_n   9402 - Ensure that the 'path' configuration property is a boolean.  
      module_filter   9403        hook_update_n   9403 - Enable jQuery UI Autocomplete module.                        
     --------------- ----------- --------------- -------------------------------------------------------------------- 
    
    
     Do you wish to run the specified pending updates? (yes/no) [yes]:
     > yes
    
    >  [notice] Update started: module_filter_update_9401
    >  [notice] Update completed: module_filter_update_9401
    >  [notice] Update started: module_filter_update_9402
    >  [notice] Update completed: module_filter_update_9402
    >  [notice] Update started: module_filter_update_9403
    >  [notice] Update completed: module_filter_update_9403
     [success] Finished performing updates.
    

    I agree that upgrading to major version 5 from before 4.1 requires two steps which isn't ideal. LMK if anyone needs any other information.

    Thanks

  • Status changed to Active 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States bygeoffthompson
  • I've also hit this issue.

    we are on Drupal 10.1.8
    upgraded from 4.0.0 to 5.0.0

    /update.php
    Unsupported schema version: Module Filter
    The installed version of the Module Filter module is too old to update. Update to an intermediate version first (last removed version: 9403, installed version: 8000).

    before updating module
    "require": {
    "pantheon-upstreams/upstream-configuration": "dev-master",
    "pantheon-systems/drupal-integrations": "^9",
    "drupal/module_filter": "^4.0",

    I'm not sure I fully understand what @bygeoffthompson means by "I adjusted my version constraint to get 4.1"

    Do I need to downgrade from 5.0.0 to 4.1 and edit the composer.json file?

  • I figured out what you meant. I downgraded to 4.1.0, I'm going to have to deploy that to master ->dev, test, prod first upgrade the db. Then upgrade to 5.0.0

    Agreed this is a hassle.

  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Added back module_filter_update_9403

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

Production build 0.71.5 2024