Config import from a different site fails because of shortcut.set.default.yml

Created on 8 October 2015, over 8 years ago
Updated 14 June 2024, 15 days ago

When importing configuration from one site to another, the shortcut set UUID causes the import to fail.

Some steps to reproduce:
1) Export all config
2) Create a new site with drush site-install
3) Find the site UUID of the original site, and set the site UUID of the new site to be the same with drush config-set "system.site" uuid
4) drush config-import

 [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
Entities exist of type <em class="placeholder">Shortcut link</em> and <em class="placeholder">Shortcut set</em> <em class="placeholder">Default</em>. These entities need to be deleted before importing. in Drupal\Core\Config\ConfigImporter->validate() (line 748 of /var/www/web/core/lib/Drupal/Core/Config/ConfigImporter.php). 
In ConfigImportCommands.php line 357:
                                                                                                                                         
  The import failed due to the following reasons:                                                                                        
  Entities exist of type <em class="placeholder">Shortcut link</em> and <em class="placeholder">Shortcut set</em> <em class="placeholder">Default</em>. These entities need to be deleted before importing.

Workarounds:

  • Copy the contents of shortcut.set.default.yml from the target site into the config being imported
  • Run drush ev '\Drupal::entityManager()->getStorage("shortcut_set")->load("default")->delete();'
πŸ’¬ Support request
Status

Active

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡ΊπŸ‡¦Ukraine danylevskyi Myrhorod / Ukraine

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 mbnsorg

    This is an older thread, but just noting we ran into the same issues described here.

    On D10 (v10.1.6), we attempted exporting/importing very basic site configuration from one dev site to another, but the workarounds described did not work. Notably, once shortcut_set (or shortcut per #71) is deleted, that causes failures in drupal core/shortcut where a "shortcut_set" object is expected to be not-null in a variety of places.

    We abandoned the config export/import and used a db dump instead, which was fine for our short term need, but we were surprised that a simple configuration share didn't work.

  • πŸ‡¦πŸ‡ΊAustralia finaukaufusi Sydney

    I'm also facing this issue in D10.6
    I'm working on CI pipeline and I want to import the config to a new Drupal site for testing.
    My build always failed in this error.

  • πŸ‡ΊπŸ‡ΈUnited States ExTexan

    This may shed some light on the issue. It seems to me that the full configuration for shortcuts (stored in the database tables) is not being exported to the config yml files.

    The 3 attached screenshots show the three tables prefixed with "shortcut" in the site where shortcuts are working.

    And here are the three config yml files exported from that site, and imported into another site (in which no shortcuts appear).

    uuid: f2e2a04f-a646-4376-a5f0-78d157102f32
    langcode: en
    status: true
    dependencies: {  }
    _core:
      default_config_hash: U5VlGjd_SfV0Qm_EfnaynOfc549cNscFAx48JfYoMRI
    id: default
    label: Default
    
    uuid: 9fbf3b51-f736-4160-9dbe-900d711b9ff8
    langcode: en
    status: true
    dependencies: {  }
    id: staff-shortcuts
    label: 'Staff Shortcuts'
    
    uuid: aa9e33ce-90ce-419c-bf91-c8b77f5b122e
    langcode: en
    status: true
    dependencies: {  }
    id: content-admin-shortcuts
    label: 'Content Admin Shortcuts'
    

    I just don't see how the data in the tables could come from the limited data in the yml files.

Production build 0.69.0 2024