Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm trying to create a user with this step in Behat:
Given I am logged in as a user with the "administrator" role
But I'm getting the following error:
Circular reference detected for service "domain.negotiator", path: "domain.negotiator -> domain.loader -> config.factory -> domain_config.overrider". (Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
I've been trying to figure out what the issue could be without success. Anyone knows what it can be or at least point me in the right direction? Thanks.
Comment | File | Size | Author |
---|---|---|---|
#2 | issue_creating_user_with_behat-2842785-11863387.patch | 2.35 KB | guardiola86 |
Comments
Comment #2
guardiola86 CreditAttribution: guardiola86 commentedComment #3
guardiola86 CreditAttribution: guardiola86 commentedComment #4
agentrickardThe negotiator service is essential to how the config override system works. I don't like the idea of breaking dependency injection here.
Any ideas why this only affects Behat? The other testing suites don't have this issue.
It would be more efficient to file a pull request here https://github.com/agentrickard/domain/pulls given that we can't run automated tests on the d.o. infrastructure.
Comment #5
agentrickardI have also added https://github.com/agentrickard/domain/issues/316, as a pointer, since we can add Behat tests to TravisCI, I'd love to have at least one, simple Behat test that we could use for the project.
Comment #6
agentrickardComment #7
henk CreditAttribution: henk at RatioWeb commentedInteresting case. I will start debug this issue, right now.
Comment #8
henk CreditAttribution: henk at RatioWeb commentedComment #9
henk CreditAttribution: henk at RatioWeb commentedComment #10
dpagini CreditAttribution: dpagini as a volunteer commented@henk, any chance you had some time to look into this at all? do you have any findings to share? seeing the same problem in my project and wondering if there can be any shared learnings...?
Comment #11
henk CreditAttribution: henk at RatioWeb commentedHi @dpagini path from #2 will fix PHP error with circular reference. I was debugging why Behat create user in different way than standard user add form. But don't have good solution for it yet. In this weekend I will try once again look on that issue and will update about results.
Comment #12
freelockI'm getting the same error in a different place, in domain_source, the DomainSourcePathProcessor file.
I think in general this is breaking due to some limits to using dependency injection in classes that are accessed before some services are available...
In my case, this is the error:
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException</em>: Circular reference detected for service "domain.negotiator", path: "domain.negotiator -> comment.manager -> url_generator -> router.route_provider -> path_processor_manager -> domain_source.path_processor". in <em class="placeholder">Drupal\Component\DependencyInjection\Container->get()</em> (line <em class="placeholder">141</em> of <em class="placeholder">core/lib/Drupal/Component/DependencyInjection/Container.php</em>).
Comment #13
freelockOh, by the way, this issue can be triggered by visiting a page immediately after rebuilding the cache. Every. Single. Time.
Comment #14
agentrickardNo. It. Does. Not.
I cannot reproduce the issue, and it is unrelated to Behat. Please open a new issue with steps to reproduce.
Comment #15
agentrickardComment #16
agentrickard