Den här artikeln finns för närvarande bara på engelska.

Start tag expected, '<' not found: your feed URL isn't returning XML

FeedAwake 4 min läsning

An XML document has to start with <: either the <?xml …?> declaration or the root element. This error means the parser opened the response and the first thing it found was something else. It almost always appears on line 1, column 1, and it almost never means the feed has a typo. It means the feed URL didn't return the feed.

What the error looks like

Chrome, Edge:   error on line 1 at column 1: Start tag expected, '<' not found
PHP, lxml:      Start tag expected, '<' not found
                Document is empty
Firefox:        XML Parsing Error: syntax error
                XML Parsing Error: no root element found
Python:         syntax error: line 1, column 0
                not well-formed (invalid token): line 1, column 0
                no element found: line 1, column 0

Older versions of libxml2, still common on PHP servers, report a response that isn't XML as "Document is empty" even when it has content. Chrome and newer libxml2 versions say "Start tag expected". Firefox and Python's built-in parser use expat: "no element found" or "no root element found" means the response was empty, "syntax error" or "not well-formed" means it contained something that isn't XML.

See what the URL actually returns

Don't guess, look. Open the feed URL in a private browser window, or better, run:

curl -s -D - "https://shop.example/feed.xml" | head -c 600

This prints the HTTP status, the headers and the start of the body. Then match it to one of the cases below.

The five usual causes

1. A JSON error from an API or plugin endpoint

{"error":"Unauthorized"}

Feeds served by an app, a plugin's REST endpoint or a feed service often answer with JSON when something is wrong: an expired token or API key in the URL, a deleted feed, a plan that ran out, a renamed route. Read the message: it usually says which.

2. A plain-text error page

Error establishing a database connection

Database errors, "Too Many Requests", "Access denied" or a maintenance message, served as plain text. If the feed works when you open it but channels get this, the server may be treating automated requests differently: rate limits, a firewall rule or bot protection that blocks the crawler's IP or user agent.

3. An empty response

The export failed and left a 0-byte file, or the script crashed before writing anything and the server still answered "200 OK". Check the file size and the export's log. Empty files often come from exports that run out of memory or time on large catalogues.

4. A CSV file where XML is expected

id,title,description,link,price

The URL points to a CSV or TSV export, but the tool reading it was set up for XML. Either change the feed type in that tool or point it at the XML export.

5. A compressed file without the right header

If the server sends a gzip file (feed.xml.gz, or compressed bytes without a Content-Encoding: gzip header), the parser sees binary data. PHP's libxml2 reports "Document is empty", Chrome reports "Encoding error". Serve the plain file, or serve the compressed one with the correct header so clients decompress it.

When the response is HTML

A login page, a "403 Forbidden" page or a bot-protection challenge is HTML, which starts with <. So it usually doesn't cause this error at all: it either fails with a different XML error or parses as a document with zero products. If Merchant Center suddenly reports no items, check for that case too. This guide covers it.

Check it like a channel does

The free feed checker downloads the feed URL the way a channel would and tells you what came back: the HTTP status, a parse error with its position, or a valid file with no products in it.

This error is usually intermittent: a token that expires, a database that's down for ten minutes, a rate limit that only hits at night. FeedAwake checks the feed on a schedule and alerts you by email, Telegram, Slack or Discord when the URL stops returning a readable feed, with what it returned instead.

Kontrollera ditt produktflöde gratis

Hitta flödesfel innan de kostar dig annonsbudget. Inget konto behövs.

Starta din kostnadsfria provperiod på 14 dagar Gratis Merchant Center-granskning

Fler artiklar