Problem/Motivation
In our deployments we have a release folder setup.
Only after a deployments is successful the new release folder will be symlinked.
Therefor it is possible that during a deployment cache will be triggered on a previous release.
This can cause the \Drupal\Core\Extension\ExtensionList::getList method to think a module does not exist based on cache from another release.
In the past most of the issues occurring from this setup could be solved by setting the "Deployment identifier" correctly.
Unfortunately this is not the case for the ConfigImportSubscriber.
( webroot/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php:116 )
Steps to reproduce
Have separate release folders ( one with an new module and one without )
Trigger cache (getList) on release without the concerning module.
Run config import on the other release folder.
Proposed resolution
In \Drupal\Core\Extension\ExtensionList::getListCacheId make use of the "deployment_identifier".
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3295293-2.patch | 954 bytes | ranjith_kumar_k_u |
| drupal-core-get-list-based-on-deploy-identifier.patch | 970 bytes | willempje2 |
Comments
Comment #2
ranjith_kumar_k_u commentedComment #3
longwaveNot sure this is a bug, I think you should clear cache before running config import - this is what
drush deploydoes, for example.Comment #4
willempje2 commentedWe ran into this even when our deploy scripts runs cache-rebuild before config import.
I understand its a small window for the cache to be set for this but even if a update hook would need this modules list for some reason the same problem would arise, right?
Comment #5
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
As a bug this will need a test case please (if valid)
Comment #6
willempje2 commentedIt seems someone beat me to the punch.
See: https://www.drupal.org/project/drupal/issues/3312001
Although i think my solution might be more elegant.
Comment #8
nicxvan commentedThis can be closed as duplicate once credit is assigned.
Comment #9
dcam commentedPer #8 I've assigned credit and am closing as a duplicate.