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?

CommentFileSizeAuthor
#23 Simple Sitemap File Name Change.jpg343.41 KBnarinlab
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

geraldvillorente created an issue. See original summary.

gbyte’s picture

Category: Bug report » Support request
Priority: Major » Normal

4.x doesn't have any known bugs and this one would be pretty apparent. ;)

The problem is probably the cached service container. Please run drush updb and then drush cr. If you don't use drush (or if running these commands poses problems), visit update.php and then core/rebuild.php.

If this error happens after a fresh install, please make sure you don't have 3rd party modules installed that rely on simple_sitemap 3.x, as 4.x is a rewrite and is not yet compatible with 3rd party modules that extend simple_sitemap.

kanaan.ngutu’s picture

I ran into the same issue and when I tried to execute drush updb another error shows on the console

In ContainerBuilder.php line 1140:

Class Drupal\simple_sitemap\Queue\SimpleSitemapQueue does not exist

My site is okay on localhost but this problem happened when I uploaded it to cpanel hosting. What weird is that some links are okay including the homepage but the others (including login page) shows the error. With that, I cannot clear cache from the interface and the terminal as well.

Really appreciate if someone can assist.

Thanks.

gbyte’s picture

@kanaan.ngutu Did you try my other suggestions?

kanaan.ngutu’s picture

@gbyte I tried drush updb and drush cr and both resulted in errors. The modules that depend on this module are disabled. What are your other suggestions..?

kanaan.ngutu’s picture

drush updb shows this error

In ContainerBuilder.php line 1140:

Class Drupal\simple_sitemap\Queue\SimpleSitemapQueue does not exist

drush cr shows this error

In EntityResolverManager.php line 128:

Class \Drupal\simple_sitemap\Controller\SimpleSitemapController does not exist

Site is based on Drupal 9 and it is okay locally but the issues appear as I uploaded it to cpanel hosting. This is the complete error I got when I browse to a login page.

The website encountered an unexpected error. Please try again later.
Error: Class 'Drupal\simple_sitemap\Queue\SimpleSitemapQueue' not found in Drupal\Component\DependencyInjection\Container->createService() (line 262 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.queue') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.queue', 1) (Line: 437)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.queue_worker') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.queue_worker', 1) (Line: 437)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.generator') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.generator', 1) (Line: 437)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240)
Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.form_helper') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('simple_sitemap.form_helper') (Line: 198)
Drupal::service('simple_sitemap.form_helper') (Line: 43)
simple_sitemap_form_alter(Array, Object, 'webform_submission_contact_node_25_add_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'webform_submission_contact_node_25_add_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('webform_submission_contact_node_25_add_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'add') (Line: 1230)
Drupal\webform\Entity\Webform->getSubmissionForm() (Line: 18)
Drupal\webform\WebformEntityViewBuilder->view(Object, 'default') (Line: 165)
Drupal\entity_block\Plugin\Block\EntityBlock->build() (Line: 105)
Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object, 'section_component.build.render_array', Object)
call_user_func(Array, Object, 'section_component.build.render_array', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'section_component.build.render_array') (Line: 90)
Drupal\layout_builder\SectionComponent->toRenderArray(Array, ) (Line: 86)
Drupal\layout_builder\Section->toRenderArray(Array) (Line: 317)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections(Object) (Line: 276)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 340)
Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 24)
Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 282)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 239)
Drupal\Core\Entity\EntityViewBuilder->build(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 786)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 377)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 241)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 717)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

gbyte’s picture

@kanaan.ngutu

If you don't use drush (or if running these commands poses problems), visit update.php and then core/rebuild.php.

Please try the cache rebuild script.

kanaan.ngutu’s picture

@gbyte, this is what I got when I go to update.php.

The website encountered an unexpected error. Please try again later.
ReflectionException: Class \Drupal\simple_sitemap\Controller\SimpleSitemapController does not exist in ReflectionMethod->__construct() (line 128 of core/lib/Drupal/Core/Entity/EntityResolverManager.php).
ReflectionMethod->__construct('\Drupal\simple_sitemap\Controller\SimpleSitemapController', 'getSitemap') (Line: 128)
Drupal\Core\Entity\EntityResolverManager->setParametersFromReflection(Array, Object) (Line: 214)
Drupal\Core\Entity\EntityResolverManager->setRouteOptions(Object) (Line: 48)
Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber->onRoutingRouteAlterSetType(Object, 'routing.route_alter', Object)
call_user_func(Array, Object, 'routing.route_alter', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'routing.route_alter') (Line: 189)
Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 574)
drupal_flush_all_caches() (Line: 352)
Drupal\system\Controller\DbUpdateController->selection(Object) (Line: 163)
Drupal\system\Controller\DbUpdateController->handle('selection', Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Update\UpdateKernel->handleRaw(Object) (Line: 75)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 27)

