HTTP 412 Precondition Failed
A condition the client attached to the request, such as If-Match, was not true, so the server did not carry the request out.
Check a URL for HTTP 412
Paste any URL to see whether it currently returns 412. Runs a live HTTP probe and follows redirects.
TL;DR
412 means "the thing you are changing is no longer the version you think it is". Fetch it again to get the current version, then repeat the request with the new value.
What does HTTP 412 mean?
HTTP 412 Precondition Failed is returned when a request includes a conditional header and the condition does not hold. The most common use is safe updating: the client sends If-Match with the version it last saw, and the server only applies the change if that is still the current version. If someone else changed the resource first, the server answers 412 instead of overwriting their work.
Common Causes
- •An If-Match header carrying an ETag that no longer matches the resource
- •An If-Unmodified-Since date earlier than the resource's last change
- •If-None-Match: * on a create request when the resource already exists
- •A proxy or CDN changing or stripping ETags so they never match
How to Fix It
- 1.Fetch the resource again and read its current ETag
- 2.Reapply your change to the fresh copy and resend with the new ETag in If-Match
- 3.If ETags never match, check whether a proxy or compression layer is rewriting them, for example turning strong ETags into weak ones
- 4.If you do not need the safeguard, remove the conditional header, accepting that the last write wins
SEO Impact
Search engines do not send the conditional headers that produce 412, so it rarely affects crawling. If a public page does return it, it is treated like any other 4xx and the page will not be indexed.
Frequently Asked Questions about HTTP 412
What is the difference between 412 and 409?
412 is returned when a condition the client itself sent in a header fails. 409 is the server reporting a clash on its own initiative. APIs that use ETags for safe updates use 412. Others tend to use 409.
Related Status Codes
Free Website Tools
Check your site for common issues that cause HTTP errors: