Closed (fixed)
Project:
Configuration Split
Version:
2.0.0-beta5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2022 at 21:29 UTC
Updated:
19 Jul 2022 at 16:34 UTC
Jump to comment: Most recent
Comments
Comment #2
bircherHi
This seems like a strange bug. I can not reproduce it so more detailed steps are needed.
Comment #3
richarddavies commentedI maintain two Drupal sites and one of them has this issue after upgrading config split, whereas the other site did not, so this issue is somewhat dependent on other modules or site configuration. But it's not obvious to me how to identify exactly what the conflicting module or configuration is, but I've researched this error and found some similar bug reports with other modules:
https://www.drupal.org/project/domain/issues/3005048
https://www.drupal.org/project/s3fs/issues/3259065
https://www.drupal.org/project/drupal/issues/3155536
I don't claim to fully understand the problem here or how to fix it, but my understanding is that a circular reference can exist in the dependency injection system when multiple modules all have a dependency on the same service. The above issues provide more detailed information and some patches that apparently can be used to work around this issue.
FYI, I did experiment and on my broken site I was able to successfully run
drush crwithout the circular reference error by deleting the@cache_tags.invalidatorargument from config_split.status_override in config_split.services.yml and deleting the$cacheInvalidatorargument in the src/Config/StatusOverride.php constructor.I hope perhaps reading through those issues above and looking at the patches might provide enough information to be able to implement a similar fix for this module. If you need me to do any specific troubleshooting or debug steps let me know and I can try and provide you with more information.
Comment #4
bircherThanks for the links and more details on this issue.
Could you debug how your
cache_tags.invalidatorservice looks like? Or if you have any module that decorates it?It looks very strange to me that the cache tags invalidator would depend on the block plugin manager...
Comment #5
richarddavies commentedI'm not exactly sure what you mean by debug how my service looks like. But I did search through the *.services.yml files in web/modules and none of them decorate the cache_tags.invalidator service.
While doing that, I noticed that we're using the redirect_404 module which does decorate the logger.factory service and uses the config.factory service. And I discovered that if I uninstall that redirect_404 module that the circular reference error with drush cr goes away, so that seems like an important clue to isolating the issue. If you install redirect_404 can you reproduce the error now? Hopefully that will allow you to further debug/troubleshoot the issue.
Comment #6
bircherHi, no, redirect_404 will alone will not trigger it...
Could you create a very basic site on github or something that recreates the problem?
I mean set up a new drupal site with composer, install the umami profile and all the contrib modules you need to trigger it. export the config. You can install all modules except for config split, so that when I clone the site and install config split I can reproduce the issue.
That would be a tremendous help.
I know we can use setter injection, but I am still a bit puzzled why the dependency I use is problematic.
Comment #7
richarddavies commentedI realized my earlier comment about using the redirect_404 module may have been confusing. To clarify, we are using https://www.drupal.org/project/issues/redirect which contains a submodule named redirect_404. (We are not using the D7 module https://www.drupal.org/project/redirect_404)
Comment #8
bircheryes of course. I just composer required it and it took the correct module since the other one doesn't have any drupal 8 or 9 release.
I think it is more modules together. So please share your composer.json and the core.extensions.yml.
Or as I previously suggested: set up a new site with the umami profile and add all modules necessary to reproduce this issue.
Comment #9
jnicola commentedI'm now having a similar issue with:
Circular reference detected for service "color.theme_decorator", path: "color.theme_decorator -> config.factory -> config_split.status_override -> cache_tags.invalidator".Removing all config split settings has no bearing on the issue persisting.
Yes, the color module is silly, but an install profile we're using requires it.
Comment #10
bircherThanks for another example. But unfortunately in order to debug this I still need what I described in #8
Comment #11
richarddavies commentedSorry for the delay. Here is my composer.json and core.extensions.yml.
Comment #12
dimas11 commentedMay be it is related to https://www.drupal.org/project/drupal/issues/3103620 ?
Comment #14
bircherI assume this is fixed by separating the services? if not please re-open the issue.
Comment #15
richarddavies commented@bircher Can you please explain what exactly you mean by "separating the services"? An example of how to do that would be helpful too.
Comment #16
bircher@RichardDavies This is what I mean by splitting the services: e75b495.
Just try the latest release and check if the problems persists. If it does you can re-open the issue and I will try to debug this some day...