I'm seeing some unexpected behavior with purge config. I enabled acquia_purge module via Drush, configured purge stuff lightly, exported all config, and committed my config files git. The relevant config files are at https://gist.github.com/weitzman/4ef66f12aa95f29d301db92533295625. When I do a config-import on a fresh instance, and then an immediate config export, I see differences versus whats in git. Thats the first file in the gist.

Interestingly, I see that purge writes some of the missing config when I run drush p-purgers. The handy log messages below come from config_log module:

ubuntu@box921:~/mass$ vendor/bin/drush p-purgers
 [notice] Configuration changed: purge.logger_channels.channels.2.id changed from NULL to purger_acquia_purge_42ad381896
 [notice] Configuration changed: purge.logger_channels.channels.2.grants.0 changed from NULL to 0
 [notice] Configuration changed: purge.logger_channels.channels.2.grants.1 changed from NULL to 2
 [notice] Configuration changed: purge.logger_channels.channels.2.grants.2 changed from NULL to 3

The first log message suggests that invalid config was written initially, no? Maybe purger_acquia_purge_42ad381896 did not exist when the channel was created? Perhaps a config dependecy problem (see config entity dependencies, or simple config can have dependencies too). Related to #2795141: Config in Purge module could be better organized.

And then if I run drush p-diagnostics, the rest of the missing config gets written:

[error]  diagnostics: ERROR: AP8 Alpha Program: Acquia Purge isn't ready for prime time yet. If you like bleeding-edge, you can consider joining our testing program by contacting Acquia Support! 
 [error]  diagnostics: ERROR: Load Balancers: No balancers were discovered, therefore cache invalidation has been disabled. Please contact Acquia Support! 
 [notice] Configuration changed: purge.logger_channels.channels.3.id changed from NULL to diagnostics
 [notice] Configuration changed: purge.logger_channels.channels.3.grants.0 changed from NULL to 3

If I config-export at this point, my site configuration finally matches what is in Git. So, I have 2 inter-related questions:

  1. Why does the initial import not save all the right config? That NULL id is suspicious.
  2. Why does running p-purgers and p-diagnostics fix the config? These should be "read-only" commands. If they run into a misconfiguration, they should error out IMO. They should not fix configuration during runtime.

Comments

moshe weitzman created an issue.

ressa’s picture

I also see a difference, after running drush config-import. Everything is synchronized, and the web site works fine, but there's always this lingering config from purge.logger_channels. As if something in the configuration is updated during the import:

$ drush config:status
 ----------------------------------------------------- ------------------ 
  Name                                                  State             
 ----------------------------------------------------- ------------------ 
  purge.logger_channels                                 Different         

This is the difference

$ drush config:import --diff
diff --git a/tmp/drush_tmp_1576153002_5df22faaed255/purge.logger_channels.yml b/tmp/drush_tmp_1576153003_5df22fab2be03/purge.logger_channels.yml
index 56fc386..6a2255f 100644
--- a/tmp/drush_tmp_1576153002_5df22faaed255/purge.logger_channels.yml
+++ b/tmp/drush_tmp_1576153003_5df22fab2be03/purge.logger_channels.yml
@@ -17,3 +17,7 @@ channels:
       - 0
       - 2
       - 3
+  -
+    id: diagnostics
+    grants:
+      - 3
ysamoylenko’s picture

Hello everyone,
I've also faced an issue described above.
To resolve it I performed the next steps:

  1. Disabled all 'purge' modules
  2. Renamed the configuration file 'purge.logger_channels.yml' to exclude it from import
  3. Imported the configuration once again without the configuration mentioned above
  4. Cleaned the site cache
  5. Exported the configuration from the site.

The reason is configuration arrays inside yml file have another order and drush cim marks that configurations are different. But all other things are identical.

Hope it will help someone.

luisramg’s picture

Hello all,

I'm experiencing a similar configuration issue with Purge too. Thank you for the recent comment, @ysamoylenko. I'm curious if you ended up re-enabling the 'purge' modules once you got the configuration export complete (step 5, comment #3) in your list?

yivanov’s picture

I am also facing this issue and even with re-export the configuration still throws error:

The import failed due to the following reasons: Deleted and replaced configuration \"purge.logger_channels\"

Not sure what else could be done to fix this.. Any idea?