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?
Comments
Comment #2
gbyte4.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 updband thendrush 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.
Comment #3
kanaan.ngutu commentedI 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.
Comment #4
gbyte@kanaan.ngutu Did you try my other suggestions?
Comment #5
kanaan.ngutu commented@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..?
Comment #6
kanaan.ngutu commenteddrush 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)
Comment #7
gbyte@kanaan.ngutu
Please try the cache rebuild script.
Comment #8
kanaan.ngutu commented@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)
Comment #9
gbyteFor the third time though, did you try and run the cache rebuild script by visiting core/rebuild.php?
Comment #10
kanaan.ngutu commented@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.
Comment #11
gbyteI 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.)
Comment #12
kanaan.ngutu commentedI 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)
Comment #13
gbyteOK 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
Comment #14
mattbloomfield commentedI'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.
Comment #15
mattbloomfield commentedSo the update seems to work no problem in D9. D8 throws the error and nothing seems to be able to resolve it.
Comment #16
narinlab commentedI'm also experiencing the exact same issue, on CPANEL hosting:
when running drush updb :(
Comment #17
narinlab commentedI 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.
Comment #18
gbyte@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?
Comment #19
mattbloomfield commented@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.
Comment #20
narinlab commentedI'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.
Comment #21
gbyteWindows 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?
Comment #22
narinlab commentedOn 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.
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.
Comment #23
narinlab commentedAfter 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.
Comment #24
gbyteClosing this support ticket as the issue has been identified.
Comment #26
sutharsan commentedI 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:
Comment #27
greatmatter commentedThis shouldn't be closed/fixed. The cases are wrong on the distribution version.
THANK YOU to @narinlab.
Comment #28
gbyte@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?
Comment #29
greatmatter commented@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
Comment #30
KCarlile commentedI 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:
Comment #31
flyke commentedI have the same problem / error on Drupal 8.9 after updating simple_sitemap like this:
And this works: composer successfully updates simple_sitemap, and also: the
drush updb -ycommand works.But if I then want to clear caches:
drush crI 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:17So I did what was suggested above:
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 updatecommand was succesful.Again, runnung
drush updb -yafter that worked without problem, but still get the same error after all this when runningdrush crresult:
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 cragain, but still the same errorUPDATE: 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.
Comment #32
gbyteThat'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.
Comment #33
ruslan piskarovNewer use "composer update" if no real reason.
For this case better to use
or
Comment #34
mandosilva commented#17 worked for me. There are files that are named incorrectly which throws error. SimplesitemapController.php to SimpleSitemapController.php
Comment #35
gbyte@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.
Comment #36
caspervoogt commentedI 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.
Comment #37
attheshow commentedComment #30 was very helpful for me when trying to fix this issue on Pantheon. Thanks @KCarlile!
Comment #38
karenann commentedI 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 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.
Comment #39
rwam commentedSame 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:
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.
Comment #40
en-cc-org commentedSame 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.
Comment #41
isalmanhaider commented#38 worked both on local and acquia!
this was a real blocker for us in upgrading to D10
Comment #42
2dareis2do commentedI 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 foundReading 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?