Problem/Motivation
In a fresh Ddev instance using the eca_starterkit recipe, enabling the bpmn_io.module (3.0.5) leads to this error:
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "eca.token_browser", path: "eca.token_browser". in Drupal\Component\DependencyInjection\Container->get() (line 147 of /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php)
Steps to reproduce
- composer require 'drupal/eca_starterkit'
- drush recipe ../recipes/eca_starterkit
- composer require 'drupal/bpmn_io:^3.0'
- drush en bpmn_io
Issue fork eca-3579837
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:
Issue fork bpmn_io-3579837
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:
- 3579837-circular-reference-detected
compare
Comments
Comment #2
jurgenhaasI can't reproduce this. May be a cache issue? Even for new installs, caches are sometimes surviving a re-install.
Comment #3
bisonbleu commentedIt may be because versions of many modules are moving/changing very fast.
I'll rebuild my ddev eca-sandbox from scratch and report back…
Comment #4
bisonbleu commentedConfirming that the reported issue still occurs in a new fresh ddev instance.
Could this be similar to #3567623: Circular Dependency in Token Service during hook discovery ?
And AFAICT this is NOT a bpmn.io issue but rather an eca issue?
DDEV SETUP
% mkdir eca-sandbox && cd eca-sandbox
% ddev config --project-type=drupal11 --docroot=web
% ddev composer create "drupal/recommended-project:^11.0" --no-install
% ddev composer require drush/drush
% ddev composer install
% mkdir -p config/sync
% cp web/sites/example.settings.local.php web/sites/default/settings.local.php
% cp ../d11-sandbox/.gitignore .gitignore
- configure settings.php
% ddev start
% ddev drush site:install --locale=en --account-name=admin --account-pass=admin -y
% git init
% ddev composer config minimum-stability dev
% ddev composer require cweagans/composer-patches
% ddev composer require drupal/admin_toolbar drupal/asset_injector drupal/pathauto drupal/redirect drupal/token drupal/ctools
% ddev composer require 'drupal/eca_starterkit'
% ddev drush recipe ../recipes/eca_starterki
% ddev drush cr
Then, in the admin UI, uninstall for example eca_content and re-enable it.
That's when & where I get the reported error.
Comment #6
jurgenhaasOK, the missing piece to reproducing this was the uninstall/re-enable steps for eca_content. I can now reproduce this and hopefully fix it together with the patch that @bisonbleu provided in Slack.
Comment #7
jurgenhaasFurther clarification: this only happens in the UI. When disabling/re-enabling eca_content with drush, this doesn't happen. That makes me wonder if the rendering layer is calling something in the middle of a container rebuild or the likes.
Here is the full stack trace:
Comment #9
jurgenhaasFortunately, the solution was to remove a bad habit that I used in the constructor of the Browser service: doing initialization work there. This is always asking for trouble.
That class is now declared final, as there really isn't any need to extend that. Everything inside is now private, and the initialization work is done in getters.
The problem seems to be resolved by this. Please test and set to RTBC if you can confirm.
Comment #10
bisonbleu commentedI tested the issue’s patch and the circular reference error is gone. FYI - I was also seeing it when flushing all caches from the admin UI; now this is also fine.
One thing though: after uninstalling and re-enabling eca_content, I’m seeing these 4 other errors in the watchdog:
Comment #11
jurgenhaasThose follow-up messages are unrelated to ECA, I'm convinced. Those are action plugins from Drupal core that are missing something. Following the instructions on how to delete them, should resolve that for you.
Glad to see that the real issue is resolved, though. Thanks for finding and reporting it.
Comment #13
jurgenhaasComment #15
chris matthews commentedInterestingly, I'm also getting this when installing a new module via the admin UI.
Comment #16
jurgenhaas@chris matthews which version did that happen with? Note, this either required 3.1.x-dev or 3.1.0-rc1 which was tagged around the time when you sent that comment above.
Comment #17
chris matthews commentedI am on:
Note, on the project page, I see:
However, in the ECA docs (https://ecaguide.org/eca/install/), I see I should likely be using: Workflow Modeler, so I'll try switching to that.
Comment #18
jurgenhaasSo, the bug is resolved in the rc1 release.
The discrepancy of recommended modeler comes from the fact that the new modeler is a bit of the secret until Tuesday, at DrupalCon. Some parts like the eca guide have already been updated, but not all yet.