I am currently running into a config import error and it seems like it has something to do with field collections:

Finalizing configuration synchronization.                                                                                                                                                                                                                                                                                                                        

The import failed due for the following reasons:

Deleted and replaced configuration entity "field_collection.field_collection.field_lives_around"

I just started yesterday with this project and created tons of fields and configurations, no custom code at all for now. Any idea what could go wrong?

The field collection contains an list (text) and an geolocation field (https://www.drupal.org/project/geolocation)

  • 1
    Did you see this warning on the project page? "Paragraphs is likely to replace field collection for Drupal 8. Field collection is on its way to being deprecated. It is recommended to use paragraphs instead of field collection for Drupal 8 projects." – 4k4 Jan 8 '18 at 10:39
  • Wow ok i have not seen this for now. Thanks for the Info ! – Sebastian Jan 9 '18 at 8:29

The error happens when entity you are trying to create already exists. Or the data changed while config import was in progress. See: ConfigImporter.php/checkOp().

If the target already exists, use the entity storage to delete it again, if is a simple config, delete it directly.

Running import twice may help, but obviously not at the same time, otherwise, you probably need to remove that field manually and try again.

This could be a bug of the module, as normally modules should have the following condition in place, e.g.

  * Implements hook_ENTITY_TYPE_insert().
 function hook_ENTITY_TYPE_insert(RoleInterface $role) {
   if (\Drupal::isConfigSyncing()) {
     // Do not change data while config import in progress.
   // ...

Related bug: The group_roles field gets created too early during configuration sync.

Few hints:

  • In case you don't need the particular import, you can use Config Ignore to ignore it.
  • Try exporting the config first, then import again.
  • Try importing config individually first, file by file by using Drupal Console, e.g.

    drupal config:import:single --file=$PWD/config/sync/config_ignore.settings.yml 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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