Using Domain Config UI creates *.yml files with duplicate UUIDs.

Created on 6 July 2021, over 3 years ago
Updated 21 July 2023, over 1 year ago

Enabled "domain configuration" on standard 'Basic site settings' page and set unique values for each domain (e.g. Site name).

Exporting config results in config files that have duplicate UUIDs.

domain.config.MACHINE_NAME_1.system.site.yml
domain.config.MACHINE_NAME_2.system.site.yml
domain.config.MACHINE_NAME_3.system.site.yml
etc.

And then import is failing.

There were errors validating the config synchronization.
Rename operation for simple configuration.

Drupal Version 8.9.16

Domain module version 8.x-1.0-beta6

🐛 Bug report
Status

Active

Version

2.0

Component

- Domain Config UI

Created by

🇬🇧United Kingdom featherbelly London, UK

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇸🇰Slovakia kaszarobert

    We also encountered this issue.
    - set up domains on Drupal site's master branch.
    - create new feature branch where you alter the site title, export the new config and commit.
    - now go back to the master branch, and import config (here we tested something else manually that got merged to master)
    - go back to the previous feature branch and try to import config, you get:

    pc@pc:/var/www/html/ks-graphic.site (master =)$ lando drush cim
    +------------+------------------------------------------------------------+-----------+
    | Collection | Config                                                     | Operation |
    +------------+------------------------------------------------------------+-----------+
    |            | system.site::domain.config.dogbanner_localhost.system.site | Rename    |
    +------------+------------------------------------------------------------+-----------+
    
     Import the listed configuration changes? (yes/no) [yes]:
     > y
    
     [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
    Rename operation for simple configuration. Existing configuration system.site and staged configuration domain.config.dogbanner_localhost.system.site. in Drupal\Core\Config\ConfigImporter->validate() (line 794 of /app/web/core/lib/Drupal/Core/Config/ConfigImporter.php). 
    
    In ConfigImportCommands.php line 324:
                                                                                                                                                             
      The import failed due to the following reasons:                                                                                                        
      Rename operation for simple configuration. Existing configuration system.site and staged configuration domain.config.dogbanner_localhost.system.site.
    

    This meant we could not import config anymore, so we had to remove this domain-altered config manually. Therefore, I'm raising priority because it could break the config deployment to QA and production sites.

  • 🇸🇰Slovakia kaszarobert

    Again, the same error I experienced when collegues changed the site name per domain and I tried to import config on a completely different site:

    |            | domain.config.mezotrade_eu.system.site::domain.config.age_attraction_sk.system.site | Rename    |
    |            | system.site::domain.config.age_attraction_sk.system.site                            | Rename    |
    +------------+-------------------------------------------------------------------------------------+-----------+
    
     // Import the listed configuration changes?: yes.                                                                      
    
     [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
    Rename operation for simple configuration. Existing configuration domain.config.mezotrade_eu.system.site and staged configuration domain.config.age_attraction_sk.system.site.
    Rename operation for simple configuration. Existing configuration system.site and staged configuration domain.config.age_attraction_sk.system.site. in Drupal\Core\Config\ConfigImporter->validate() (line 794 of /app/web/core/lib/Drupal/Core/Config/ConfigImporter.php). 
    
    In ConfigImportCommands.php line 324:
                                                                                                                                                                                      
      The import failed due to the following reasons:                                                                                                                                 
      Rename operation for simple configuration. Existing configuration domain.config.mezotrade_eu.system.site and staged configuration domain.config.age_attraction_sk.system.site.  
      Rename operation for simple configuration. Existing configuration system.site and staged configuration domain.config.age_attraction_sk.system.site.                             
    

    system.site.yml:

    _core:
      default_config_hash: 5fiO5Le0rk-Y8-wpD231_eVHzGxPd2HtLK4cHmzZ2hw
    langcode: sk
    uuid: f4d6487a-1aec-48b6-9ddd-15a1c7595ded
    name: 'Age attraction'
    mail: mail@example.com
    slogan: ''
    page:
      403: ''
      404: ''
      front: /node/21
    admin_compact_mode: false
    weight_select_max: 100
    default_langcode: sk
    mail_notification: ''
    

    domain.config.age_attraction_sk.system.site.yml:

    _core:
      default_config_hash: 5fiO5Le0rk-Y8-wpD231_eVHzGxPd2HtLK4cHmzZ2hw
    langcode: sk
    uuid: f4d6487a-1aec-48b6-9ddd-15a1c7595ded
    name: 'Age attraction'
    mail: mail@example.com
    slogan: ''
    page:
      403: ''
      404: ''
      front: /node/21
    admin_compact_mode: false
    weight_select_max: 100
    default_langcode: sk
    mail_notification: ''
    

    domain.config.mezotrade_eu.system.site.yml

    _core:
      default_config_hash: 5fiO5Le0rk-Y8-wpD231_eVHzGxPd2HtLK4cHmzZ2hw
    langcode: sk
    uuid: f4d6487a-1aec-48b6-9ddd-15a1c7595ded
    name: 'Mezo trade'
    mail: mail@example.com
    slogan: ''
    page:
      403: ''
      404: ''
      front: /node/28
    admin_compact_mode: false
    weight_select_max: 100
    default_langcode: sk
    mail_notification: ''
    
    
  • 🇨🇦Canada arakwar

    We're using the Drupal 9.4.14 version with Domain 2.0.0-beta1, and have the same issue.

  • First commit to issue fork.
  • Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Not currently mergeable.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    88 pass, 10 fail
  • Status changed to Needs review over 1 year ago
  • 🇺🇦Ukraine HitchShock Ukraine

    In general, I would say that the better practice is to add all 'domain.config.*' to the config_ignore.settings.yml and this also will resolve the issue.

    However, I made a quick solution to resolve UUID duplicates.
    It will be nice to test it.

  • Status changed to Needs work over 1 year ago
  • 🇺🇦Ukraine HitchShock Ukraine

    Back to work cuz tests must be reviewed and fixed too.

  • 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

    Quoting configuration system maintainer @alexpott from #3405800-20: Config collections do not trigger configuration events consistently :

    Domain is not using its own StorableConfigBase object - see https://git.drupalcode.org/project/domain/-/blob/8.x-1.x/domain_config/s... - so it will trigger regular config events for it's overrides. Which is incorrect because as with config translations there are only partial representations of configuration and meant to be merged via the override system with active config in the default collection.

  • 🇺🇸United States brianbrarian

    Are there prospects for a patch anytime soon?

  • 🇧🇪Belgium tim-diels Belgium 🇧🇪

    I came here with the issue that on a site install with existing config and rename validation was thrown as described in the issue summary.
    The steps are quiet easy to reproduce.

    • Install a website
    • Enable domain
    • Add 2 domains
    • Enable domain_config_ui
    • Add language and domain context to system site page for domains
    • Set config per domain per language
    • Export config
    • Try to reinstall site from config and it should fail

    @HitchShock Thank you for the work in your MR. This looks like the way forward on fixing this issue.

    Not sure how to write tests for site install with existing config.

    But for everyone having this issue:

    1. Use the patch from the MR
    2. Delete the UUID from the config files and re-install
    3. Save the config pages again and export config
  • 🇺🇸United States agentrickard Georgia (US)

    MR is out of date and needs a refactor.

  • 🇺🇸United States agentrickard Georgia (US)

    Marking as a fearure. Domain Config UI is a *convenience* module and experimental. Developers can work around this issue as noted or by using Domain Config directly.

  • First commit to issue fork.
  • Pipeline finished with Failed
    5 months ago
    Total: 214s
    #242052
  • 🇨🇦Canada slydevil Halifax

    Patch for 2.0-beta attached.

  • 🇭🇺Hungary denes.szabo Hungary

    Re-rolled the patch against the latest dev 2.0.x.

  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

    #14 has described a workaround already (thanks Steffen!) and this is not breaking a site so decreasing issue prio...

    Descriptions of the Priority and Status values can be found in the Drupal project issues documentation.

  • Status changed to Needs review 4 months ago
  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin
  • Status changed to RTBC 21 days ago
  • 🇮🇳India neelam.chaudhary

    The patch #31 worked for me and the UUIDs in the generated site config files for domains are different.

Production build 0.71.5 2024