Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Couldn't fetch" error on Google Search Console #240

Open
emretepedev opened this issue Feb 14, 2022 · 14 comments
Open

"Couldn't fetch" error on Google Search Console #240

emretepedev opened this issue Feb 14, 2022 · 14 comments

Comments

@emretepedev
Copy link

emretepedev commented Feb 14, 2022

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
@florian-lefebvre
Copy link

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

@victorcngo
Copy link

victorcngo commented Feb 17, 2022

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.

@jnawaz
Copy link

jnawaz commented Mar 20, 2022

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.

@Matb85
Copy link

Matb85 commented Sep 11, 2022

+1 can't fetch my sitemap

@zoltalar
Copy link

I am also experiencing this issue. Any update?

@dadasmash
Copy link

same here........

@simonmaass
Copy link

we are having the same problem!

@lArtiquel
Copy link

lArtiquel commented Jan 29, 2023

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

@simonmaass
Copy link

still got the same problem aswell...

@tha80
Copy link

tha80 commented Feb 1, 2023

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

@lArtiquel
Copy link

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
Copy link

tha80 commented Feb 1, 2023

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

@nblkmal
Copy link

nblkmal commented Feb 18, 2024

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?

@ebanDev
Copy link

ebanDev commented May 13, 2024

Hi ! I have the same issue :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests