HTTP 409 Conflict vs 423 Locked
Both HTTP 409 (Conflict) and 423 (Locked) belong to the 4xx Client Error category. 409 indicates that the request conflicts with the current state of the server. Often due to concurrent modification or business rule violations. Meanwhile, 423 means that the resource is locked and cannot be modified (WebDAV).
Description
The request conflicts with the current state of the server. Often due to concurrent modification or business rule violations.
When You See It
When trying to create a resource that already exists, or updating a resource that was modified by another request.
How to Fix
Refresh the resource state, resolve conflicts, and retry. Use ETags for optimistic concurrency.
Description
The resource is locked and cannot be modified (WebDAV).
When You See It
When trying to edit a file that another user has locked in WebDAV.
How to Fix
Wait for the lock to be released, or request the lock owner to unlock it.
Key Differences
HTTP 409: The request conflicts with the current state of the server. Often due to concurrent modification or business rule violations.
HTTP 423: The resource is locked and cannot be modified (WebDAV).
You encounter 409 when when trying to create a resource that already exists, or updating a resource that was modified by another request.
You encounter 423 when when trying to edit a file that another user has locked in WebDAV.
When to Use Which
For 409 (Conflict): Refresh the resource state, resolve conflicts, and retry. Use ETags for optimistic concurrency. For 423 (Locked): Wait for the lock to be released, or request the lock owner to unlock it.