Class 'Drupal\simple_sitemap\Queue\SimpleSitemapQueue' not found

Created on 14 August 2021, over 3 years ago
Updated 13 April 2024, 8 months ago

Problem/Motivation

Not able to login due to Error: Class 'Drupal\simple_sitemap\Queue\SimpleSitemapQueue' not found

Here is the full error.

Error: Class 'Drupal\simple_sitemap\Queue\SimpleSitemapQueue' not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.queue') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.queue', 1) (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.queue_worker') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.queue_worker', 1) (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.generator') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.generator', 1) (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 237)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.form_helper') (Line: 173)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.form_helper') (Line: 158)
Drupal::service('simple_sitemap.form_helper') (Line: 43)
simple_sitemap_form_alter(Array, Object, 'user_login_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'user_login_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('user_login_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Not really sure if this issue is reproducible on a vanilla site with just Simple XML Sitemap installed. I have bunch of other contrib modules installed which might affect the behavior of this module.

  • Install Simple XML Sitemap module.
  • Navigate to /users/login. The fatal error should be showing on this page preventing users to login.

Any thoughts?

πŸ’¬ Support request
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡΅πŸ‡­Philippines stoickthevast

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 States attheshow

    Comment #30 was very helpful for me when trying to fix this issue on Pantheon. Thanks @KCarlile!

  • πŸ‡ΊπŸ‡ΈUnited States karenann

    I have having similar errors and tried the /rebuild.php and updb and cr etc etc:

    On cr, ReflectionException: Class "\Drupal\simple_sitemap\Controller\SimpleSitemapController" does not exist in /code/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php:135

    On updb, it did the first two (I think) updates and failed on 8403 with: Error: Class "Drupal\simple_sitemap\Queue\SimpleSitemapQueue" not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of /code/web/core/lib/Drupal/Component/DependencyInjection/Container.php).

    I'm on pantheon, like comment #37, and I looked to #30.

    • I removed the simple_sitemap files
    • git config core.ignorecase false
    • composer require 'drupal/simple_sitemap:^4.1'
    • commit and push

    I did a cache rebuild which STILL threw an error, but the subsequent updb did NOT error and things seem okay.

  • πŸ‡©πŸ‡ͺGermany rwam

    Same issue on local Mac OSX and Ubuntu on staging/production. Removing and reinstalling the module doesn't solve this. To fix the issue there are the following steps necessary:

    1. git mv src/Commands/SimplesitemapCommands.php src/Commands/SimplesitemapCommands2.php
      git mv src/Controller/SimplesitemapController.php src/Controller/SimplesitemapController2.php
      git mv src/Form/SimplesitemapFormBase.php src/Form/SimplesitemapFormBase2.php
      git mv src/Plugin/simple_sitemap/SimplesitemapPluginBase.php src/Plugin/simple_sitemap/SimplesitemapPluginBase2.php
      git mv src/Queue/SimplesitemapQueue.php src/Queue/SimplesitemapQueue2.php
    2. git mv src/Commands/SimplesitemapCommands2.php src/Commands/SimpleSitemapCommands.php
      git mv src/Controller/SimplesitemapController2.php src/Controller/SimpleSitemapController.php
      git mv src/Form/SimplesitemapFormBase2.php src/Form/SimpleSitemapFormBase.php
      git mv src/Plugin/simple_sitemap/SimplesitemapPluginBase2.php src/Plugin/simple_sitemap/SimpleSitemapPluginBase.php
      git mv src/Queue/SimplesitemapQueue.php2 src/Queue/SimpleSitemapQueue.php
    3. git commit -m "Fixing file names"

    I had similar issues in the past and this always work for me (e.g. 2886663 β†’ ).

    Maybe a short note or linking this issue on the upgrade info would be helpful.

  • πŸ‡ΊπŸ‡ΈUnited States en-cc-org

    Same issue, local Windows with Pantheon, upgrading from 3.11 to 4.1.6. #26 πŸ’¬ Class 'Drupal\simple_sitemap\Queue\SimpleSitemapQueue' not found Fixed worked like a charm for me, thanks @Sutharsan and all who contributed above.

  • πŸ‡΅πŸ‡°Pakistan isalmanhaider

    #38 worked both on local and acquia!
    this was a real blocker for us in upgrading to D10

Production build 0.71.5 2024