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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guardiola86 created an issue. See original summary.

guardiola86’s picture

guardiola86’s picture

Status: Active » Needs review
agentrickard’s picture

The 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.

agentrickard’s picture

I 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.

agentrickard’s picture

Status: Needs review » Needs work
henk’s picture

Interesting case. I will start debug this issue, right now.

henk’s picture

Assigned: Unassigned » henk
henk’s picture

Issue tags: +#global-sprint-weekend
dpagini’s picture

@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...?

henk’s picture

Hi @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.

freelock’s picture

Title: Issue creating user with Behat » Circular Reference errors in Domain Negotiator

I'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 &quot;domain.negotiator&quot;, path: &quot;domain.negotiator -&gt; comment.manager -&gt; url_generator -&gt; router.route_provider -&gt; path_processor_manager -&gt; domain_source.path_processor&quot;. in <em class="placeholder">Drupal\Component\DependencyInjection\Container-&gt;get()</em> (line <em class="placeholder">141</em> of <em class="placeholder">core/lib/Drupal/Component/DependencyInjection/Container.php</em>).

freelock’s picture

Oh, by the way, this issue can be triggered by visiting a page immediately after rebuilding the cache. Every. Single. Time.

agentrickard’s picture

Oh, by the way, this issue can be triggered by visiting a page immediately after rebuilding the cache. Every. Single. Time.

No. It. Does. Not.

I cannot reproduce the issue, and it is unrelated to Behat. Please open a new issue with steps to reproduce.

agentrickard’s picture

Title: Circular Reference errors in Domain Negotiator » Circular Reference errors in Domain Negotiator when using Behat
Status: Needs work » Postponed (maintainer needs more info)
agentrickard’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)