Sitemap-posts.xml and sitemap-tags.xml is missing

Hi all,

My site is hosted on DigitalOcean and it is accessible through: https://norbis.hu

I’ve modified the routes.yaml file to include the primary tag before the slug, and to remove the “tag” word from the URLs. I haven’t modified anything else.
After this update both sitemap-posts.xml and sitemap-tags.xml disappeared from the sitemap.

Even after reverting back to the original routes.yaml and restarting ghost the issue still remains.

Please help!

Thanks,
Norbert

Version: 5.46.1
Theme: slightly modified version of Taste 1.0.0 (just basic customization, and language settings, etc.)


1 Like

Any update reg this issue?

I don’t specifically have a route for sitemap but still can access it on /sitemap.xml. Can you try the same?

1 Like
http https://norbis.hu/sitemap.xml

Doesn’t load for me. Maybe the site is down now.

@Kevin I was considering adding a new automated test to see if this sitemap issue appears in the Git version of Ghost, but npm install fails to resolve an ancient version of the knex dep, a sub-dep of bookshelf.

Could you rm -rf node_modules && npm install and see if you can reproduce?

❯ npm install && npm test
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ghost@5.52.3
npm ERR! Found: knex@2.4.2
npm ERR! node_modules/knex
npm ERR!   knex@"2.4.2" from ghost@5.52.3
npm ERR!   ghost/core
npm ERR!     ghost@5.52.3
npm ERR!     node_modules/ghost
npm ERR!       workspace ghost/core from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer knex@">=0.15.0 <0.22.0" from bookshelf@1.2.0
npm ERR! node_modules/bookshelf
npm ERR!   bookshelf@"1.2.0" from ghost@5.52.3
npm ERR!   ghost/core
npm ERR!     ghost@5.52.3
npm ERR!     node_modules/ghost
npm ERR!       workspace ghost/core from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/mark/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mark/.npm/_logs/2023-06-21T19_40_51_437Z-debug-0.log

The root cause appears to be that “bookshelf” is no longer maintained. Some people have resorted to using forks that bump the bad Knox dep: BB-731: Update knex to v2.4.2 by kellnerd · Pull Request #303 · metabrainz/bookbrainz-data-js · GitHub

Bad news is that there may be no maintained drop-in replacement for Bookshelf.js:

Looks like newer projects are choosing alternatives like Sequelize instead. https://sequelize.org/

Ugh, never a fun situation to be in for a big project.

@markstos Ghost uses yarn not npm, if you use the latter you’ll get incorrect dependency versions because it won’t be using the project’s yarn.lock file

1 Like

@Norbert I tried the latest code from Git and the issue does not exist there:

❯ http :2368/sitemap.xml
HTTP/1.1 200 OK
Cache-Control: public, max-age=3600
Connection: keep-alive
Content-Length: 638
Content-Type: text/xml; charset=utf-8
Date: Wed, 21 Jun 2023 20:05:20 GMT
ETag: W/"27e-WdsLooPejpFSmkVl5xpyXewBObU"
Keep-Alive: timeout=5
Vary: Accept-Encoding
X-Powered-By: Express

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="//localhost:2368/sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>http://localhost:2368/sitemap-pages.xml</loc>
    <lastmod>2023-06-21T20:01:57.688Z</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://localhost:2368/sitemap-posts.xml</loc>
    <lastmod>2023-06-21T19:59:37.000Z</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://localhost:2368/sitemap-authors.xml</loc>
    <lastmod>2023-06-21T19:59:37.000Z</lastmod>
  </sitemap>
  <sitemap>
    <loc>http://localhost:2368/sitemap-tags.xml</loc>
    <lastmod>2023-06-21T19:59:37.000Z</lastmod>
  </sitemap>
</sitemapindex>

Further, I found there’s an automated test to make sure that the sitemap.xml links to sitemap-posts.xml. Also, I found no evidence in git this area of the code was changed recently. That test was added 5 years ago.

So, there’s something about your particular customizations that may be triggering the issue. Consider switching temporarily to a default theme like Casper to see if you can still trigger the issue, then switch back to your current theme.

OK, I see you are using the Taste theme and I don’t see that the Taste them or any of the default themes seem to touch sitemap code.

Maybe your routes.yml customizations are somehow related.