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')
CommentFileSizeAuthor
#4 drupal-check-immutable-2989937.patch607 byteswannesdr

Comments

wannesderoy created an issue. See original summary.

borisson_’s picture

Issue summary: View changes

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.

alexpott’s picture

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

wannesdr’s picture

StatusFileSize
new607 bytes

A small fix which seems a bit too obvious but I wanted to try/test nonetheless.

alexpott’s picture

@wannesderoy that's not really a fix because SysLog doesn't use immutable config. And it really shouldn't.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

luke.stewart’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

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

borisson_’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

I'll close this as outdated, the project we encountered this on hasn't been using these versions for quite a while.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.