Closed (fixed)
Project:
XML sitemap
Version:
8.x-1.x-dev
Component:
xmlsitemap.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2019 at 07:52 UTC
Updated:
18 Jun 2020 at 20:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
spadxiii commentedComment #3
dave reidThe Drush commands should be already using drush_backend_batch_process() in src/Commands/XmlSitemapCommands.php. What command are you running? Can you maybe provide some verbose output of the command?
Comment #4
dave reidActually looks like we need to make this change to allow it to work with Drush 10.
Comment #5
spadxiii commentedI was using 'drush cron', so not a specific drush command for regeneration.
I'll check that change coming week to see if that also works.
Comment #6
dave reidI would be curious why an unprogressive batch is failling when being run in Drush. I would not expect it to fail at all. I'm going to commit #4 in the meantime since we do want to enable Drush 10 support for our custom commands.
Comment #8
dave reidComment #9
alfattal commentedI'm having the same issue. The cron job fail to run even from the admin UI. Error
message returned when running cron with drush:
[error] InvalidArgumentException: Route required in Drupal\Core\Url::fromRouteMatch() (line 159 of /mnt/www/html/mndordev/docroot/core/lib/Drupal/Core/Url.php).
Update: Downgrading to Drush 9.7.2 did solve the problem until recently. I've noticed that the cron jod is returning the same error message with the XML sitemap not been updated.
Comment #10
oheller commentedI'm having a similar issue. My sitemap isn't being regenerated when I run cron from Drush 10:
```
drush cron
[notice] Starting execution of acquia_connector_cron().
[notice] Starting execution of captcha_cron(), execution of acquia_connector_cron() took 0.04ms.
[notice] Starting execution of field_cron(), execution of captcha_cron() took 1.32ms.
[notice] Starting execution of file_cron(), execution of field_cron() took 0.47ms.
[notice] Starting execution of history_cron(), execution of file_cron() took 40.46ms.
[notice] Starting execution of layout_builder_cron(), execution of history_cron() took 0.71ms.
[notice] Starting execution of lightning_scheduler_cron(), execution of layout_builder_cron() took 9.11ms.
[notice] Starting execution of node_cron(), execution of lightning_scheduler_cron() took 19.6ms.
[notice] Starting execution of purge_processor_cron_cron(), execution of node_cron() took 0.02ms.
[notice] Starting execution of search_api_cron(), execution of purge_processor_cron_cron() took 102.92ms.
[notice] Starting execution of search_api_solr_cron(), execution of search_api_cron() took 23.07ms.
[notice] Starting execution of simple_oauth_cron(), execution of search_api_solr_cron() took 0.34ms.
[notice] Starting execution of system_cron(), execution of simple_oauth_cron() took 4.64ms.
[notice] Starting execution of webform_cron(), execution of system_cron() took 35.25ms.
[notice] Starting execution of xmlsitemap_engines_cron(), execution of webform_cron() took 10.65ms.
[notice] Starting execution of xmlsitemap_cron(), execution of xmlsitemap_engines_cron() took 0.33ms.
[notice] Execution of xmlsitemap_cron() took 0.31ms.
[notice] Cron run completed.
```
I'm using:
Drupal 8.8.1
Apache 2.4.18 (Ubuntu)
php 7.2
db 5.7.28
drush 10.1.1
Vagrant/blt
drupal/xmlsitemap:1.x-dev
drupal/xmlsitemap:8.x-1.0-rc1
I've set the minimum time to none, and disable cron generation is off. Dev mode is off.
I have a around 3000 aliased urls. To test I've been deleting all the aliases or generating the aliases.
By turning dev mode on I get the `InvalidArgumentException: Route required in Drupal\Core\Url::fromRouteMatch() (line 159 of /var/www/mndor/docroot/core/lib/Drupal/Core/Url.php).` error. After running cron manually from the UI, this error goes away, but the sitemap still isn't updated.
I've only been running `drush cron` in attempt to update the sitemap because I have a number of other functions tied to cron.
Comment #11
pookmish commentedI've encountered this same error with Drush 9.7.2, Drupal 8.8.4.
The patch in #2 solved it for me.
Comment #12
alfattal commented@pookmish The patch in #2 stopped the error message from showing, but it did not resolve the problem. When running
drush cron, I can see that it's successful, the same applies when running the cron job from the Admin UI. But, when checking the sitemap.xml file, it was not updated. Can you confirm that it's been updated in your case?Comment #13
pookmish commented@alfattal I just double checked and it does indeed update the sitemap.xml for me. I had two separate scenarios:
Comment #14
alfattal commented@pookmish Thank you for your response. That's indeed interesting. Wonder what that is conflicting with the cron job on my site. Any idea where to dig?!
Comment #15
bvoynickAfter updating Drupal Core (8.7.x -> 8.8.5) and xmlsitemap to rc1, I encountered the same issue when running "drush cron". Drush 9.7.2 (was 9.7.1 I believe.)
#2 worked for me as well. No more error, and on the next regeneration I see a new custom link that hadn't shown up previously.
Comment #16
marcoscanoHere's a screenshot of the stack trace when the problem happens, in case it's helpful.
I'm running just
drush cron, and this environment is on:- Drupal 8.8.5
- drupal/xmlsitemap: dev-1.x#379953245cba320e98100424e0ccb0d726105f7f
- Drush 9.7.2
I can confirm patch #2 makes the error go away.
Comment #17
alfattal commented@marcoscano In my case, patch #2 fixed the error message when running
drush cron, but it didn't update the sitemap.xml file. I have to rundrush xmlsitemap:regenerateto update the sitemapUpdate: It turns out that the Minimum sitemap lifetime was set to (1 day) the default settings, which is why the sitemap.xml file was not being updated when I run drush cron. Setting it to (No minimum), I was able to execute the cron job successfully with no errors and update the sitemap.
I confirm that patch in #2 solved the issue for me.
My environment is on:
- Drupal core 8.8.5
- drupal/xmlsitemap: 8.x-1.0-rc1
- Drush: 9.7.2
Comment #18
didier misson commentedsame error
D8.7.13
With Drush 9.7.1, "drush cron" run correctly.
After upgrading Drush to 9.7.2, "drush cron" give the same error :
[notice] Starting execution of scheduler_cron(), execution of node_cron() took 5.91ms.
[notice] Starting execution of search_cron(), execution of scheduler_cron() took 4.27ms.
[notice] Starting execution of simple_sitemap_cron(), execution of search_cron() took 5.81ms.
[error] InvalidArgumentException: Route required in Drupal\Core\Url::fromRouteMatch() (line 158 of /home/mysite/public_html/thunder/docroot/core/lib/Drupal/Core/Url.php).
[notice] Starting execution of system_cron(), execution of simple_sitemap_cron() took 17.16ms.
[notice] Starting execution of update_cron(), execution of system_cron() took 5.36ms.
[notice] Execution of update_cron() took 11.61ms.
I restore the vendor/drush folder to drush 9.7.1, and drush cron is correct.
Why ?
Thanks
Comment #19
nevergonePatch #2 tested and works well!
Comment #20
ytsurkIf patch #2 applies you're not using the latest version.This is fixed in RC1. Make sure to regenerate the sitemap (
drush xmlsitemap:regenerate) to make the error disappear.Comment #21
pookmish commented@ytsurk
This is incorrect. The patch can be applied to the latest RC1 version and I have done so with several use cases.
This is not fixed in RC1. The issue reported is not about the drush xmlsitemap:regenerate command. The module should function without the need to run the drush command. It should function 100% via cron.
Comment #22
pookmish commentedComment #23
ytsurkYou're right .. I did not look good enough, the patch applies. Sorry for the confusion.
For me, regeneration of the sitemap via UI or drush made the error disappear, when running drush cron afterwards. So no need for a code change, IMO.
Maybe an update hook could regenerate the sitemap to solve it for all.
And the question remains, is the sitemap updated via cron or not - this needs investigation .. so you say the patch makes the sitemap updating again?
Comment #24
dave reidOkay I understand the issue now is running the drush cron command. Re-rolled #2 with simplifying dependencies and removing the need for the bridge test assertions since Drupal 8.8 requires at least PHPUnit 6+.
Comment #25
dave reidThis should fix the test failures.
Comment #27
dave reidTested and committed #25 to 8.x-1.x: