Problem/Motivation

After upgrading to Drupal core 11.3.1 an error started to occur when installing a site from existing configuration:
You have requested a synthetic service ("kernel"). The DIC does not know how to construct this service.

The error doesn't occur when there is no default content, nor does it occur if the some hooks are commented out. Commenting out entityStorageLoad, entityTypeAlter, entityBaseFieldInfo, and entityBaseFieldInfoAlter seemed to allow the site to install.

Steps to reproduce

  1. Use composer create project to create a site
  2. install using minimal profile
  3. Configure a node type with at least one field
  4. Add default_content module and enable. No need to configure anything
  5. Add field_encrypt module and enable. No need to configure anything
  6. Create a custom module & enable it
  7. Create a node and export it into the custom module content directory drush dce node 1
  8. Export configuration
  9. Clear the database
  10. install the site from the configuration drush si --existing-config -n
  11. Observe the error

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#6 field_encrypt-3564188.patch1.15 KBpookmish

Comments

pookmish created an issue. See original summary.

pookmish’s picture

Looks like it's actually coming from the StateManager service when it's loading the Kernel service in the constructor.

ptmkenny’s picture

Title: Error with site install on Drupal 11.3 w/ Default Content module » Drupal 11.3: Site install fails w/ Default Content module
Priority: Major » Normal

Thank you for this report.

I have never used the Default Content module; which version is causing this error?

Also, what happens if you install Drupal normally and then import from configuration? Does Field Encrypt still conflict with Default Content?

pookmish’s picture

The version I can confirm the issue occurs is 2.0.0-alpha3 or 2.0.x-dev.

If the site is installed in any form, enabling a module with the default content or importing configuration does not encounter the error. It seems to only occur during site install.

ptmkenny’s picture

Ok, thanks for the additional information. The OOP hooks implementation that this module uses is still very new (we had to rewrite the module for 11.1 and then rewrite the implementation again for additional changes in 11.3).

I'm on a break now so I'm not sure when I'll have time to look at this in detail, but for content-as-code, the Feeds module can also be used and does not have this issue.

pookmish’s picture

StatusFileSize
new1.15 KB

I know this isn't the correct solution, but it at least unblocks me with the upgrade to Drupal 11.3. Functionally, it should be the same, but it seems to prevent the error from occurring.