Problem/Motivation

Upgrading from 3.3.4 to 3.3.5 I get the following error when trying to run drush updb after the composer update:

  Circular reference detected for service "Drupal\Core\Logger\LoggerChannelFactoryInterface", path: "asset.js.collection_optimizer -> asset.js.optimizer -> logger.channel.default -> Drupal\Core\Logger\LoggerChannelFactoryInterface ->
  logger.watchdog_mailer -> Drupal\commerce\Hook\CommerceHooks -> commerce.inbox_message_fetcher -> commerce.logger".

drush cr does NOT help.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork commerce-3587604

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

anybody’s picture

Maybe lazy-loading the logger is an alternative? Unsure if there's a pattern to solve this...?

anybody’s picture

Status: Active » Needs review

phpstan won't be happy...

anybody’s picture

Priority: Critical » Major
jsacksick’s picture

How come I never experience this on my installs... I wasn't affected by any of these related bugs in the projects I've upgraded...
This never seems to end.

jsacksick’s picture

Status: Needs review » Needs work

See CommerceCartHooks for a pattern you can follow, using the AutowireServiceClosure. Also, there is absolutely no reason for this to break from 3.3.5 and not from 3.3.4.

anybody’s picture

@jsacksick looking at the entries this only seems to happen with custom logger. Yeah had similar issues in core in the past...

Also, there is absolutely no reason for this to break from 3.3.5 and not from 3.3.4.

I understand, but I can for sure tell it happened...

jsacksick’s picture

Are you going to test the change suggested?

anybody’s picture

@jsacksick yes, thanks!!
Like this? (MR!679)

davidwhthomas’s picture

Just noting a similar error for me too after updating from 3.1.0 => 3.3.5, with WSOD:

 Circular reference detected for service "Drupal\Core\Logger\LoggerChannelFactoryInterface", path: "cache_tags.invalidator -> plugin.manager.block -> logger.channel.default -> Drupal\Core\Logger\LoggerChan
  nelFactoryInterface -> logger.syslog -> Drupal\commerce\Hook\CommerceHooks -> commerce.inbox_message_fetcher -> commerce.logger".

Looking forward to the fix.

davidwhthomas’s picture

Priority: Major » Critical

Upgrading to critical because the site is completely dead with WSOD because of this error.

davidwhthomas’s picture

The patch in MR!678 fixes the issue. I understand it may not be the final fix but works as a workaround to get the site running again.

davidwhthomas’s picture

@anybody, thanks for your help with this. I added use Symfony\Component\DependencyInjection\Attribute\AutowireServiceClosure; to MR!679 to fix the phpunit pipeline errors previously seen in https://git.drupalcode.org/issue/commerce-3587604/-/jobs/9603253

davidwhthomas’s picture

Status: Needs work » Needs review

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @davidwhthomas. Does MR!679 also fix the issue entirely for you? For us it does now. Thank you for your help, very busy days...

RTBC from my side, if it's fine for you both!

davidwhthomas’s picture

You're welcome, thanks for your help too. Yes MR!679 now also fixes the issue as well, looks better!

  • jsacksick committed f25c6bad on 3.x authored by anybody
    fix: #3587604 Circular reference detected for service "Drupal\Core\...
jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

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.

davidwhthomas’s picture

Thanks @jsacksick!