Drupal 9.4 breaks configuration import; need to manually add mysql module

Created on 24 June 2022, over 2 years ago
Updated 7 March 2023, over 1 year ago

Problem/Motivation

https://www.drupal.org/project/drupal/issues/3129043 β†’ moved core database drivers to their own modules. It installs the appropriate module in the drush updatedb step. However, if the drupal installation is using configuration management, the core.extension.yml will not receive this update and attempt to uninstall the newly installed database driver module.

E.g., The specific error for the mysql is:
Unable to uninstall the <em class="placeholder">MySQL</em> module because: The module 'MySQL' is providing the database driver 'mysql'

Apologies if this is a duplicate or I missed documentation in the release notes.

Steps to reproduce

1. Update to drupal core with drush on a configuration-managed site.
2. Run drush updatedb
3. Run drush config-import
4. The config-import step will error because the new mysql module (or relevant database driver) is not in the core.extension.yml and needs to be manually added.

Proposed resolution

Document this issue and resolution in the release notes.

The resolution has to be performed manually by adding the mysql: 0 (or appropriate db driver) to all applicable core.extension.yml files.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Closed: duplicate

Version

9.4

Component
DatabaseΒ  β†’

Last updated 3 days ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Created by

πŸ‡ΊπŸ‡ΈUnited States joegl

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 jrwest_webguy

    What is a configuration-managed site? Are we no longer supposed to be using Composer? (Found this thread after a Composer-based update caused my site to start throwing a 'missing module - mysql' error.)

    Thank you for the tip on updating the config/sync/core.extension.yml file.

  • πŸ‡ͺπŸ‡¨Ecuador andres.torres

    #11 worked for me when upgrading a d8 to d9 on Pantheon, thanks @Drumanuel

  • πŸ‡ΊπŸ‡ΈUnited States Greg Boggs Portland Oregon

    Configuration managed means you're exporting your configuration to yaml files using configuration sync or drush. This is completely unrelated to Composer.

    To repeat what the top of the thread says, do not edit your configuration files manually. If you've gotten this error, you've made a mistake upgrading your Drupal site. You need to run install updates, run database updates, and then run configuration export.

    If you got this error, you are running a configuration managed site and skipped exporting your configuration during the update. If you are exporting configuration to yaml files, you need to export your configuration every single time you install Drupal core or module updates.

  • πŸ‡ͺπŸ‡¨Ecuador andres.torres

    @Greg Boggs, I totally understand your point, but having migrations from Drupal 8 to 9+ 10 or so on, doesn't mean you must have a step by step upgrade, and its - btw NOT NECESSARILY ( depends even on the platform and the solution ) The fix provided on #11 does provide a path to a full upgrade in/or some/many cases (which btw was recommend by Pantheon ). A config upgrade is key but when moving from older to newer version doesn't mean you have to go through the whole process if all goes Ok - under a full QA IMHO. The ability to manually edit a config file is what i consider a big plus! Oh, and once the site is consistent you can always export "drush cex" any new updates without compromising the existing configuration system.

    Just a quick question on #16 you mention "6. Run drush deploy" - what version of drush are you using?

    Thanks!

  • πŸ‡ͺπŸ‡ΈSpain lapurddrupal

    After composer update --with-all-dependencies ( Drupal 9.5.3->9.5.4) I got the Database Error (.... connection not found) when running the Database update. I cured it commenting out the Line namespace =...... in the file settings.php
    With Drupal 9.5.3 it worked with: namespace' => 'Drupal\\Core\\Database\\Driver\\mysql'.

Production build 0.71.5 2024