Upon install I get the following related to language_manager:

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "language_manager", path: "language_request_subscriber -> language_manager -> config.factory -> domain_site_settings.overrider -> domain.negotiator". in Symfony\Component\DependencyInjection\Container->get() (line 271 of /srv/bindings/e20b9445053b47d2baa737e567d957ff/code/vendor/symfony/dependency-injection/Container.php).
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

magicmirror created an issue. See original summary.

Yazzbe’s picture

I have the exact same problem on an existing drupal 8.4.3 installation.

The error appears after enabling the core modules language, locale + adding a new language other than English.
I was able to recreate the issue on simplytest.me

  • Install drupal 8.4.3, with default language English
  • Enable domain, domain access, domain configuration, domain content (alpha-10)
  • Rebuild permissions, cr, updb
  • Create 2 domain records
  • Create test content on each subdomain
  • Enable core modules locale, language
  • Add additional language (dutch)
  • Run update.php (no problem)
  • Install domain_site_settings v 8.x-1.2
  • Run update.php … WOD
netsliver’s picture

I have the same problem after upgrade 8.3 to 8.4 core

AlanHDev’s picture

Title: Circular Error or Conflict with Language_Manerag » Circular Error or Conflict with Language_Manager
FileSize
2.16 KB

We also ran into this after updating Domain module to alpha10.

By removing dependency injection for the domain negotiator, the circular error is avoided. This is probably not the best way to achieve a fix but it will allow the module to be used with domain > alpha9 and core 8.4.x

The attached patch applies to the 8.x-1.x branch but won't apply cleanly to 8.x-1.2 because of changes to the branch since the last release.

AlanHDev’s picture

Attached patch file will apply to 8.x-1.2

Yazzbe’s picture

Applied the patch #5 tot 8.x-1.2 manually and the errors are gone :)

Many thanks.

AlanHDev’s picture

Status: Active » Needs review
FileSize
2.19 KB

The previous patch 5 did not apply properly. I've re-rolled it and it now works properly.

This patch applies to 8.x-1.2

Yazzbe’s picture

Applied patch #7 to 8.x-1.2 and the errors are gone.
PHP 7.1

RTBC.

agentrickard’s picture

There are known cases where these routines run too early to reliably use dependency injection, which is why we had to introduce DomainConfigOverrider::initiateContext() in the core module suite. This change is similar in nature.

codesquatch’s picture

Was having the same issue and the patch resolved it. Thanks Alan-H.

tim-diels’s picture

Patch working, many thanks

whiz11’s picture

When I run composer update with the patch in composer, I get this output

Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing drupal/domain_site_settings (1.2.0): Loading from cache
- Applying patches for drupal/domain_site_settings
https://www.drupal.org/files/issues/circular_dependency-2930391-7.patch (Circular dependency issue)
Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/circular_dependency-2930391-7.patch

