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".

Comments

Willempje2 created an issue. See original summary.

ranjith_kumar_k_u’s picture

StatusFileSize
new954 bytes
longwave’s picture

Issue tags: +Bug Smash Initiative

Not sure this is a bug, I think you should clear cache before running config import - this is what drush deploy does, for example.

willempje2’s picture

We 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?

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

This 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)

willempje2’s picture

It 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.

Version: 9.3.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nicxvan’s picture

This can be closed as duplicate once credit is assigned.

dcam’s picture

Status: Needs work » Closed (duplicate)

Per #8 I've assigned credit and am closing as a duplicate.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.