ServiceCircularReferenceException in context of logging between s3fsfileservice and logger.raven

Created on 26 June 2024, 5 months ago
Updated 30 July 2024, 4 months ago

Problem/Motivation

We are looking to use both raven β†’ and S3 File System β†’ .

When we enable both modules, there seems to be a conflict between the two:

2024-04-02T11:30:17.921703541Z In Container.php line 147:
2024-04-02T11:30:17.921713569Z                                                                                        
2024-04-02T11:30:17.921716545Z   [Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException]  
  Circular reference detected for service "s3fsfileservice", path: "asset.css          
  .collection_optimizer -> s3fsfileservice -> logger.channel.file -> logger.f          
2024-04-02T11:30:17.921724740Z   actory -> logger.raven".                                                             
2024-04-02T11:30:17.921727135Z      

How would one resolve such issue?

More logging:

$ ddev drush cr -vvv > log
 [preflight] Config paths: /var/www/html/vendor/drush/drush/drush.yml,/var/www/html/drush/drush.yml
 [preflight] Alias paths: /var/www/html/web/drush/sites,/var/www/html/drush/sites
 [preflight] Commandfile search paths: /var/www/html/vendor/drush/drush/src,/var/www/html/drush
 [info] Starting bootstrap to site [0.26 sec, 3.1 MB]
 [info] Drush bootstrap phase 2 [0.26 sec, 3.1 MB]
 [info] Try to validate bootstrap phase 2 [0.26 sec, 3.1 MB]
 [info] Try to validate bootstrap phase 2 [0.26 sec, 3.11 MB]
 [info] Try to bootstrap at phase 2 [0.26 sec, 3.11 MB]
 [info] Drush bootstrap phase: bootstrapDrupalRoot() [0.26 sec, 3.11 MB]
 [info] Change working directory to /var/www/html/web [0.26 sec, 3.11 MB]
 [info] Initialized Drupal 10.2.6 root directory at /var/www/html/web [0.26 sec, 3.11 MB]
 [info] Try to validate bootstrap phase 2 [0.26 sec, 3.11 MB]
 [info] Try to bootstrap at phase 2 [0.26 sec, 3.25 MB]
 [info] Drush bootstrap phase: bootstrapDrupalSite() [0.26 sec, 3.25 MB]
 [debug] Could not find a Drush config file at sites/default/drush.yml. [0.26 sec, 3.25 MB]
 [info] Initialized Drupal site publicatietool.ddev.site at sites/default [0.27 sec, 3.25 MB]

In Container.php line 147:
                                                                                                                                                                                  
  [Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException]                                                                                             
  Circular reference detected for service "s3fsfileservice", path: "asset.css.collection_optimizer -> s3fsfileservice -> logger.channel.file -> logger.factory -> logger.raven".  
                                                                                                                                                                                  