This is my composer.json,

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0+",
    "require": {
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "~1.4",
        "drupal/admin_toolbar": "^1.18",
        "drupal/redirect": "^1.0@alpha",
        "drupal/devel": "^1.0@RC",
        "drupal/erd": "^1.0@beta",
        "drupal/domain": "^1.0@alpha",
        "drupal/colorbox": "^1.2",
        "drupal/libraries": "3.x-dev",
        "drupal/video_embed_field": "^1.4",
        "drupal/menu_link_attributes": "^1.0@beta",
        "drupal/simple_menu_icons": "^1.0@beta",
        "drupal/features": "^3.2",
        "drupal/current_page_crumb": "^1.0",
        "drupal/addtoany": "^1.7",
        "drupal/maxlength": "^1.0@beta",
        "j7mbo/twitter-api-php": "dev-master",
        "drupal/views_slideshow": "^4.3",
        "drupal/geolocation": "^1.10",
        "drupal/domain_theme_switch": "^1.0",
        "drupal/pathauto": "^1.0@RC",
        "drupal/block_class": "^1.0@alpha",
        "drupal/webform": "^5.0",
        "drupal/geocoder": "2.x-dev",
        "drupal/geofield": "^1.0@alpha",
        "drupal/geocoder_autocomplete": "^1.0",
        "drupal/field_group": "^1.0@RC",
        "drupal/easy_breadcrumb": "^1.6",
        "drupal/block_visibility_groups": "^1.1",
        "drupal/search_api": "^1.0@beta",
        "drupal/better_exposed_filters": "3.x-dev",
        "drupal/paragraphs": "^1.1",
        "drupal/entity_reference_revisions": "^1.2",
        "drupal/facets": "^1.0@alpha",
        "drupal/fac": "1.x-dev",
        "drupal/search_api_autocomplete": "^1.0",
        "drupal/lang_dropdown": "^2.0",
        "drupal/security_review": "1.x-dev",
        "drupal/domain_site_settings": "^1.2",
        "drupal/honeypot": "^1.25",
        "drupal/encrypt": "^3.0@alpha",
        "drupal/key": "^1.3",
        "drupal/file_encrypt": "^1.0@alpha",
        "drupal/webform_encrypt": "1.x-dev",
        "drupal/real_aes": "^2.0@beta",
        "drupal/metatag": "^1.0",
        "drupal/seckit": "^1.0@alpha",
        "drupal/simple_sitemap": "^2.9",
        "drupal/sitemap": "^1.3",
        "drush/drush": "^8.1",
        "cweagans/composer-patches": "^1.6",
        "drupal/captcha": "^1.0@beta",
        "drupal/recaptcha": "^2.2",
        "drupal/mailsystem": "^4.1",
        "drupal/google_analytics": "^2.1",
        "nuovo/spreadsheet-reader": "^0.5.11",
        "drupal/editor_file": "^1.2",
        "PHPOffice/PHPExcel": "^1.8",
        "drupal/eck": "^1.0@alpha",
        "drupal/ultimate_cron": "^2.0@alpha",
        "drupal/webform_views": "^5.0@alpha",
        "drupal/sendgrid_integration": "^1.0",
        "fastglass/sendgrid": "^1.0",
        "drupal/path_redirect_import": "^1.0@beta",
        "drupal/config_ignore": "^2.1",
        "drupal/clamav": "^1.0",
        "drupal/scheduler": "^1.0",
        "drupal/memcache": "^2.0@alpha"
    },
    "replace": {
        "drupal/core": "~8.5.1"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php.",
            "This file specifies the packages.drupal.org repository.",
            "You can read more about this composer repository at:",
            "https://www.drupal.org/node/2718229"
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "core": ["type:drupal-core"],
            "modules/contrib/{$name}": ["type:drupal-module"],
            "profiles/contrib/{$name}": ["type:drupal-profile"],
            "themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/contrib/{$name}": ["type:drupal-drush"],
            "modules/custom/{$name}": ["type:drupal-custom-module"],
            "themes/custom/{$name}": ["type:drupal-custom-theme"]
        },
        "patches": {
            "drupal/domain_site_settings": {
                "Circular dependency issue": "https://www.drupal.org/files/issues/circular_dependency-2930391-7.patch"
            }
        }

    },
    "autoload": {
        "psr-4": {
            "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
        }
    },
    "scripts": {
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "post-autoload-dump": [
            "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
        ],
        "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
        "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ]
}
techwolf12’s picture

@whiz11
"drupal/domain_site_settings": "^1.2"

