sitemap-module icon indicating copy to clipboard operation
sitemap-module copied to clipboard

"Couldn't fetch" error on Google Search Console

Open emretepedev opened this issue 2 years ago • 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/[email protected] @nuxtjs/[email protected] [email protected]

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

emretepedev avatar Feb 14 '22 02:02 emretepedev

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

florian-lefebvre avatar Feb 17 '22 18:02 florian-lefebvre

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.

victorcngo avatar Feb 17 '22 18:02 victorcngo

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.

jnawaz avatar Mar 20 '22 13:03 jnawaz

any updates? btw I deployed my site on GitHub pages.

emretepedev avatar Mar 25 '22 00:03 emretepedev

+1 can't fetch my sitemap

Matb85 avatar Sep 11 '22 19:09 Matb85

I am also experiencing this issue. Any update?

zoltalar avatar Oct 28 '22 13:10 zoltalar

same here........

dadasmash avatar Nov 15 '22 07:11 dadasmash

we are having the same problem!

simonmaass avatar Nov 21 '22 10:11 simonmaass

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

lArtiquel avatar Jan 29 '23 12:01 lArtiquel

still got the same problem aswell...

simonmaass avatar Jan 31 '23 11:01 simonmaass

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

tha80 avatar Feb 01 '23 14:02 tha80

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?

lArtiquel avatar Feb 01 '23 14:02 lArtiquel

@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).

tha80 avatar Feb 01 '23 15:02 tha80

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?

nblkmal avatar Feb 18 '24 03:02 nblkmal