New config introduced by an update hooks breaks deployment

Created on 27 August 2021, about 3 years ago
Updated 10 January 2024, 8 months ago

Problem/Motivation

By following the recommended order of deployments steps :tm: and having this update hook, what you get on a downstream project is this. Where is the issue? AFAIK the update hook cannot check if the config already exists, because it does not. It creates a config with a different UUID which leads to this error when drush cim runs.

[2021-08-26T09:07:45.904Z] + ./vendor/bin/drush -y config:import
[2021-08-26T09:07:48.545Z] +------------+------------------------------+-----------+
[2021-08-26T09:07:48.545Z] | Collection | Config                       | Operation |
[2021-08-26T09:07:48.545Z] +------------+------------------------------+-----------+
[2021-08-26T09:07:48.545Z] |            | admin_toolbar_tools.settings | Create    |
[2021-08-26T09:07:48.545Z] +------------+------------------------------+-----------+
[2021-08-26T09:07:48.545Z] 
[2021-08-26T09:07:48.545Z]  // Import the listed configuration changes?: yes.
[2021-08-26T09:07:48.545Z]
[2021-08-26T09:07:49.456Z]  [notice] Synchronized configuration: create admin_toolbar_tools.settings.
[2021-08-26T09:07:50.799Z]  [notice] Finalizing configuration synchronization.
[2021-08-26T09:07:50.799Z]  [error]  Drupal\Core\Config\ConfigException: Errors occurred during import in Drush\Drupal\Commands\config\ConfigImportCommands->doImport() (line 247 of /mnt/enc-data/www/internal.bnp.devportal.io/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php).
[2021-08-26T09:07:50.799Z]
[2021-08-26T09:07:50.799Z] In ConfigImportCommands.php line 261:
[2021-08-26T09:07:50.799Z]               
[2021-08-26T09:07:50.799Z]   The import failed due to the following reasons:
[2021-08-26T09:07:50.799Z]   Deleted and replaced configuration "admin_toolbar_tools.settings" 

Fun fact, you can find similar comments, even videos related to the same error but with config entities, but checking if config synching is running won't solve this problem:

https://www.youtube.com/watch?v=qV2Z0_opyHs
+ see related issues.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡­πŸ‡ΊHungary mxr576 Hungary

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.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Is there any reason that the update hook that creates the object can't specify a fixed UUID?

Production build 0.71.5 2024