Import attempt via Configuration Synchronization UI fails with a fatal error

Created on 19 February 2025, 11 days ago

Problem/Motivation

When trying to export a single ECA configuration via configuration synchronization UI, a fatal error occurs and the import does not succeed.

Steps to reproduce

  • Standard Drupal installation profile, install bpmn_io, eca_base, eca_user
  • Create a simple ECA configuration with at least one action and save it.
  • Manually export that ECA config item at /admin/config/development/configuration/single/export by just copying its contents
  • Change a label of one of the actions contained in the ECA configuration so that the UI will detect a change and will try to import it
  • Try to import it via /admin/config/development/configuration/single/import

The import attempt will fail with the following error message:

The website encountered an unexpected error. Try again later.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "private__...". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\Core\Entity\EntityBase->__wakeup()

Proposed resolution

Reason that this error occurs is the action plugin manager being attached to the ECA object or entity. That service is a decorated instance provided by the decorator, i.e. that's not a service directly provided by the service container. Thus case needs special handling during de-serialization.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇩🇪Germany mxh Offenburg

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

Merge Requests

Comments & Activities

  • Issue created by @mxh
  • 🇩🇪Germany mxh Offenburg
  • 🇩🇪Germany mxh Offenburg
  • Pipeline finished with Failed
    11 days ago
    Total: 409s
    #428940
  • Pipeline finished with Failed
    11 days ago
    Total: 469s
    #428941
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Hey @mxh good to see you around here and thanks for the bug report and its fix. Looks like some tests are failing, though.

    As for the 2.1.x branch, this seems to be the case for which you were already testing NULL !== parent::class, so it sounds like Phpstan is just being to picky here and I'd be OK to just ignore that line by adding // @phpstan-ignore-next-line. If we can resolve this that way, I would actually include that into a new release for 2.1 and 2.0 as I was just in the middle of preparing that release.

    As for the 1.1 branch it looks like we have a more serious problem which may result from some core changes that we haven't tested against for ages. This may take a little longer to resolve.

  • Pipeline finished with Failed
    11 days ago
    Total: 414s
    #428973
  • Pipeline finished with Failed
    11 days ago
    Total: 478s
    #428970
  • 🇩🇪Germany jurgenhaas Gottmadingen

    @mxh is this still NW? If so, I'm going ahead and tag new releases without this for now, it doesn't seem to be a widespread issue so including that next time is probably sufficient?

  • 🇩🇪Germany mxh Offenburg

    I don't see anything else I can do to make PHPStan happy. Writing a test that tries to serialize and de-serialize an ECA config entity might help but I don't have time to do it. Using the currently provided fix as a patch and will see how it goes. Seems to be sufficient being addressed later on.

  • Pipeline finished with Success
    8 days ago
    Total: 230s
    #431587
  • Pipeline finished with Failed
    6 days ago
    Total: 493s
    #432889
  • Pipeline finished with Success
    6 days ago
    Total: 411s
    #432891
  • Pipeline finished with Success
    6 days ago
    Total: 463s
    #432892
  • 🇩🇪Germany jurgenhaas Gottmadingen

    I've fixed the tests. For 2.1.x and 2.0.x I've instructed Phpstan to ignore that single line in the Trait as we know that it's certainly wrong in this scenario. For 1.1.x I've adjusted the CI settings so that we only test against Drupal 10, not 11.

  • Pipeline finished with Skipped
    6 days ago
    #432895
    • jurgenhaas committed 798a9f87 on 2.0.x
      Issue #3507815 by mxh, jurgenhaas: Import attempt via Configuration...
  • 🇩🇪Germany jurgenhaas Gottmadingen

    Merged into 2.1.x and 1.1.x, and also back ported to 2.0.x

Production build 0.71.5 2024