We encountered a Circular reference issue using the domain_config contrib module and the syslog core module.
Basically what happens is the syslog module defines config and uses $config_factory->get to fetch this config. This config is passed through the domain_config module override, but this module uses a logger in its DomainNegotiator so calls the logger service and syslog is run which ->get's config, and thus domain is trigger again.. creating a Circular reference.
This could be fixed by using getEditable, but we found that this still does get overridden by the domain_config module. The core problem lies in the fact that in the ConfigFactory in doLoadMultiple propagateConfigOverrideCacheability is always called.
#0 /var/www/html/web/core/lib/Drupal.php(699): Drupal\Component\DependencyInjection\Container->get('logger.factory')
#1 /var/www/html/web/modules/civicrm/civicrm_entity/civicrm_entity.module(30): Drupal::logger('civicrm-entity')
#2 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(112): civicrm_entity_entity_type_build(Array)
#3 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\Core\Entity\EntityTypeManager->findDefinitions()
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#5 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(126): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('domain', false)
#6 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(233): Drupal\Core\Entity\EntityTypeManager->getDefinition('domain')
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(169): Drupal\Core\Entity\EntityTypeManager->getHandler('domain', 'storage')
#8 /var/www/html/web/modules/contrib/domain/domain/src/DomainNegotiator.php(89): Drupal\Core\Entity\EntityTypeManager->getStorage('domain')
#9 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(274): Drupal\domain\DomainNegotiator->__construct(Object(Symfony\Component\HttpFoundation\RequestStack), Object(Drupal\Core\Extension\ModuleHandler),
Object(Drupal\Core\Entity\EntityTypeManager), Object(Drupal\Core\Config\ConfigFactory))
#10 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'domain.negotiat...')
#11 /var/www/html/web/core/lib/Drupal.php(159): Drupal\Component\DependencyInjection\Container->get('domain.negotiat...')
#12 /var/www/html/web/modules/contrib/domain/domain_config/src/DomainConfigOverrider.php(183): Drupal::service('domain.negotiat...')
#13 /var/www/html/web/modules/contrib/domain/domain_config/src/DomainConfigOverrider.php(156): Drupal\domain_config\DomainConfigOverrider->initiateContext()
#14 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php(224): Drupal\domain_config\DomainConfigOverrider->getCacheableMetadata('syslog.settings')
#15 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php(186): Drupal\Core\Config\ConfigFactory->propagateConfigOverrideCacheability('syslog.settings...', 'syslog.settings')
#16 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php(104): Drupal\Core\Config\ConfigFactory->doLoadMultiple(Array, true)
#17 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php(89): Drupal\Core\Config\ConfigFactory->doGet('syslog.settings')
#18 /var/www/html/web/core/modules/syslog/src/Logger/SysLog.php(46): Drupal\Core\Config\ConfigFactory->get('syslog.settings')
#19 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(266): Drupal\syslog\Logger\SysLog->__construct(Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Core\Logger\LogMessageParser))
#20 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.syslog')
#21 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('logger.syslog', 1)
#22 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(319): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#23 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(495): Drupal\Component\DependencyInjection\Container->createService(Array, 'private__s4l_m7...')
#24 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(230): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#25 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.factory')
#26 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('logger.factory', 1)
#27 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(242): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#28 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.channel....')
#29 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(480): Drupal\Component\DependencyInjection\Container->get('logger.channel....', 1)
#30 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(230): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array)
#31 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'file_system')
#32 /var/www/html/web/core/lib/Drupal.php(159): Drupal\Component\DependencyInjection\Container->get('file_system')| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drupal-check-immutable-2989937.patch | 607 bytes | wannesdr |
Comments
Comment #2
borisson_Discussed this with @alexpott on slack earlier today. I also posted a backtrace when discussing this issue. I added that to the IS.
I don't have a clue how to solve this.
Comment #3
alexpottI'm not sure that the solution is to not call the propagateConfigOverrideCacheability. There's a deeper problem at play here. The loggers shouldn't be using override free config.
Comment #4
wannesdrA small fix which seems a bit too obvious but I wanted to try/test nonetheless.
Comment #5
alexpott@wannesderoy that's not really a fix because SysLog doesn't use immutable config. And it really shouldn't.
Comment #16
luke.stewart commentedThis is the Bug Smash Initiatives target today.
I had a quick look at the domain module and I'm wondering if the code has changed such that this reported instance will no longer replicate the issue?
I think given the lack of engagement here and without clear steps to reproduce it's probably worth closing this one off?
I've marked this as PMNMI.
I think if no further engagement on this in 3 months then we can probably close as cannot reproduce.
Comment #17
borisson_I'll close this as outdated, the project we encountered this on hasn't been using these versions for quite a while.