When I test the result of…
https://www.mywebsite.com/en/sitemap.xml
…I get the following error:
Current context:
Sitemap: Drupal\xmlsitemap\Entity\XmlSitemap Object ( [uri] => [id] => g3XYqcXbSKPVBDODwnT6pq7oqhCFkPryj4vVqrl_Kfc [label] => https://www.mywebsite.com/en/ [chunks] => 1 [links] => 36 [max_filesize] => 5923 [context] => Array ( [language] => en ) [updated] => 1518430117 [originalId:protected] => g3XYqcXbSKPVBDODwnT6pq7oqhCFkPryj4vVqrl_Kfc [status:protected] => 1 [uuid:protected] => c35057ff-5022-4475-80f3-11d62334fc4a [isSyncing:Drupal\Core\Config\Entity\ConfigEntityBase:private] => [isUninstalling:Drupal\Core\Config\Entity\ConfigEntityBase:private] => [langcode:protected] => de [third_party_settings:protected] => Array ( ) [_core:protected] => Array ( ) [trustedData:protected] => [entityTypeId:protected] => xmlsitemap [enforceIsNew:protected] => [typedData:protected] => [cacheContexts:protected] => Array ( [0] => languages:language_interface ) [cacheTags:protected] => Array ( ) [cacheMaxAge:protected] => -1 [_serviceIds:protected] => Array ( ) [dependencies:protected] => Array ( ) )
Chunk: 1
Cache file location: public://xmlsitemap/g3XYqcXbSKPVBDODwnT6pq7oqhCFkPryj4vVqrl_Kfc/1.xml
Cache file exists: Yes
And in the log:
Notice: Undefined variable: context in Drupal\xmlsitemap\Controller\XmlSitemapController->renderSitemapXml() (line 80 of /home/myaccount/www/mywebsite.com/docroot/modules/contrib/xmlsitemap/src/Controller/XmlSitemapController.php) #0 /home/myaccount/www/mywebsite.com/docroot/core/includes/bootstrap.inc(566): _drupal_error_handler_real(8, 'Undefined varia...', '/home/myaccount/...', 80, Array) #1 /home/myaccount/www/mywebsitecom/docroot/modules/contrib/xmlsitemap/src/Controller/XmlSitemapController.php(80): _drupal_error_handler(8, 'Undefined varia...', '/home/myaccount/...', 80, Array) #2 [internal function]: Drupal\xmlsitemap\Controller\XmlSitemapController->renderSitemapXml() #3 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #4 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/Render/Renderer.php(576): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #5 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #6 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #7 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #8 /home/myaccount/www/mywebsite.com/vendor/symfony/http-kernel/HttpKernel.php(153): call_user_func_array(Object(Closure), Array) #9 /home/myaccount/www/mywebsite.com/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #10 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /home/myaccount/www/mywebsite.com/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /home/myaccount/www/mywebsite.com/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/myaccount/www/mywebsite.com/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /home/myaccount/www/mywebsite.com/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #19 {main}.Notice: Undefined variable: context in Drupal\xmlsitemap\Controller\XmlSitemapController->renderSitemapXml() (line 80 of /home/myaccount/www/mywebsite.com/docroot/modules/contrib/xmlsitemap/src/Controller/XmlSitemapController.php) #0 /home/myaccount/www/mywebsite.com/docroot/core/includes/bootstrap.inc(566): _drupal_error_handler_real(8, 'Undefined varia...', '/home/myaccount/...', 80, Array) #1 /home/myaccount/www/mywebsitecom/docroot/modules/contrib/xmlsitemap/src/Controller/XmlSitemapController.php(80): _drupal_error_handler(8, 'Undefined varia...', '/home/myaccount/...', 80, Array) #2 [internal function]: Drupal\xmlsitemap\Controller\XmlSitemapController->renderSitemapXml() #3 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #4 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/Render/Renderer.php(576): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #5 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #6 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #7 [internal function]: Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #8 /home/myaccount/www/mywebsite.com/vendor/symfony/http-kernel/HttpKernel.php(153): call_user_func_array(Object(Closure), Array) #9 /home/myaccount/www/mywebsite.com/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #10 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /home/myaccount/www/mywebsite.com/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /home/myaccount/www/mywebsite.com/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/myaccount/www/mywebsite.com/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /home/myaccount/www/mywebsite.com/docroot/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /home/myaccount/www/mywebsite.com/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #19 {main}.
Comment | File | Size | Author |
---|---|---|---|
#6 | Screen Shot 2019-03-29 at 10.07.17 PM.png | 92.96 KB | gr8tkicks |
Comments
Comment #2
Helrunar CreditAttribution: Helrunar at comm-press commentedPlease deactivate the Developer Mode in your settings (advanced settings) and all should work fine
Comment #3
jmoruziI have the same error. I disabled the Dev module, deleted and created new sitemaps (en and fr) and still have the same error.
XML sitemap 8.x-1.0-alpha2
Drupal 8.4.2
Comment #4
pifagorI cannot create this problem (Drupal 8.4.4). Step by step how to retroduce, and which additional modules are installed on the site.
Comment #5
gr8tkicks CreditAttribution: gr8tkicks as a volunteer and at University of California commentedYeah having same issue here:
I disable DEV and output of errors, and ran the cron (had to up limit to 756megs to get cron to run) , there is about 13940 nodes we are indexing but the cron said the "The sitemaps were regenerated. " so I dont get why the file called sitemap.xml is throwing an error. Especially since isn't suppose to be a static file?
Comment #6
gr8tkicks CreditAttribution: gr8tkicks as a volunteer and at University of California commentedProviding more context please see screenshot in attacked files section.
So it generated roughly 15 XML files along with and index.xml file.
But again when you go and try to load the sitemap.xml file from Drupal at /sitemap.xml the error above occurs. Files are located in docroot/sites/default/files/sitemap/HASH/...
Comment #7
Dave ReidIt appears you have the 'Developer mode' enabled, which shows you debugging information when requesting the sitemap path, instead of the actual content. If you disable this setting in the XML sitemap module settings, it should work as expected.