Problem/Motivation

Follow-up from #3120910: Sites with missing schema information can't update to 8.8.3+ - attempts to run all historical updates, which is a second attempt to fix the symptoms of this problem. As yet we've not identified what the cause might be.

There are two cases:

1. Module is installed, but nothing is recorded in system.schema

2. Module is uninstalled, but has something recorded in system.schema

So far no one has steps to reproduce either bug.

However, with #2 it seems likely this could be due to a force uninstall - i.e. removing the module from extension.list without actually uninstalling it.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

catch created an issue. See original summary.

catch’s picture

Title: Modules sometimes don't get schema data recorded » system.schema information gets out of sync with module list

Just seen #3136668: Invalid system.schema key_value entry causes fatal on updating to 8.8.5 - which is about orphaned, as opposed to missing, system.schema information, but let's track them together for now until we have an idea of how this is getting out of sync.

andypost’s picture

andypost’s picture

martin107’s picture

Can I ask for a bit more context as to what "gets out of sync" means

I see #3

which is about orphaned, as opposed to missing, system.schema information, but let's track them together for now until we have an idea of how this is getting out of sync.

Even vague recollections of the bug would be useful in mapping 'missing system.schema information' to "write path failures" or "read path failures".

In terms of broad-scoped behat tests this is what I mean.

The read path test:-
When the database table 'key-value' rows are set like so .. then when I visit '/admin/modules' I should see x, y, z

The write path tests:-
When I visit '/admin/modules' and click here. here and here .. then the tables should look like a, b, c

From that quote missing 'system.schema information' looks like a write path failure.

But was access through drush, or the 'admin/modules' page

This might be useful as the admin/modules controller always reads the state of the modules with a little reset() thrown in

 $modules = $this->moduleExtensionList->reset()->getList();

If the bug report said "All I know is that we are seeing random tests failures" .. that would also be valid and I would approach the problem differently.

catch’s picture

Issue summary: View changes

Updated the issue summary a bit.

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.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.

andypost’s picture

I used to reproduce kind of it with ActionConfigTest after removal of cachable call in drupal_load_updates() to drupal_get_installed_schema_version(NULL, FALSE, TRUE) with new service #2124069-288: Convert schema.inc to the update.update_hook_registry service (UpdateHookRegistry)

It allowed to catch that tests should write initial schema, so maybe when module enabled via config install it does not write schema update

alexpott’s picture

One way for things to get out of sync is for the container rebuild during

        // Update the kernel to include it.
        $this->updateKernel($module_filenames);

to throw an exception. I think this can occur quite easily due to broken code or incorrect assumptions made by a module. Is it a silly idea to consider trying to a module install (or unisntall) inside a database transaction - and therefore if anything goes wrong we can rollback?

andypost’s picture

Another case is from config-slack - it's often used $settings['config_exclude_modules'] = ['devel', 'stage_file_proxy']; but I found no "schema changes" in config transformations

alexpott’s picture

@andypost I'm not sure about #11. It's not working the way you think it is. If the site already has devel installed on it that adding that to config_exclude_modules is not going to uninstall it.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
stephencamilo’s picture

Status: Active » Closed (won't fix)
hestenet’s picture

Status: Closed (won't fix) » Active

Reset issue status.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bhanu951’s picture

Version: 9.4.x-dev » 10.1.x-dev
geek-merlin’s picture

Module install not being atomic can also lead to "Cannot update database because 'module is too old'".
See #3206215-11: "The installed version of the <Module> module is too old to update" makes no sense to site administrators.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.