0

I don't understand what is missing. It's just a simple blogpost content type that I created before I reset the db and tried to re-import it. All the modules requires are enabled and I did try to clear the cache. Run updb Tried drush cim --partial. nothing has worked. This is the error:

Import the listed configuration changes? (y/n): y
Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.                                                         [error]
Configuration <em class="placeholder">field.field.node.blog_post.field_post_category</em> depends on the <em
class="placeholder">field.storage.node.field_post_category</em> configuration that will not exist after import.
Configuration <em class="placeholder">field.field.node.blog_post.field_post_featured_images</em> depends on the <em
class="placeholder">field.storage.node.field_post_featured_images</em> configuration that will not exist after import.
Configuration <em class="placeholder">field.field.node.blog_post.field_post_video</em> depends on the <em
class="placeholder">field.storage.node.field_post_video</em> configuration that will not exist after import. in Drupal\Core\Config\ConfigImporter->validate()
(line 737 of /var/www/localvolumes/html/core/lib/Drupal/Core/Config/ConfigImporter.php).
The import failed due for the following reasons:                                                                                                             [error]
Configuration <em class="placeholder">field.field.node.blog_post.field_post_category</em> depends on the <em
class="placeholder">field.storage.node.field_post_category</em> configuration that will not exist after import.
Configuration <em class="placeholder">field.field.node.blog_post.field_post_featured_images</em> depends on the <em
class="placeholder">field.storage.node.field_post_featured_images</em> configuration that will not exist after import.
Configuration <em class="placeholder">field.field.node.blog_post.field_post_video</em> depends on the <em
class="placeholder">field.storage.node.field_post_video</em> configuration that will not exist after import.
1
  • 1
    It's not vague at all. The errors shown is not about missing modules, but about missing configuration. Obviously, the field (instance) config files you try to install are missing their field storage information, which is always stored in another config file with the pattern field.storage.[entity_type].[field_name].yml. Mar 1, 2019 at 12:01

3 Answers 3

1

The simple answer for this issue is, with your idea search for the missed configuration.

for example in

Configuration core.entity_form_display.node.tool.default depends on the field.field.node.tool.field_sha256sum configuration that will not exist after import.

search for field.field.node.tool.field_sha256sum on your idea and remove them from the dependencies of other file. Before

dependencies:
  config:
    - field.field.node.tool.body
    - field.field.node.tool.field_file
    - field.field.node.tool.field_tags
    - field.field.node.tool.field_sha256sum
    - node.type.tool

After:

dependencies:
  config:
    - field.field.node.tool.body
    - field.field.node.tool.field_file
    - field.field.node.tool.field_tags

then try to drush cim again.

just bear in mind you should remove all the missed configuration dependencies.

0

Answering my own question, hoping it may help others. The error message above, in my case, indicates a missing configuration file.

My workflow usually involves switching between branches and re-setting the database to its pristine state. Then I try to import the configuration before finishing a piece of work.

It turns out I did not commit some field.storage.* configuration files before I switched branches and re-set the database. Then the import failed and complained about missing configuration. Re-reading the error messages more carefully allowed me to understand the underlying issue.

I used my IDE (phpstorm) local history feature to search for the missing files and restore them. This fixed the issue.

0

I was getting this error when attempting to create a field without the "field_" prepend on machine name. I went about the process by creating field as normal. Then I did a config export for the field and removed the field_ from all the files modified/added.

What I missed that brought me to this error was simply that I forgot to rename the field and storage files. i.e. renaming those 2 files such as field.field.commerce_order.default. field_ syncdb_id.yml to field.field.commerce_order.default.syncdb_id.yml was all that was left to successfully import.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.