Incomplete container when a request hits front controller before installer completes

Created on 19 December 2024, 3 days ago

Problem/Motivation

This issue first appeared in Drupal CMS πŸ› Running the installer leads into a wsod Active but I believe it also affects the core installer.

I think I have a lead. Since πŸ“Œ OOP hooks using event dispatcher Needs review hook implementations are stored in a container parameter. That parameter is dumped along with the container when the very first request is handled by the standard front controller (index.php) and DrupalKernel.

Normally the very first request taking this code path is the redirect after the installation. An installation will complete successfully if that is the case.

Any stray request handled by the default front controller and DrupalKernel during installation will trigger a container build / dump. I guess that this might have lead to problems before. But now that HookCollectorPass sets the hook_implementations_map parameter which is subsequently used by ModuleHandler when hooks are invoked, the effect of an outdated container loaded from cache is much worse.

In order to isolate its environment, the installer uses a special InstallerKernel with container dumping disabled. The final drupal_cms_installer_uninstall_myself step is executed in the installer environment as well. It actually does trigger a container rebuild, but the resulting container is not dumped. After the subsequent redirect, a stale container is loaded from cache and ModuleHandler uses an outdated hook implementations map where drupal_cms_installer hook implementations are still present.

Steps to reproduce

Run the web installer and randomly curl some URLs on the site before the installation process completes.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

install system

Created by

πŸ‡¨πŸ‡­Switzerland znerol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024