423 Locked and 424 Failed Dependency: what they mean and how to fix them

423 means the target resource is locked, 424 means a request failed because another one did first. Both come from WebDAV; here is how to read them and clear the cause.

· 6 min read · By the Spot Downtime team

423 Locked and 424 Failed Dependency are a pair of status codes defined by WebDAV (RFC 4918), the set of HTTP extensions used for file sharing and document editing. You will meet them on file servers, document platforms, self-hosted cloud storage and the occasional API that borrowed the codes. They are rare, and because they are rare they tend to confuse people.

The short version: 423 means the resource you are trying to change is locked. 424 means your request depended on something else, and that something else failed.

423 Locked

The server understood the request but will not carry it out because the source or destination resource is locked. In WebDAV a client takes a lock with the LOCK method, receives a lock token, and has to present that token on later changes. Someone else's request, or your own without the token, is refused with 423.

http
PUT /documents/report.docx HTTP/1.1
Host: files.example.com

HTTP/1.1 423 Locked
Content-Type: application/xml

<?xml version="1.0" encoding="utf-8"?>
<D:error xmlns:D="DAV:">
  <D:lock-token-submitted>
    <D:href>/documents/report.docx</D:href>
  </D:lock-token-submitted>
</D:error>

The XML body names the locked resource, which is useful when a request touches several (a MOVE or COPY can fail because the destination, not the source, is locked).

Common causes of 423

  • Another user or sync client has the file open. Office-style editors lock documents while they are being edited, and a desktop sync client can hold a lock during an upload.
  • A stale lock. A client crashed, lost its network connection or was killed before it released its lock. Locks have a timeout, but it can be long, and some servers keep the record until something removes it.
  • Your client did not send the lock token. You locked the file, but the later PUT or PROPPATCH lacks the If header carrying the token, so the server treats you as a stranger.
  • A lock on a parent collection. A depth-infinity lock on a folder covers everything inside it.
  • An application-level lock reusing the code. Some products return 423 for their own record locks, such as a checked-out document or a job that is being processed, without implementing the full WebDAV lock machinery.

Fixing 423

  • Wait for the lock to expire, or ask the person or process holding it to close the file or finish the job.
  • If you took the lock, send the token with the change: If: (<opaquelocktoken:...>). Then release it with UNLOCK and the Lock-Token header when you are done.
  • For a stale lock, use the server's admin tools to clear it. Which tool depends on the product: some store locks in a database table or cache and offer a command or setting to remove expired entries. Check its documentation before deleting rows by hand.
  • Retry with a delay in automated clients. A short back-off often succeeds when the lock was brief, as with a concurrent sync.
bash
# Take a lock, then show the token the server returned
curl -i -X LOCK https://files.example.com/documents/report.docx \
  -H "Content-Type: application/xml" \
  -H "Timeout: Second-300" \
  --data '<?xml version="1.0"?>
<D:lockinfo xmlns:D="DAV:">
  <D:lockscope><D:exclusive/></D:lockscope>
  <D:locktype><D:write/></D:locktype>
</D:lockinfo>'

# Use the token on the change, then release it
curl -i -X PUT https://files.example.com/documents/report.docx \
  -H "If: (<opaquelocktoken:1234-abcd>)" --data-binary @report.docx
curl -i -X UNLOCK https://files.example.com/documents/report.docx \
  -H "Lock-Token: <opaquelocktoken:1234-abcd>"

Does your server support locking at all?

Not every WebDAV server does. nginx's built-in DAV module handles PUT, DELETE, MKCOL, COPY and MOVE but not LOCK, so a client that insists on locks will get an error such as 405 or 501 rather than a 423. Servers such as Apache with mod_dav and a lock database, or application servers built on WebDAV libraries, support it.

424 Failed Dependency

424 means the method could not be performed on the resource because the requested action depended on another action, and that action failed. It is almost always seen inside a 207 Multi-Status response, where the server reports a separate status for each part of a request.

Take a PROPPATCH that sets three properties at once. The operation is atomic: either all succeed or none do. If the second property is not allowed, the server reports that failure for it and 424 for the others, meaning they were fine but were not applied because of the one that failed.

http
HTTP/1.1 207 Multi-Status
Content-Type: application/xml

<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/documents/report.docx</D:href>
    <D:propstat>
      <D:prop><D:displayname/></D:prop>
      <D:status>HTTP/1.1 424 Failed Dependency</D:status>
    </D:propstat>
    <D:propstat>
      <D:prop><D:getetag/></D:prop>
      <D:status>HTTP/1.1 403 Forbidden</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>

The important habit: do not chase the 424. It is a symptom. Find the other status in the same response, such as 403, 409 or 423, and fix that. The 424 entries clear by themselves once the real failure is gone.

Where 424 shows up outside WebDAV

Some APIs use 424 for a workflow step that cannot run because an earlier step failed, for example a deployment waiting on a failed build or a request that relies on an upstream service that returned an error. This is not standard behaviour, so read that API's documentation. The reading is the same: the status that matters is the original failure, not the 424.

How these relate to other 4xx codes

  • 409 Conflict means the request conflicts with the resource's current state. A lock is one specific kind of conflict and 423 is the more precise code.
  • 412 Precondition Failed means an If-Match or If-Unmodified-Since style condition did not hold. With WebDAV, a wrong lock token in the If header can also produce 412.
  • 422 Unprocessable Content is also a WebDAV code, for a body that is well formed but cannot be processed.

The full list of codes is in the HTTP status code reference.

Monitoring a WebDAV or file API

A 423 or 424 does not mean the server is down. It means a particular write was refused. A plain uptime check that only fetches a page will stay green while real uploads fail. If a file or document API is part of your product, use an API monitor that makes a realistic authenticated request, checks the status code and inspects the response, and run it against a dedicated test file so your check does not fight real users for a lock. Alert on repeated failures, not a single one, because a short-lived lock is normal.

Get new guides by email

Practical posts on monitoring, outages, error fixes and on-call, when they're published. No spam.

Unsubscribe from any email with one click. See our privacy policy.

Keep reading