gbyte’s picture

For the third time though, did you try and run the cache rebuild script by visiting core/rebuild.php?

kanaan.ngutu’s picture

@gbyte, I have just correctly configure my settings.php and now I was able to run update.php but I still got the error which I pasted in my previous comment.

gbyte’s picture

I am usually patient with providing support, but when I have to repeat myself 4 times I feel like my time is being wasted.

Please visit the URL yoursite.com/core/rebuild.php. (Afterwards you may want to try and run yoursite.com/update.php again.)

kanaan.ngutu’s picture

I really appreciate your patient and support so I am sorry I may not very clear with my previous comments or understood you wrongly. I have done core/rebuild.php and update.php plenty times.

When I ran update.php the url changes to update.php/selection which outputs this error

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer::renderBarePage() must be of the type array, bool given, called in /home/kcciorg/public_html/docroot/core/modules/system/src/Controller/DbUpdateController.php on line 195 in Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage() (line 73 of core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php).
Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(, Object, 'maintenance_page', Array) (Line: 195)
Drupal\system\Controller\DbUpdateController->handle('on', Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Update\UpdateKernel->handleRaw(Object) (Line: 75)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 27)

gbyte’s picture

OK so now it seems to be a different error and it does not seem to have anything to do with this here module.
Googling it, I found this issue that has since been fixed in Drupal core; maybe this will be helpful?
#2830326: Broken link to 'Put your site into maintenance mode' on update.php results in WSOD

mattbloomfield’s picture

I'm getting the exact same error and no amount or combination of drush updb, drush cr, update.php, or core/rebuild.php are allowing anything to happen.

mattbloomfield’s picture

So the update seems to work no problem in D9. D8 throws the error and nothing seems to be able to resolve it.

narinlab’s picture

I'm also experiencing the exact same issue, on CPANEL hosting:

In ContainerBuilder.php line 1142:

  Class Drupal\simple_sitemap\Queue\SimpleSitemapQueue does not exist

