Active
Project:
XML sitemap
Version:
8.x-1.x-dev
Component:
xmlsitemap.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2021 at 09:28 UTC
Updated:
27 Jun 2025 at 19:54 UTC
Jump to comment: Most recent


Comments
Comment #2
nravens commentedI have the same issue. Have you found the cause and solution?
Comment #3
ankithashettyHey @nravens, sorry, I didn't find the cause of this issue.
But to make this work, I went to
/admin/config/search/xmlsitemap/settingsand checkedDisable cron generation of sitemap files..Then I set up crontab on my system, something like this
0 2 * * * /usr/bin/drush -r /var/www/html/drupal_test_site/ xmlsitemap:regenerate >> /home/ubuntu/drupal_test_site-cron.log 2>&1. This will execute the drush command every day at 2:00.This seems to work for me, might as well give it a try?
Thanks!
Comment #4
cebab54 commentedI have the same problem. But I think the isse is to expose the sitemap fields used to the anonymous user. It certainly overcame access to robotstxt module becoming exposed to search consoles at Bing and Google
Comment #5
loopy1492 commentedOddly, our site was also not regenerating the xml sitemap during drupal's cron. Here's the correct crons for an Acquia Next site:
Default schedueld task:
```
/usr/local/bin/cron-wrapper.sh site.environment https://yoursite.com &>> /shared/logs/default-drush-cron.log
```
xml sitemap regeneration scheduled task:
```
cd /var/www/html/${AH_SITE_NAME}/docroot && drush xmlsitemap:regenerate &>> /shared/logs/xmlsitemap.log
```
Edit: markdown when, drupal.org?
Comment #6
binnythomas commentedI am facing the same issue on the site. However it only occurs intermittently and very difficult to reproduce and ascertain the root cause.
Comment #7
freelockWe also see this on a site with > 50K links. Sometimes it generates 3 sitemap pages with exactly 10K links each, sometimes 2, sometimes none. When run manually from drush, it generates 6 pages, the first 5 10K links and the remainder on the 6th. But doing this today took 1 hour 24 minutes to complete...
We might try the workaround suggested -- disabling the cron generation and adding our own drush cron job... or give simple_sitemap a try.
Comment #8
piotr pakulskiI'm also experiencing that cron is not reliable. In my case when I unpublished some node in EN language, in meantime cron regenerated the sitemap then I unpublished the other language version of the same node, then the cron simply did not include that change into the other language sitemap. Walk-around will be setting cron drush command to rebuild the sitemap. I do not want invest more time into investigating that.
Comment #9
dalinNote that you can adjust at
/admin/config/search/xmlsitemap/settings
I set it to process only 50 items at once rather than the default 100, and it now successfully completes.
Comment #10
dalinActually, that wasn't working reliably. But throwing this into a custom module seems to be working:
I wonder if we should roll this into the module as an option:
* Run as a normal cron hook
* Run as an asynchronous cron hook (requires drush)
* Don't run during cron