--- title: "412 Precondition Failed — what it means and how to fix it" description: "A condition the client attached to the request was not true, so the server did nothing. What causes an HTTP 412, what to try as a visitor, and what to check if it is your own site." url: https://atoneplace.net/error/412/ site: "At One Place" --- # HTTP 412 — Precondition Failed **HTTP 412: Precondition Failed** A condition the client attached to the request was not true, so the server did nothing. ## What 412 actually means The client said "only do this if…" using `If-Match`, `If-Unmodified-Since` or `If-None-Match`, and the condition turned out false. It is the safety mechanism behind optimistic concurrency: you send the ETag of the version you edited, and if someone else has changed the resource in the meantime, the server refuses rather than overwriting their work. Importantly, nothing was modified — a 412 is always a clean no-op. ## Common causes - An `If-Match` ETag that no longer matches the current version - An `If-Unmodified-Since` date earlier than the resource's last change - A conditional PUT losing a race with another writer - A cache revalidating against an ETag that changed ## If you're just trying to view the page 1. Reload to fetch the latest version and reapply your change 2. If a sync client keeps failing this way, force a full refresh of its local copy ## If it's your site 1. This is the expected outcome of a concurrency check, not a bug — handle it by re-fetching and retrying, or by showing the user a merge 2. Make sure ETags are stable across your server fleet; inconsistent ETags cause spurious 412s behind load balancers 3. Distinguish it from 409 in your API: 412 means the client's explicit precondition failed, 409 means state conflicts more generally ## Reference - **Status code:** 412 - **Reason phrase:** Precondition Failed - **Category:** 4xx — Client Error - **Defined in:** RFC 9110 §15.5.13 ## Common questions ### What does HTTP 412 mean? A condition the client attached to the request was not true, so the server did nothing. The client said "only do this if…" using `If-Match`, `If-Unmodified-Since` or `If-None-Match`, and the condition turned out false. It is the safety mechanism behind optimistic concurrency: you send the ETag of the version you edited, and if someone else has changed the resource in the meantime, the server refuses rather than overwriting their work. ### How do I fix a 412 error? Reload to fetch the latest version and reapply your change ### Is 412 a client error or a server error? 412 is in the 4xx range, which means client error. The request itself was the problem, so retrying it unchanged will usually return the same code. ## Related pages - [404 Not Found](https://atoneplace.net/error/404/) - [403 Forbidden](https://atoneplace.net/error/403/) - [401 Unauthorized](https://atoneplace.net/error/401/) - [429 Too Many Requests](https://atoneplace.net/error/429/) - [400 Bad Request](https://atoneplace.net/error/400/) - [413 Content Too Large](https://atoneplace.net/error/413/) - [422 Unprocessable Content](https://atoneplace.net/error/422/) - [405 Method Not Allowed](https://atoneplace.net/error/405/) - [409 Conflict](https://atoneplace.net/error/409/) - [415 Unsupported Media Type](https://atoneplace.net/error/415/) - [408 Request Timeout](https://atoneplace.net/error/408/) - [410 Gone](https://atoneplace.net/error/410/) ## Sources - Hypertext Transfer Protocol (HTTP) Status Code Registry — IANA (https://www.iana.org/assignments/http-status-codes/) - RFC 9110: HTTP Semantics — IETF (https://www.rfc-editor.org/rfc/rfc9110.html)