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
Issue fork drupal-3465360
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
quietone commentedChanges are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.
Comment #3
tobybellwood commentedComment #4
quietone commentedComment #5
catchI think this was caused by a merge conflict resolution failure in #3437162: Move twig_debug and other development toggles into raw key/value - it looks like I removed the post update from 10.3, then a couple of weeks later we also removed it in #3439769: Remove all the pre-10.3.0 updates hooks 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
Comment #6
catchOh 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 #3403649: Rework database update tests so we don't have to ship database dumps in git.
Comment #8
catchComment #9
catchComment #10
quietone commentedThanks 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.
Comment #11
benjifisherThe steps to reproduce are pretty clear. Just for kicks, I decided to install the
demo_umamiprofile. When I tried the update, I saw two error messages:I tried again: this time, I checked out the feature branch instead of 11.0.0-rc1. One error is gone, but one remains:
I think we should expand the scope of this issue to handle both.
Comment #12
catchThe layout builder issue is similar but also different.
In #3043330: Reduce the number of field blocks created for entities (possibly to zero) we added a config-based feature flag for field blocks - this was committed to 10.3.x during development.
In #3432874: Replace "Expose all fields as blocks to Layout Builder" configuration with a feature flag module 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 #3439769: Remove all the pre-10.3.0 updates hooks 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 #3414563: Add new 10.3.x database dump fixtures, without modules deprecated for removal in 11.x - these must include the post update having been run, (i.e. created during the short window then the update existed) 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.
Comment #13
benjifisherWith 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):
and
The MR for this issue adds one line containing
system_post_update_sdc_uninstalland removes another, so it is missed bygit -S system_post_update_sdc_uninstall.Comment #14
quietone commentedI 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.
Comment #15
quietone commentedI do not know why the priority and status changed.
Comment #16
tobybellwood commentedThanks 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!
Comment #17
benjifisherOK, I confirmed that the
systemupdate function was added in #3409456:I get the same result with 11.0.x.
It was added and removed in the same issue in the 10.4.x branch:
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_builderone now.I am also adding some related issues.
Comment #18
catchYes 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 removed 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.
Comment #19
benjifisherOn the 11.x and 11.0.x branches, it looks as though
layout_builder_post_update_default_expose_field_block_setting()was added in #3043330: Reduce the number of field blocks created for entities (possibly to zero) and removed in #3432874: Replace "Expose all fields as blocks to Layout Builder" configuration with a feature flag module–(replaced bylayout_builder_post_update_enable_expose_field_block_feature_flag()):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 notlayout_builder_post_update_default_expose_field_block_setting(), so there is no point listing the latter inlayout_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
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.
Comment #20
benjifisherComment #23
catchAh 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.
Comment #24
quietone commented@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!
Comment #25
tobybellwood commentedI can confirm all is good in 11.0.x-dev - thanks for the swift fix team!
Comment #26
benjifisherSince #3439769: Remove all the pre-10.3.0 updates hooks 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:
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 thecomposercache.The good news is that I did not get any message about missing update functions.
Comment #27
catch@benjifisher thanks for the extra testing!