Exception trace:
  at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:147
 Drupal\Component\DependencyInjection\Container->get() at /var/www/html/web/modules/custom/pt_common/src/TranslationInfo.php:51
 Drupal\pt_common\TranslationInfo::create() at /var/www/html/web/core/lib/Drupal/Core/DependencyInjection/ClassResolver.php:28
 Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() at /var/www/html/web/modules/custom/pt_common/pt_common.module:73
 pt_common_system_info_alter() at /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:545
 Drupal\Core\Extension\ModuleHandler->alter() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:322
 Drupal\Core\Extension\ExtensionList->doList() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:284
 Drupal\Core\Extension\ExtensionList->getList() at /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleExtensionList.php:126
 Drupal\Core\Extension\ModuleExtensionList->getActiveProfile() at /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleExtensionList.php:91
 Drupal\Core\Extension\ModuleExtensionList->getExtensionDiscovery() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:300
 Drupal\Core\Extension\ExtensionList->doScanExtensions() at /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleExtensionList.php:138
 Drupal\Core\Extension\ModuleExtensionList->doScanExtensions() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:314
 Drupal\Core\Extension\ExtensionList->doList() at /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleExtensionList.php:155
 Drupal\Core\Extension\ModuleExtensionList->doList() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:284
 Drupal\Core\Extension\ExtensionList->getList() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:262
 Drupal\Core\Extension\ExtensionList->get() at /var/www/html/web/core/lib/Drupal/Core/Extension/ExtensionList.php:245
 Drupal\Core\Extension\ExtensionList->getName() at /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:720
 Drupal\Core\Extension\ModuleHandler->getName() at /var/www/html/web/modules/contrib/symfony_mailer/src/Processor/EmailBuilderManager.php:93
 Drupal\symfony_mailer\Processor\EmailBuilderManager->processDefinition() at /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php:325
 Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() at /var/www/html/web/modules/contrib/symfony_mailer/src/Processor/EmailBuilderManager.php:204
 Drupal\symfony_mailer\Processor\EmailBuilderManager->findDefinitions() at /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php:205
 Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() at /var/www/html/web/modules/contrib/symfony_mailer/src/Processor/MailerConfigOverride.php:92
 Drupal\symfony_mailer\Processor\MailerConfigOverride->buildCache() at /var/www/html/web/modules/contrib/symfony_mailer/src/Processor/MailerConfigOverride.php:52
 Drupal\symfony_mailer\Processor\MailerConfigOverride->loadOverrides() at /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php:209
 Drupal\Core\Config\ConfigFactory->loadOverrides() at /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php:169
 Drupal\Core\Config\ConfigFactory->doLoadMultiple() at /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php:104
 Drupal\Core\Config\ConfigFactory->doGet() at /var/www/html/web/core/lib/Drupal/Core/Config/ConfigFactory.php:89
 Drupal\Core\Config\ConfigFactory->get() at /var/www/html/web/modules/contrib/raven/src/Logger/Raven.php:64
 Drupal\raven\Logger\Raven->__construct() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:259
 Drupal\Component\DependencyInjection\Container->createService() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:177
 Drupal\Component\DependencyInjection\Container->get() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:440
 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:273
 Drupal\Component\DependencyInjection\Container->createService() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:177
 Drupal\Component\DependencyInjection\Container->get() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:440
 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:249
 Drupal\Component\DependencyInjection\Container->createService() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:177
 Drupal\Component\DependencyInjection\Container->get() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:440
 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:237
 Drupal\Component\DependencyInjection\Container->createService() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:455
 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:237
 Drupal\Component\DependencyInjection\Container->createService() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:177
 Drupal\Component\DependencyInjection\Container->get() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:440
 Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:237
 Drupal\Component\DependencyInjection\Container->createService() at /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php:177
 Drupal\Component\DependencyInjection\Container->get() at /var/www/html/web/core/lib/Drupal.php:197
 Drupal::service() at /var/www/html/web/core/includes/common.inc:449
 drupal_flush_all_caches() at /var/www/html/web/core/includes/utility.inc:41
 drupal_rebuild() at /var/www/html/vendor/drush/drush/src/Commands/core/CacheRebuildCommands.php:70
 Drush\Commands\core\CacheRebuildCommands->rebuild() at n/a:n/a
 call_user_func_array() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:276
 Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
 Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:175
 Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:387
 Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1096
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:110
 Drush\Runtime\Runtime->doRun() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:40
 Drush\Runtime\Runtime->run() at /var/www/html/vendor/drush/drush/drush.php:139
 require() at /var/www/html/vendor/drush/drush/drush:4
 include() at /var/www/html/vendor/bin/drush:119

Failed to run drush cr -vvv: exit status 1

Steps to reproduce

Install and enable both modules.

Proposed resolution

Fix Dependency Injection in a way that they can both be used by users.

User interface changes

N/A.

API changes

N/A.

Data model changes

N/A.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

6.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @StephanMeijer
  • Status changed to Postponed: needs info 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    Your steps to reproduce say "Install and enable both modules" so I tried enabling the s3fs modules, but I didn't see any isssues. Maybe configuring and doing something with them is also required?

    Could you provide a complete list of steps to reproduce from a clean install of Drupal?

  • Status changed to Closed: cannot reproduce 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

    I couldn't yet reproduce this, but feel free to re-open if you can provide more info

Production build 0.71.5 2024