drush updb errors on System and Layout Builder modules when going 10.3.1 to 11.0.0.-rc1

Created on 2 August 2024, 6 months ago
Updated 18 August 2024, 5 months ago

Problem/Motivation

When updating a brand new install from 10.3.1 to 11.0.0-rc1, a subsequent drush updb will report an error

[error]  The installed version of the /System/ module is too old to update. Update to 
a version prior to 11.0.0 first (missing updates: 
system_post_update_sdc_uninstall).

I've confirmed that the module is the correct version before and after. Tested with 13@beta and 13@dev releases of drush

It can be passed over with drush -y updb, but that's obviously only a workaround.

Also noted elsewhere DO slack - https://drupal.slack.com/archives/C1BMUQ9U6/p1722283480825209 and https://drupal.slack.com/archives/C1BB308HH/p1722021426118369

Steps to reproduce

Install a clean 10.3.1 site
Update to 11.0.0-rc1
Perform a drush updb
See the error message

Proposed resolution

The updb process should proceed without the error.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

11.0 πŸ”₯

Component
Database updateΒ  β†’

Last updated 16 days ago

No maintainer
Created by

πŸ‡¦πŸ‡ΊAustralia tobybellwood

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

Merge Requests

Comments & Activities

  • Issue created by @tobybellwood
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • πŸ‡¬πŸ‡§United Kingdom catch

    I think this was caused by a merge conflict resolution failure in πŸ“Œ Move twig_debug and other development toggles into raw key/value Fixed - it looks like I removed the post update from 10.3, then a couple of weeks later we also removed it in πŸ“Œ Remove all the pre-10.3.0 updates hooks Fixed from 11.x, which means we're looking for a post update that could never possibly have run.

    sdc is still in 11.x as obsolete, so the answer is to add back the update in 11.x, and probably to 10.4 too, but let's start with 11.x

  • πŸ‡¬πŸ‡§United Kingdom catch

    Oh and also probably the reason our upgrade path testing didn't catch this is because the database dumps were also created around the same period, so they will probably have the post update applied, before it was accidentally removed. Another reason to do πŸ“Œ Rework database update tests so we don't have to ship database dumps in git Active .

  • Merge request !9032Restore the sdc uninstall post update. β†’ (Open) created by catch
  • πŸ‡¬πŸ‡§United Kingdom catch
  • Status changed to Needs review 6 months ago
  • πŸ‡¬πŸ‡§United Kingdom catch
  • Pipeline finished with Failed
    6 months ago
    Total: 97s
    #241178
  • Status changed to RTBC 6 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Thanks catch.

    I can confirm that the MR fixes this update problem. I followed the steps in the issue summary and for completeness also tested on 11.x.

  • Status changed to Needs work 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    The steps to reproduce are pretty clear. Just for kicks, I decided to install the demo_umami profile. When I tried the update, I saw two error messages:

     [error]  The installed version of the /Layout Builder/ module is too old to update. 
    Update to a version prior to 11.0.0 first (missing updates: 
    layout_builder_post_update_default_expose_field_block_setting).
     
     [error]  The installed version of the /System/ module is too old to update. Update to 
    a version prior to 11.0.0 first (missing updates: 
    system_post_update_sdc_uninstall).
    

    I tried again: this time, I checked out the feature branch instead of 11.0.0-rc1. One error is gone, but one remains:

     [error]  The installed version of the /Layout Builder/ module is too old to update.  
    Update to a version prior to 11.0.0 first (missing updates:  
    layout_builder_post_update_default_expose_field_block_setting).
    

    I think we should expand the scope of this issue to handle both.

  • Status changed to Needs review 6 months ago
  • πŸ‡¬πŸ‡§United Kingdom catch

    The layout builder issue is similar but also different.

    In πŸ› Reduce the number of field blocks created for entities (possibly to zero) Fixed we added a config-based feature flag for field blocks - this was committed to 10.3.x during development.

    In πŸ“Œ Replace "Expose all fields as blocks to Layout Builder" configuration with feature flag Active we switched from the config-based feature flag to a feature flag module, this commit removed the existing upgrade path for the config change (because it never made it into a release).

    In πŸ“Œ Remove all the pre-10.3.0 updates hooks Fixed we remove the pre-10.3.0 upgrade hooks, this was only four days after the switch from config to module, so we managed to still 'remove' a post update that never existed.

    The new 10.x database dumps were committed in the same week via πŸ“Œ Remove deprecated modules from update testing database dumps etc. Active - these must include the post update having been run, which is why the upgrade path tests didn't pick up the problem.

    The answer for layout builder is just to remove that post update from the list of removed post updates because as far as stable releases are concerned, it never existed.

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    With the updated MR, both errors are gone when I run database updates. That is half of RTBC.

    I want to confirm the history of these database updates before I am willing to call this issue RTBC. But maybe someone else has already looked into it and can do that before I finish.

    For ease of reference (and editing the output of Git to produce links):

    $ git hist -S layout_builder_post_update_default_expose_field_block_setting
    ...
    * 42c76c8f545 2024-08-02 | Remove removed post update that never made it into a release. [catch]
    ...
    * 360a9c58550 2024-04-19 | Issue πŸ“Œ Remove all the pre-10.3.0 updates hooks Fixed by quietone, catch: Remove all the pre-10.3.0 updates hooks [catch]
    ...
    * 41e2fd078ea 2024-04-15 | Issue πŸ“Œ Replace "Expose all fields as blocks to Layout Builder" configuration with feature flag Active by acbramley, catch, alexpott: Replace "Expose all fields as blocks to Layout Builder" configuration with a feature flag module [catch]
    ...
    * 1561edc2b82 2024-03-07 | Issue πŸ› Reduce the number of field blocks created for entities (possibly to zero) Fixed by acbramley, nterbogt, phenaproxima, Sam152, tim.plunkett, quietone, smustgrave, jibran, larowlan, azinck, catch, alexpott, tedbow, kim.pepper: Reduce the number of field blocks created for entities (possibly to zero) [Alex Pott]

    and

    $ git hist -S system_post_update_sdc_uninstall
    ...
    * b8037acd209 2024-04-03 | Issue πŸ“Œ Remove SDC deprecated twig functions before 11.0.0 Postponed by plopesc, smustgrave, quietone, e0ipso, catch: Remove SDC deprecated code before 11.0.0 [Alex Pott]

    The MR for this issue adds one line containing system_post_update_sdc_uninstall and removes another, so it is missed by git -S system_post_update_sdc_uninstall.

  • Status changed to Active 6 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I agree with @benjifisher that the latest MR fixes the problem with layout_builder and Umami. Hopefully, @benjifisher will RTBC so that I can commit this.

  • Status changed to Needs review 6 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I do not know why the priority and status changed.

  • πŸ‡¦πŸ‡ΊAustralia tobybellwood

    Thanks all for jumping in on this! You’ve obviously got it in hand, but I’ll also double double check when I’m back at my desk.

    Love your work!

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    OK, I confirmed that the system update function was added in #3409456:

    $ git hist -S 'system_post_update_sdc_uninstall()'
    ...
    * a43e166e53d 2024-08-02 | Remove the sdc uninstall post update. [catch]
    ...
    * 360a9c58550 2024-04-19 | Issue #3439769 by quietone, catch: Remove all the pre-10.3.0 updates hooks [catch]
    ...
    * b8037acd209 2024-04-03 | Issue #3409456 by plopesc, smustgrave, quietone, e0ipso, catch: Remove SDC deprecated code before 11.0.0 [Alex Pott]
    

    I get the same result with 11.0.x.

    It was added and removed in the same issue in the 10.4.x branch:

    $ git hist -S 'system_post_update_sdc_uninstall()' 10.4.x
    ...
    * 9283d590cf5 2024-04-08 | Issue #3437162 by plopesc, smustgrave, Berdir: Move twig_debug and other development toggles into raw key/value [catch]
    * d31ade0f626 2024-04-08 | Issue #3437162 by plopesc, smustgrave, Berdir: Move twig_debug and other development toggles into raw key/value [catch]
    

    and I get the same results with 10.3.x.

    This update function is not in the 10.2.x branch nor in the 10.3.0, 10.3.1 tags, so I agree that it has never been in a released version.

    I guess it was just an accident that it was removed in #3439769. Is that the failed conflict resolution mentioned in #5?

    I am satisfied with that. I am going to look at the layout_builder one now.

    I am also adding some related issues.

  • πŸ‡¬πŸ‡§United Kingdom catch

    I guess it was just an accident that it was removed in #3439769. Is that the failed conflict resolution mentioned in #5?

    Yes looking at the commit history, I originally had correctly added the update after resolving conflicts, but then thought better of it and removed it - but because it was at 10.4.x issue it should have stayed in there (or alternatively been 11.0-only, but then not remove from 11.0). Since we need the update to run on sites that have sdc installed, and 10.3 is already out, bringing it back is easiest.

  • Status changed to RTBC 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    On the 11.x and 11.0.x branches, it looks as though layout_builder_post_update_default_expose_field_block_setting() was added in πŸ› Reduce the number of field blocks created for entities (possibly to zero) Fixed and removed in πŸ“Œ Replace "Expose all fields as blocks to Layout Builder" configuration with feature flag Active –(replaced by layout_builder_post_update_enable_expose_field_block_feature_flag()):

        $ git hist -S 'layout_builder_post_update_default_expose_field_block_setting()' 
        ...
        * 41e2fd078ea 2024-04-15 | Issue #3432874 by acbramley, catch, alexpott: Replace "Expose all fields as blocks to Layout Builder" configuration with a feature flag module [catch]
        ...
        * 1561edc2b82 2024-03-07 | Issue #3043330 by acbramley, nterbogt, phenaproxima, Sam152, tim.plunkett, quietone, smustgrave, jibran, larowlan, azinck, catch, alexpott, tedbow, kim.pepper: Reduce the number of field blocks created for entities (possibly to zero) [Alex Pott]

    I get the same thing, but with different commit hashes, on the 10.3.x and 10.4.x branches.

    That update function was never in the 10.2.x branch.

    I also checked the 10.3.0 and 10.3.1 tags. Both have layout_builder_post_update_enable_expose_field_block_feature_flag() and not layout_builder_post_update_default_expose_field_block_setting(), so there is no point listing the latter in layout_builder_removed_post_updates().

    I am just a little confused about the title of #3439769: "Remove all the pre-10.3.0 updates hooks". We are also removing the update hooks that are only in 10.3.0 and 10.3.1. I checked the release notes for 11.0.0-rc1 β†’ , and I see

    Sites should update to the latest release of 10.3 prior to updating to Drupal 11

    So sites are supposed to upgrade to 10.3, run these update functions, and then upgrade to 11. That is what I tested. So it is right to remove these functions, and it is only the issue title that is confusing me.

    I notice that the component is the database update system, but the fix is in the `system` and `layout_builder` modules. I guess we can live with that.

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area
    • quietone β†’ committed a6e453ec on 11.0.x
      Issue #3465360 by catch, benjifisher, tobybellwood: drush updb errors on...
    • quietone β†’ committed 6b50d024 on 11.x
      Issue #3465360 by catch, benjifisher, tobybellwood: drush updb errors on...
  • πŸ‡¬πŸ‡§United Kingdom catch

    I am just a little confused about the title of #3439769: "Remove all the pre-10.3.0 updates hooks". We are also removing the update hooks that are only in 10.3.0 and 10.3.1. I checked the release notes for 11.0.0-rc1, and I see

    Ah yeah it's 'all the update hooks added up until the point that 10.3.0 was tagged but not any after 10.3.0 was tagged'. The mis-matches here were because we wanted to get 11.0.0 beta released before 10.3.0 was released, we actually had to remove the 11.x update hooks, and update the database dump fixtures, before 10.3.0 was tagged. It's a bit too much time travel.

  • Status changed to Fixed 6 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @tobybellwood, thank you for reporting this!

    @benjifisher, thanks for the thorough checking. And yes, the issues regarding the update path should be in the 'database update system' component.

    Committed 6b50d02 and pushed to 11.x.

    Committed a6e453e and pushed to 11.0.x.

    Thanks!

  • πŸ‡¦πŸ‡ΊAustralia tobybellwood

    I can confirm all is good in 11.0.x-dev - thanks for the swift fix team!

  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    Since πŸ“Œ Remove all the pre-10.3.0 updates hooks Fixed had two problems that we know about (both fixed in this issue), I decided to confirm that there are not any more.

    I found all the modules affected by #3439769: git show --name-only 360a9c58550, then extract the module names.

    Then I repeated the testing steps, installing those modules:

    git checkout 10.3.1
    composer require drush/drush
    drush si
    drush en big_pipe block_content ckeditor5 comment contact datetime_range dblog editor file filter forum help history layout_builder locale media migrate mysql node path_alias pgsql responsive_image statistics system taxonomy text tracker update user views
    git restore composer*
    git checkout 11.0.0
    composer require drush/drush drupal/forum drupal/statistics
    git clone -C modules git@git.drupal.org:project/tracker.git
    drush updatedb
    

    I had to install three modules that had been removed from core. I am not sure why I had trouble with tracker: maybe I should have cleared the composer cache.

    The good news is that I did not get any message about missing update functions.

  • πŸ‡¬πŸ‡§United Kingdom catch

    @benjifisher thanks for the extra testing!

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

Production build 0.71.5 2024