Problem/Motivation
A non-interactive CLI install of an install profile on Drupal 11.3 fails with a fatal error:
"You have requested a synthetic service (kernel). The DIC does not know how to construct this service."
It happens during ConfigInstaller::installOptionalConfig() when an optional config such as a field triggers a plugin definition alter like hook_field_info_alter. Building the combined hook and event listener list then instantiates a service that depends on the synthetic kernel service. Examples seen are the JSON:API Extras ConfigSubscriber and the Security Review data service, both of which inject kernel.
This is a sibling of #3564735: Container / service exceptions while installed from existing config. That issue fixed the ConfigImporter path (config import and install from existing config) by re-injecting after the theme OOP hook container rebuild, and that fix is in 11.3.13. The plain site install path through ConfigInstaller is still affected.
Introduced in 11.3.1. It does not occur in 11.2.10. Related: #3544715: Add oop support to hooks currently supported by themes (OOP hooks in themes).
Steps to reproduce
1. Use Drupal 11.3.13.
2. Install a profile that installs a theme with OOP hooks and enables a module that injects the synthetic kernel service.
3. Run drush site install for that profile.
4. The install aborts with the synthetic kernel error during ConfigInstaller::installOptionalConfig().
Proposed resolution
Extend the #3564735: Container / service exceptions while installed from existing config re-injection so the synthetic kernel service is restored on the rebuilt container in the ConfigInstaller and site install path, not only in ConfigImporter.
Remaining tasks
Minimal core reproduction test. Patch and merge request. Review.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3606822
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
rajab natshahComment #4
rajab natshahComment #5
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #6
quietone commentedIssues for Drupal core should be targeted to the 'main' branch, our primary development branch. Changes are made on the main branch first, and are then back ported as needed according to the Core change policies. The version the problem was discovered on should be stated in the issue summary Problem/Motivation section. Thanks.
Comment #8
rajab natshahComment #9
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.