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)