Skip to main content
Documentation

My sitemap check is failing

An incident on a sitemap check is headed Sitemap check failing, and the line under it names the failure. This page covers the four failures. Broken pages inside a valid sitemap never open an incident. They are listed in the Sitemap card on the domain's Checks tab and in the daily summary email, described in About sitemap checks.

Sitemap unreachable

What you see

The incident reads Sitemap check failing, with the message Sitemap <address> could not be fetched: <reason>. The reason is either HTTP and a status code, such as HTTP 404, or a description of what went wrong with the connection. Alopex follows up to 5 redirects, so the status is the one at the end of them.

Likely causes

  • The sitemap has moved or been deleted, which gives a 404.
  • The server is failing or is down. Codes from 500 to 599 usually mean this.
  • A firewall or bot protection blocks the user agent Alopex/1.0 (+uptime monitor). A 401 or 403 can mean this.
  • The server took more than 10 seconds to answer.
  • The address redirects in a loop, or resolves to a non-public address.

How to check

Request the sitemap as Alopex does and read the status:

curl -sL -o /dev/null -w "%{http_code}\n" -A "Alopex/1.0 (+uptime monitor)" <sitemap-address>

Compare it with the address in the failure message and with the list under Sitemap URLs. Open the check from the Checks tab and choose Edit.

How to fix

  • If the address is wrong, correct it in Sitemap URLs. The check runs again straight away.
  • If the server is failing, fix it. The check recovers on its own once a run passes.
  • If a firewall blocks Alopex, allow the user agent Alopex/1.0 (+uptime monitor) for the sitemap. In your firewall, CDN or bot protection, add a rule that lets through requests whose User-Agent header contains that value, for the sitemap address and for the pages it lists. The wording differs between products, so use the product's own documentation for custom or allow rules. Requests come from a single location in the UK, and Alopex does not publish IP addresses, so an IP allow list is not an option.
  • If the sitemap is slow to build, serve a cached copy so it answers within 10 seconds.

Sitemap is not valid

What you see

The incident reads Sitemap check failing, with a message that names the sitemap and the problem:

MessageWhat it means
Sitemap <address> is not well-formed XML.The answer is not XML, or the XML is broken.
Sitemap <address> has an unexpected root element <name>.It is XML, but not a sitemap. A sitemap starts with urlset, and a sitemap index with sitemapindex.
Sitemap <address> is empty.The answer had no content.
Sitemap <address> is not valid gzip.The file looks compressed, but cannot be unpacked.
Sitemap <address> declares a DOCTYPE, which is not allowed.The file has a document type declaration. Alopex refuses these.
Sitemap <address> is an index inside an index.A sitemap index lists another index. Alopex follows one level only.

Likely causes

  • The address returns an HTML page with a 200 status, such as an error page, a login page or a "not found" page, instead of the sitemap. The root element is then html.
  • The generator wrote a file that was cut short or contains a character XML does not allow.
  • The file was compressed twice, or compressed and served with the wrong type.
  • A generator or plugin added a DOCTYPE, or nested one index inside another.

How to check

Fetch the sitemap and test that it is well-formed XML:

curl -sL --compressed -A "Alopex/1.0 (+uptime monitor)" <sitemap-address> | xmllint --noout -

No output means it is well-formed. For a .gz file, unpack it first:

curl -sL -A "Alopex/1.0 (+uptime monitor)" <sitemap-address> | gunzip -c | xmllint --noout -

Look at the first few lines of the file with head to see what the server really returns.

How to fix

  • Fix the generator so that it writes a complete, well-formed sitemap, and make the address always answer with it.
  • Remove any DOCTYPE from the file.
  • List each child sitemap directly in Sitemap URLs if an index lists another index.
  • The check recovers on its own once a run passes.

Sitemap lists no URLs

What you see

The incident reads Sitemap check failing, with the message The sitemap lists no URLs. The sitemaps could be fetched and are valid, but none of them listed a URL.

Likely causes

  • The generator ran and found nothing to list, for example after a cache was cleared or a database query failed.
  • A filter or setting excludes every page.
  • The site is in maintenance mode and serves an empty sitemap.
  • The sitemaps you listed are indexes whose child sitemaps are all empty.

How to check

Count the URLs the sitemap lists:

curl -sL --compressed -A "Alopex/1.0 (+uptime monitor)" <sitemap-address> | grep -o "<loc>" | wc -l

For a sitemap index, count in each child sitemap, because the index lists sitemaps and not pages. The command counts every <loc> element, so a sitemap that also lists images or videos can give a larger number than Alopex's count of pages.

How to fix

  • Regenerate the sitemap, and fix whatever left it empty.
  • The check recovers on its own once a run lists at least one URL.

Sitemap shrank sharply

What you see

The incident reads Sitemap check failing, with a message such as Sitemap lists 120 URLs, down from about 400. The first number is how many URLs the sitemaps list now. The second is the usual size, the median of the last 24 successful runs. A run fails when it lists fewer than half of the usual size. The Sitemap card on the Checks tab shows Was 400 URLs, now 120.

Likely causes

  • You removed a large amount of content on purpose, and the sitemap now correctly lists less.
  • The generator is only partly working. It may list only the first page of results, or only some content types.
  • A cache or a database problem hides part of the content from the generator.

How to check

  1. Count the URLs the sitemap lists now, as in the command under Sitemap lists no URLs.
  2. Compare the count with the number of pages you expect the site to have.

How to fix

  • If the smaller sitemap is right, select Accept new size in the Sitemap card on the Checks tab. You need permission to edit the domain. Alopex runs the check again at once and judges it against the new size, so it passes.
  • If the sitemap should be larger, fix the generator. The check recovers by itself at the next run that lists enough URLs.