nuxt-community/sitemap-module

"Couldn't fetch" error on Google Search Console

emretepedev opened this issue · 14 comments

Description

I am able to add @nuxtjs/sitemap with nuxt and works like a charm.
image

Now I am trying to add sitemap to the Google Search Console. But it failed with an error "Couldn't fetch".
image

If I click details, Google says "Sitemap could not be read."
image

Expected behavior

Since @nuxtjs/sitemap has been added to my website, associating sitemap on Google Search Console also must work.

Actual behavior

I got the errors on Google Search Console. ("Sitemap could not be read" or "Couldn't fetch")

Environment

@nuxtjs/sitemap@2.4.0
@nuxtjs/robots@2.5.0
nuxt@2.15.8

Extra

My installation snippet in "nuxt.config.js"

{
// ...
  modules: [
    '@nuxtjs/sitemap',
    '@nuxtjs/robots',
  ],

  sitemap: {
    hostname: process.env.PROJECT_URL,
    gzip: true,
    trailingSlash: false,
    cacheTime: 1000 * 60 * 15,
    defaults: {
      changefreq: 'monthly',
      priority: 0.5,
      lastmod: new Date(),
    }
  },

  robots: [
    {
      UserAgent: '*',
      Allow: '/',
    },
    {
      Sitemap: process.env.PROJECT_URL + '/sitemap.xml',
    },
  ],
// ...
}

And my robots.txt file contains that:

User-agent: *
Allow: /
Sitemap: <MY_PROJECT_URL>/sitemap.xml

I'm encountering the same issue, my sitemap hadn't been fetched since February 16th. Using Nuxt 2 universal static

same issue here! just can't fetch my sitemap at all (using Nuxt 2 in SSG just like @florian-lefebvre). only difference is that i created my sitemap with a sitemap generator and put it in /static folder.

I'm also experiencing issues with the sitemap module in relation to a production site.

When I run locally I can view the sitemap.xml, however publishing to AWS amplify and trying to access the production /sitemap.xml I get redirected to the homepage.

I'm still investigating if there is anything I can do to prevent the redirect to the homepage. However seeing the same issues with Google search console.

Happy to provide further info if it helps

Update: I managed to get it working in production. I had to amend the redirects and rewrites to allow xml. Once I had updated this, the sitemap worked and Google search console shows it as successfully processed.

+1 can't fetch my sitemap

I am also experiencing this issue. Any update?

same here........

we are having the same problem!

Still Google says that he can't fetch sitemap... Even thru it's accessible in the browser. Can't figure out why. Tried to validate sitemap using tools - it's valid XML.
image

still got the same problem aswell...

tha80 commented

Me too. And no clue why... Help would be very appreciated.

I've posted a question on StackOverflow and described this issue more in details.

Btw, does s-one have already checked servers access logs? Does GoogleBot really hits the website endpoint when it says that it cannot fetch the sitemap?

tha80 commented

@lArtiquel: Yes, I checked. Google does actually hit my server directly after submitting the sitemap.xml url. And the response from the server also looked fine (status code 200, valid headers, correct size, etc.).

So from my point of view "Can't fetch" is definitely wrong. Maybe it's that Google for some other unknown reasons doesn't like the sitemap or the response from the server. Or it's just a bug in the search console itself. At least a lot of people are reporting the same thing in various forums and groups (with various other frameworks and servers).

I'm also experiencing issues with the sitemap module in relation to a production site.
When I run locally I can view the sitemap.xml, however publishing to AWS amplify and trying to access the production /sitemap.xml I get redirected to the homepage.
I'm still investigating if there is anything I can do to prevent the redirect to the homepage. However seeing the same issues with Google search console.
Happy to provide further info if it helps

Update: I managed to get it working in production. I had to amend the redirects and rewrites to allow xml. Once I had updated this, the sitemap worked and Google search console shows it as successfully processed.

Hi can you show example on your workaround?