Can you try to remove the ^ (to be sure this isn't the cause)?

Patch worked here. Though it generates the same issue on domain.negotiator now but will try to fix it

hlc32843163’s picture

Patch #7 working, thanks.

SocialNicheGuru’s picture

Status: Needs review » Needs work

I can't seem to get this patch to apply to 8.x-1.2

git apply circular_dependency-2930391-7.patch
error: patch failed: src/Configuration/DomainConfigOverride.php:33
error: src/Configuration/DomainConfigOverride.php: patch does not apply
---
patch -p1 < circular_dependency-2930391-7.patch
patching file domain_site_settings.services.yml
patching file src/Configuration/DomainConfigOverride.php
Hunk #1 succeeded at 15 (offset -1 lines).
Hunk #2 FAILED at 26.
Hunk #3 succeeded at 50 with fuzz 2 (offset -2 lines).
1 out of 3 hunks FAILED -- saving rejects to file src/Configuration/DomainConfigOverride.php.rej

ApacheEx’s picture

Status: Needs work » Needs review
FileSize
2.23 KB

Here is rerolled patch based on #7.

valthebald’s picture

Version: 8.x-1.2 » 8.x-1.x-dev

The latest patch applies to 1.x, but not to 1.2 (patch from #7 still works fine with 1.2). Changing the version

pingevt’s picture

Just wanted to add that #7 seems to work for me on 1.2

vuil’s picture

I received additional dependence Language_Manager issue (and the site goes down as well) after patch use, need additional work for sure.

I checked both #7 (with domain_site_settings:^1.2), and #16 (with 1.x-dev version), with all kinds of drupal/domain versions.

Drupal core is updated from 8.4.8 to both 8.5.7 & 8.6.1 - the website and drush(^9.4) is working well (without any patch) - except drush cr (cache rebuild):
"Circular reference detected for service "entity_type.manager", path: "workbench_moderation.inline_editing_disabler -> workbench_moderation.moderation_information -> entity_type.manager -> string_translation -> string_transla
tor.locale.lookup -> config.factory -> domain_site_settings.overrider -> domain.negotiator"."

After apply a patch, website goes down and drush stop working at all, showing various errors on each try of drush command execution.

I already posted an issue in domain module issues:
https://www.drupal.org/project/domain/issues/3007056
and another here: https://www.drupal.org/project/domain_site_settings/issues/3007335

Update / progress:
This patch is already working for us...
The issue was coming from "domain_language" module and its 'domain.negotiator' override!

Thanks, pals!

peter.thorndycraft’s picture

The patch above worked well for us until we added the replicate_ui module, we now get the error message back and the site is down and drush can't run:

Circular reference detected for service "domain.negotiator", path: "domain.negotiator".

joe_carvajal’s picture

FileSize
2.28 KB

A new reroll, applied to the latest dev.
This one worked for me to solve the error caused on a module update.

kumkum29’s picture

Hello,

I get the same error when I want to delete a rules config.

Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: "Circular reference detected for service "entity_type.manager", path: "entity_type.manager -> string_translation -> string_translator.locale.lookup -> config.factory -> domain_site_settings.overrider -> domain.negotiator"." at /srv/data/web/vhosts/mysite.com/htdocs/core/lib/Drupal/Component/DependencyInjection/Container.php line 141

D8.6.1 / Domain Site Settings 8.x-1.3

agentrickard’s picture

Try adjusting the 'priority' of the service and see if that changes anything.

services:
  domain_site_settings.overrider:
    class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride
    arguments: ['@domain.negotiator', '@config.factory']
    tags:
      - {name: config.factory.override, priority: 5}

In Domain Config, the priority is set to -150 and we don't have this issue.

The tests for this module should also be updated to correct this issue.

Note that you can use Domain Config instead. It just doesn't provide a UI until https://github.com/agentrickard/domain/pull/434 is done.

markdc’s picture

#21 is working for me. Thank you!

oierbravo’s picture

#21 working for me.
Thanks!
D8.6.10 / Domain Site Settings 8.x-1.3

vuil’s picture

Assigned: Unassigned » vuil
Status: Needs review » Fixed
vuil’s picture

Status: Fixed » Closed (fixed)
DD 85’s picture

Drupal 8.7.5
PHP 7.1.7
Domain Site Settings 8.x-1.3

Got an error
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "language_manager", path: "language_request_subscriber -> language_manager -> config.factory -> domain_site_settings.overrider -> domain.negotiator -> entity_type.manager -> string_translation -> string_translator.locale.lookup". in Drupal\Component\DependencyInjection\Container->get() (line 143 of core\lib\Drupal\Component\DependencyInjection\Container.php).

#21 is working for me.
Thank you!

rodricels’s picture

I suggests to change the status to "fixed" instead of "closed", because the patch isn't integrated: if you use the lastest dev version, this bug is still active :(

davidjguru’s picture

Hi,

the patch rerolled by @joe_carvajal worked like a charm in our project. Thanks a lot.

Context
-----------
Drupal Core - 8.7.8
Web Server - Nginx 1.17.4
PHP 7.3.10
Database - 5.5.5-10.3.18-MariaDB
domain_site_settings - 1.3.0

Only a little annotation:
In our scenario, the patch worked great by applying it _before_ enabling the domain_site_settings module, I mean, this require:

  • composer require drupal/domain_site_settings
  • apply patch (download + git apply or included in composer.json, whatever)
  • drush en domain_site_settings // drupal moi domain_site_setting

If not, uninstall the module (drush pmu, drupal mou), clean the dependency (composer remove drupal/domain_site_settings) and delete it (rm -rf) . Then repeat.

Greetings from Andalusia.

vuil’s picture

dylanmehl’s picture

FileSize
2.11 KB

Had some issues using the patches above on current stable. Made some small changes, seems to work now.

dylanmehl’s picture

FileSize
2.59 KB

Had some issues using the patches above on current stable. Made some small changes, seems to work now.

dylanmehl’s picture

FileSize
2.67 KB

Had some issues using the patches above on current stable. Made some small changes, seems to work now.

dylanmehl’s picture

malaynayak’s picture

Assigned: vuil » Unassigned

Committed patch #16 to the latest dev.

vuil’s picture

#21 works fine with the current stable (8.x-1.3) version.

r81d3r’s picture

Version: 8.x-1.x-dev » 8.x-1.3

running on the same problem after updating to Drupal 8.9.10 with current stable (8.x-1.3) version.

as vuil already mentioned #21 works fine on my setup. #32 resulted in PHP fatal error.

I am not really shure why this bug which seems to be in the current stable version for quite a while is not fixed in an 8.x-1.4 update of this module or why this issue is marked as fixed.

Could one of the mantainers have a look at this?

Best
xx

valthebald’s picture

Version: 8.x-1.3 » 8.x-1.x-dev

@r81d3r: issues cannot be fixed in release (1.3), because releases are read-only tags.
Marking the issue as fixed in dev branch (1.x) is a correct way to track bugs (but of course, you can ask maintainers to create a new release)