There is a known issue in Drupal core currently (https://www.drupal.org/project/drupal/issues/2915036) where updates to modules, profiles (e.g. Lightning) and/or Drupal itself sometimes cause configuration to not update properly. Sometimes, this is relatively minor (in the case of entity display modes not having a particular field listed as a hidden field -- in this scenario if you are using BLT, it will complain about configuration overrides) and sometimes it's much more significant (where entire fields are missing in entity bundles and config imports fail entirely).
Configuration Override Issues
Most projects that use BLT will, sooner or later, run into the dreaded error that:
Configuration in the database does not match configuration on disk.
This is almost always caused by the above D.O issue and can typically be solved by running the following commands:
-
blt setup (clean install, will likely succeed)
-
drush cex (config export)
For whatever reason, certain configuration doesn't get updated properly during database updates and entity display config is particularly susceptible to this problem (particularly the hidden key in the config). The clean install and config export should catch the config changes (again, usually a hidden key change) and then your next config import shouldn't show override issues.
Configuration Import Failures
There are also times when this issue rears its head in a more significant way (that will block updates / deployments).
In this instance, you should expect to see errors like:
In ConfigImportCommands.php line 261: [Exception] The import failed due to the following reasons: Unexpected error during import with operation delete for shortcut.set.default: Attempt to create a field body that does not exist on entity type block_content. Unexpected error during import with operation delete for node.type.page: Attempt to create a field body that does not exist on entity type block_content. Unexpected error during import with operation delete for node.type.landing_page: Attempt to create a field body that does not exist on entity type block_content. Unexpected error during import with operation delete for media.type.tweet: Attempt to create a field body that does not exist on entity type block_content.
While this may not be "precisely" the same root issue as the described override issue above, the solution is generally the same:
-
blt setup (clean install, will likely fail)
-
drush cex (config export)
-
blt setup (if this fails, repeat)
Warning: In this case, the config export will likely contain a significant amount of configuration changes that you do not want to commit. You are looking specifically for config changes related to the entities and fields that are called out in the errors. Any modified (and especially deleted) configuration should not be committed. You are looking for newly created configuration only!