Single item import fails with validation errors from other config

Created on 26 March 2016, about 9 years ago
Updated 10 August 2024, 9 months ago

Hello,

I have a Drupal 8 development site with an error that gets me stuck with migrating content. So I am trying to export all my setting to a fresh site. I exported them via /admin/config/development/configuration/full/export

1. I did a fresh install of Drupal 8.0.5.
2. I migrated content (via UI /upgrade) from my Drupal 6 site.
3. I am trying to import my configurations (views, content types...) via /admin/config/development/configuration/single/import
4. I get the following error:

The configuration cannot be imported because it failed validation for the following reasons:

    Configuration block.block.menu depends on the Amare theme that will not be installed after import.
    Configuration block.block.menu_1 depends on the garland theme that will not be installed after import.
    Configuration block.block.statistics depends on the garland theme that will not be installed after import.
    Configuration block.block.user depends on the bluemarine theme that will not be installed after import.
    Configuration block.block.user_1 depends on the bluemarine theme that will not be installed after import.
    Configuration block.block.user_2 depends on the garland theme that will not be installed after import.
    Configuration block.block.user_3 depends on the garland theme that will not be installed after import.
    Configuration block.block.user_4 depends on the garland theme that will not be installed after import.

I am not importing any of these items (blocks). There are blocks in my config files that use these themes, but I am not importing them as I am using Single Item Import. There are no dependencies on these blocks in the config files I am trying to import. I also uncommented $config_directories['sync'] from my settings.php

e.g. Configuration type: Content type

uuid: 929c4a4b-eb8f-4396-9739-57c185d3bd39
langcode: de
status: true
dependencies:
  module:
    - menu_ui
third_party_settings:
  menu_ui:
    available_menus:
      - main
    parent: 'main:'
name: 'Time-sensitive content'
type: time_sensitive_content
description: ''
help: ''
new_revision: false
preview_mode: 1
display_submitted: false
Some solutions:
Leftover config objects (for example an uninstalled theme's leftover blocks, which jam the sync system) can be deleted a few ways. More options here and here . Drupal console or drush:
drupal config:delete 'the_config_to_delete'
drush config-delete [config_name]
πŸ’¬ Support request
Status

Active

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated about 16 hours ago

Created by

Live updates comments and jobs are added and updated live.
  • DrupalWTF

    Worse Than Failure. Approximates the unpleasant remark made by Drupal developers when they first encounter a particular (mis)feature.

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.

  • πŸ‡©πŸ‡ͺGermany marc.bau

    The migration from Drupal 7 to 10 is just a really bad mess. Nothing works.

    Configuration block.block.bartik_search_form depends on the bartik theme that will not be installed after import.
    Configuration block.block.bartik_statistics_popular depends on the bartik theme that will not be installed after import.
    Configuration block.block.bartik_system_main depends on the bartik theme that will not be installed after import.
    Configuration block.block.bluemarine_user_login depends on the bluemarine theme that will not be installed after import.
    Configuration block.block.garland_system_main depends on the garland theme that will not be installed after import.
    Configuration block.block.pushbutton_user_login depends on the pushbutton theme that will not be installed after import.
    

    I'm importing a single "view" configuration that depends on nothing, but this config import is blocked because of a lingering and totally unrelated theme setting? Unbelivable. Why is there no link on the page - "how to solve this" or a "skip" button to proceed and do not care about a theme that no longer exist?

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    I just updated a site from Drupal 7 to Drupal 10 (it was started in Drupal 5). It wasn't under version control until now, and when I tried running my first drush config:import on the server, trying to do a simple configuration update, I got these errors:

    Configuration block.block.bartik_block_4 depends on the bartik theme ...
    Configuration block.block.bartik_system_main depends on the bartik theme ...
    Configuration block.block.bartik_system_powered_by depends on the bartik theme ...
    Configuration block.block.bartik_user_login depends on the bartik theme ...
    Configuration block.block.bluemarine_system_powered_by depends on the bluemarine theme ...
    Configuration block.block.bootstrap_block_3 depends on the bootstrap theme ...
    Configuration block.block.bootstrap_block_6 depends on the bootstrap theme ...
    Configuration block.block.bootstrap_system_main depends on the bootstrap theme ...
    Configuration block.block.deco_block_3 depends on the deco theme ...
    Configuration block.block.deco_system_main depends on the deco theme ...
    Configuration block.block.garland_block_4 depends on the garland theme ...
    Configuration block.block.garland_system_main depends on the garland theme ...
    Configuration block.block.garland_system_powered_by depends on the garland theme ...
    Configuration block.block.garland_user_login depends on the garland theme ...
    Configuration bootstrap.settings depends on the bootstrap extension ...
    Configuration deco.settings depends on the deco extension ...

    The solution:

    1. Local development: Delete the config files from the configuration folder, block.block.bartik_block_4.yml, block.block.bartik_system_main.yml, etc.
    2. Do an import, to delete these blocks from the Drupal 10 database configuration:
      $ drush config:import
       [notice] Synchronized configuration: delete block.block.bartik_user_login.
       [notice] Synchronized configuration: delete block.block.bootstrap_block_3.
       [notice] Synchronized configuration: delete block.block.deco_block_3.
       [notice] Synchronized configuration: delete block.block.garland_user_login.
       [notice] Synchronized configuration: delete block.block.bartik_block_4.
       [notice] Synchronized configuration: delete block.block.bartik_system_main.
       [notice] Synchronized configuration: delete block.block.bartik_system_powered_by.
       [notice] Synchronized configuration: delete block.block.bluemarine_system_powered_by.
       [notice] Synchronized configuration: delete block.block.bootstrap_system_main.
       [notice] Synchronized configuration: delete block.block.deco_system_main.
       [notice] Synchronized configuration: delete block.block.garland_block_4.
       [notice] Synchronized configuration: delete block.block.garland_system_main.
       [notice] Synchronized configuration: delete block.block.garland_system_powered_by.
       [notice] Synchronized configuration: delete deco.settings.
       [notice] Synchronized configuration: delete bootstrap.settings.
       [notice] Synchronized configuration: delete block.block.bootstrap_block_6.
       [notice] Finalizing configuration synchronization.
       [success] The configuration was imported successfully.
      
    3. Git commit these changes, and push it to the server
    4. Run the config import again on the server, it should now go through
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Updated the IS with the workarounds I found in the comments.

    I think it s time to close this. The only comments here since 2021 are about migrations. And support for migrations is better handled in the @migration channel in Drupal Slack.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    I agree this issue is mainly about Migrations, even back in 2016, so moving to that Component, and closing it since there are solutions.

    Adding a link to the Drupal Migrate issue queue, since not everyone is on Slack. Also, Slack content isn't crawled by the search engines, so harder to discover. This page -- conversely -- stays here forever, and will always be discoverable.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I agree with @larowlan in that this isn't a bug. Both the configuration system and the migration system are working as intended.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    You're, let's change it back. As a user, it does look like a bug, since you are following the steps, and get an error. But the code will not be updated, because it behaves as expected -- so in that sense, the code is not buggy.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024