TaggedHandlersPass complains about not implementing an interface for a service class that doesn't exist

Created on 23 April 2020, over 4 years ago
Updated 18 June 2024, 5 months ago

TaggedHandlersPass complains that

> Service 'foo.bar' for consumer 'authentication_collector' does not implement Drupal\Core\Authentication\AuthenticationProviderInterface.

in the case that the service class doesn't even exist!

That's because in

      if (!is_subclass_of($handler->getClass(), $interface)) {
        throw new LogicException("Service '$id' for consumer '$consumer_id' does not implement $interface.");
      }

is_subclass_of() returns FALSE if the class doesn't exist. PHP docs say:

> A class name or an object instance. No error is generated if the class does not exist.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom jamie.slater

    I'm getting this error now on a D10 install.

    Symfony\Component\DependencyInjection\Exception\LogicException: Service 'rest_api_authentication.authentication.rest_api_authentication' for consumer 'authentication_collector' does not implement Drupal\Core\Authentication\AuthenticationProviderInterface. in Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->processServiceCollectorPass() (line 184 of /app/web/core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php).
    Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->processServiceCollectorPass(Array, 'authentication_collector', Object) (Line: 118)
    Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass->process(Object) (Line: 80)
    Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object) (Line: 767)
    Symfony\Component\DependencyInjection\ContainerBuilder->compile() (Line: 1330)
    Drupal\Core\DrupalKernel->compileContainer() (Line: 934)
    Drupal\Core\DrupalKernel->initializeContainer() (Line: 494)
    Drupal\Core\DrupalKernel->boot() (Line: 702)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    I'm not sure how to go about fixing it. Any ideas?

Production build 0.71.5 2024