Prevent DIC RuntimeException when kernel service unavailable during Drupal installation

Created on 1 October 2025, 10 days ago

Problem/Motivation

When installing Drupal core with ECA enabled, the installation fails with a 500 error.

The stack trace shows:

Symfony\Component\DependencyInjection\Exception\RuntimeException: 
You have requested a synthetic service ("kernel"). 
The DIC does not know how to construct this service.

This happens because ECA’s plugin base / helper messenger tries to access the kernel synthetic service during the install batch process. At that point, the service container is not yet fully initialized.

This prevents Drupal installation from completing successfully.

Steps to reproduce

  • Start a fresh Drupal installation.
  • Enable eca and eca_helper during install. ( in a custom profile/distro
  • Run installation via install.php.
  • During module install batch, installation crashes with the above error.

Proposed resolution

  • Add a try/catch safeguard around the event dispatch in Messenger::addMessage().
  • If services are not yet available (installation/bootstrap phase), gracefully fall back to the original messenger service.
  • Otherwise, continue dispatching ECA events as expected.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇯🇴Jordan Rajab Natshah Jordan

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024