when running drush updb :(

narinlab’s picture

I found the freakin error, go to: web/modules/contrib/simple_sitemap/src/Queue and find file SimplesitemapQueue.php and rename it to the correct one: SimpleSitemapQueue.php. You can see, s and S is causing this catastrophic failure.

gbyte’s picture

@narinlab It is correctly named in the repository, did your files failed to update for some reason? Is this a wired Windows thing where Windows doesn't see the difference? Does anyone else have this file without the capital S?

mattbloomfield’s picture

@narinlab may be onto something. Something, and I'm not entirely sure this is what caused it, was happening with updating my git repository. I checked that the names were right and I'm not getting the error anymore.

narinlab’s picture

I'm just confirming what is causing my error. The error message is like #16 with multiple occurence on different files. About 5 or 6 file is named wrongly after deployed into CPANEL. After checking using WinSCP, i saw Simplesitemap that is causing the error. After changing into SimpleSitemap all error are fixed. My working environment is Windows 7 with XAMPP, and syncronized into production server using GitHub. I don't know what causing this change in S into s. Really weird.

gbyte’s picture

Windows is not case sensitive so I believe if you just copy over the files it may not spot the renaming. As Linux is case sensitive (which is the logical approach), it doesn't find the correct file. Deleting the target files before copying the new ones over with Windows should fix it.

Maybe consider using git/drush on your local and testing environments as well?

narinlab’s picture

On Github and local machine (Windows 7), the file is OK. I don't know why after syncing to Cpanel (using git pull from github), its changing the S with s. FYI, a couple of days before i'm enabling simple_sitemap, i'm upgraded my drupal core into 9.2.0 and that requiring a server migration because of Database Server minimum version requirement issue. The hosting provider is changing my web into new server, may be that event also contributing into this weird error.

Only local images are allowed.
https://i.ibb.co/3ThLZ7M/Capture.jpg
Screenshot; left on github, right on my local maching. On the remote one, i'm forget to take the screenshoot.

narinlab’s picture

StatusFileSize
new343.41 KB

After doing filename comparison between Simple Sitemap 8.x-3.1 vs 4.0.0-alpha2, i found that file name is changed between Simeplesitemap to SimpleSitemap. So i have a clear vision now, about what is the main cause of this trouble (#6). Its not my hosting provider, its just me that upgrading the module from 3.1 to 4.0.0 alpha2 without doing some integrity check on my git repository. So the old file and the new file got messy between local and remote machine. I can confirm the issue related to S and s on #6 is fixed and work as expected.

Simple sitemap

gbyte’s picture

Status: Active » Fixed

Closing this support ticket as the issue has been identified.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sutharsan’s picture

I have the simple_sitemap module stored in Git (on OSX). And this is what it took to fix the casing after migrating from 3.8.0 to 4.0.0:

cd modules/contrib/simple_sitemap
git mv -f src/Commands/SimplesitemapCommands.php src/Commands/SimpleSitemapCommands.php
git mv -f src/Controller/SimplesitemapController.php src/Controller/SimpleSitemapController.php
git mv -f src/Form/SimplesitemapFormBase.php src/Form/SimpleSitemapFormBase.php
git mv -f src/Plugin/simple_sitemap/SimplesitemapPluginBase.php src/Plugin/simple_sitemap/SimpleSitemapPluginBase.php
git mv -f src/Queue/SimplesitemapQueue.php src/Queue/SimpleSitemapQueue.php
greatmatter’s picture

This shouldn't be closed/fixed. The cases are wrong on the distribution version.

THANK YOU to @narinlab.

gbyte’s picture

@greatmatter Everything is correct in the repository. What am I supposed to do about the broken OSX or Windows case handling? Tell you to use Linux?

greatmatter’s picture

@gbyte My apologies--you're 100% correct, and the issue is not with you--it's with git.

To anyone who's landed here:
Please ensure your HOST computer (where you manage your own repositories) has git's "ignorecase" to "false":
git config core.ignorecase false

For more information:
https://stackoverflow.com/questions/8904327/case-sensitivity-in-git

KCarlile’s picture

I just ran into this same issue with my local Mac and Acquia hosting (full disclosure, I work for Acquia, as does mfarineau). I found this Support KB article by @mfarineau that outlined exact steps for fixing this with a different module, but it worked with the module Simple XML Sitemap as well. Posting the same steps here for quick reference, modified slightly for this module:

  1. Remove purge Simple XML Sitemap module locally (rm -rf simple_sitemap/ from "docroot/modules/contrib")
  2. Push removal to Acquia git repo
  3. run git config --global core.ignorecase false [locally] to make global git adjustment to force git to pay attention to case in filenames
  4. run composer update to pull in purge Simple XML Sitemap module
  5. Push update to Acquia git with (git push --force [BRANCH])
  6. Run cache rebuild (drush cr)
  7. Run db updates (drush updb)
flyke’s picture

I have the same problem / error on Drupal 8.9 after updating simple_sitemap like this:

composer require 'drupal/simple_sitemap:^4.0'
drush updb -y

And this works: composer successfully updates simple_sitemap, and also: the drush updb -y command works.

But if I then want to clear caches:
drush cr
I get this message:

PHP Fatal error: Uncaught Error: Class 'Drupal\simple_sitemap\Controller\SimplesitemapController' not found in /app/web/modules/contrib/domain_simple_sitemap/src/Controller/DomainSimpleSitemapController.php:17

So I did what was suggested above:

rm -rf web/modules/contrib/simple_sitemap/
git config --global core.ignorecase false
composer update

which updated more than that I wanted -I was in the process of updating my drupal modules one by one and simpe_sitemap was the onlyone giving trouble- but the composer update command was succesful.
Again, runnung drush updb -y after that worked without problem, but still get the same error after all this when running
drush cr

result:

PHP Fatal error:  Uncaught Error: Class 'Drupal\simple_sitemap\Controller\SimplesitemapController' not found in /app/web/modules/contrib/domain_simple_sitemap/src/Controller/DomainSimpleSitemapController.php:17
Stack trace:
#0 /app/vendor/composer/ClassLoader.php(571): include()
#1 /app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/app/web/module...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\domain_s...')
#3 [internal function]: spl_autoload_call('Drupal\\domain_s...')
#4 /app/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php(136): ReflectionMethod->__construct('\\Drupal\\domain_...', 'getSitemap')
#5 /app/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php(221): Drupal\Core\Entity\EntityResolverManager->setParametersFromReflection(Array, Object(Symfony\Component\Routing\Route))
#6 /app/web/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php(48): Drupal\Core\Entity\EntityResolverManager->setRouteOptions(Object(Symfony\Component\Routing\Route in /app/web/modules/contrib/domain_simple_sitemap/src/Controller/DomainSimpleSitemapController.php on line 17

Fatal error: Uncaught Error: Class 'Drupal\simple_sitemap\Controller\SimplesitemapController' not found in /app/web/modules/contrib/domain_simple_sitemap/src/Controller/DomainSimpleSitemapController.php:17
Stack trace:
#0 /app/vendor/composer/ClassLoader.php(571): include()
#1 /app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/app/web/module...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('Drupal\\domain_s...')
#3 [internal function]: spl_autoload_call('Drupal\\domain_s...')
#4 /app/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php(136): ReflectionMethod->__construct('\\Drupal\\domain_...', 'getSitemap')
#5 /app/web/core/lib/Drupal/Core/Entity/EntityResolverManager.php(221): Drupal\Core\Entity\EntityResolverManager->setParametersFromReflection(Array, Object(Symfony\Component\Routing\Route))
#6 /app/web/core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php(48): Drupal\Core\Entity\EntityResolverManager->setRouteOptions(Object(Symfony\Component\Routing\Route in /app/web/modules/contrib/domain_simple_sitemap/src/Controller/DomainSimpleSitemapController.php on line 17
 [warning] Drush command terminated abnormally.

I visited mysite/core/rebuild.php. It loads, so I guess it does its thing and then I get redirected to the homepage.
I try drush cr again, but still the same error

UPDATE: now that I posted this I can see that the remaining errors are very likely due to the domain_simple_sitemap module.
So for everyone not using that module, which will be most of you, the comment from KCarlile will help you out.

The few others like me must troubleshoot domain_simple_sitemap module instead.

gbyte’s picture

That's correct, these error messages indicate that the domain sitemap module is the culprit. I don't know if the dev version of that module is already compatible with simple sitemap 4.x, you might want to stick to 3.x until it is.

ruslan piskarov’s picture

Newer use "composer update" if no real reason.

For this case better to use

rm -rf web/modules/contrib/simple_sitemap/
git config --global core.ignorecase false
composer install

or

rm -rf web/modules/contrib/simple_sitemap/
git config --global core.ignorecase false
composer require drupal/simple_sitemap
mandosilva’s picture

#17 worked for me. There are files that are named incorrectly which throws error. SimplesitemapController.php to SimpleSitemapController.php

gbyte’s picture

Version: 4.0.0-alpha2 » 4.x-dev

@mandosilva The files are named correctly, it's just git does not update file case changes in certain circumstances. If you removed the files and pulled them again, they would be correct.

caspervoogt’s picture

I have run into this on a few sites I use this module on, and the instructions on this thread helped solve it in all cases but one, just now. In this case I ran into the "..\SimplesitemapController' not found" error even after completely uninstalling the module, removing the module files and reinstalling with Composer (including those git config commands), and re-installing the module. What finally worked was switching from PHP 7 to 8... and I suspect what really solved it was that this is PHP-FPM and it restarted/reloaded itself, which presumably wiped its memory of the past filenames / classes (something alone those lines). So for any who run into this.. restarting/reloading PHP-FPM may be an additional step you need to take.

attheshow’s picture

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

karenann’s picture

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. My local env is a macbook fwiw.

rwam’s picture

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.

en-cc-org’s picture

Same issue, local Windows with Pantheon, upgrading from 3.11 to 4.1.6. #26 worked like a charm for me, thanks @Sutharsan and all who contributed above.

isalmanhaider’s picture

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

2dareis2do’s picture

I am having similar issue when upgrading from 4.1.8 to 4.2.3 version of Simple SItemap, in particular with the submodule

It also looks like support for drupal 9 has been dropped with this minor update?

e.g.

core_version_requirement: ^9.3 || ^10

becomes

core_version_requirement: ^10.3 || ^11

?

Error is SimpleSitemapEnginesForm not found

Reading through the comments it seems like one solution is to use git but I am not sure I understand the logic behind this. Can someone please elaborate?