In short
PageSpeed fetches /robots.txt and flags lines it can't parse, and a server error (5xx) when fetching the file. It lists each bad line with the line number. Fix typos, put every rule under a User-agent line, and use full URLs for Sitemap. Note that Lighthouse treats directives it doesn't recognize as errors, so experimental lines (for example an Agentmap: line for AI agents) can make this check fail.
In passed form: "robots.txt is valid."
A 404 for robots.txt is fine (it means "no rules"); a 5xx is not, because Google may stop crawling.
The Semrush robots.txt article in this blog covers syntax in detail.
This guide isn't affiliated with or endorsed by Google.
Related issues
Sources and references
Chrome for Developers, robots.txt is not valid
Google Search Central, How Google interprets the robots.txt specification

About the author
Nazmul Nikhil
Head of SEO & Assistant Manager, Digital Marketing at Notionhive
SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.



