HTTP 508 Loop Detected

HTTP 508 Loop Detected means the server terminated a request because it detected an infinite loop while processing a WebDAV operation. The server was traversing a directory or resource structure and found that it had already visited a resource during the same request, indicating a circular binding or infinite recursion.

HTTP 508 full guide →

Quick reference

Code508
NameLoop Detected
Category5xx Server Errors
SpecificationRFC 5842 §7.2
IANA statusAssigned
CacheableNo
Client actionContact the server operator. This is a server-side WebDAV configuration issue.
In-depth guideHTTP 508 full guide →

What HTTP 508 means

RFC 5842 defines 508 as indicating that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity." This code is exclusively a WebDAV status code — it occurs only in servers that implement the WebDAV protocol extension for distributed authoring and versioning of web content.

The scenario that produces 508: a WebDAV COPY, MOVE, or PROPFIND request with Depth: infinity instructs the server to recursively process all resources in a collection. If the collection contains a circular binding — resource A contains a link to resource B, which contains a link back to A — the server would loop indefinitely without the loop detection that produces 508.

508 is one of the rarest HTTP status codes in production. It requires a WebDAV server, a circular resource binding, and a depth-infinite operation. Most modern web applications do not use WebDAV directly.

WebDAV and circular bindings

WebDAV (Web Distributed Authoring and Versioning, RFC 4918) extends HTTP to allow collaborative editing and management of files on web servers. It adds methods like PROPFIND, MKCOL, COPY, MOVE, LOCK, and UNLOCK. WebDAV bindings (RFC 5842) extend this further with the concept of multiple bindings to a single resource — similar to hard links in a filesystem.

A circular binding occurs when a collection indirectly contains itself. In a normal filesystem this is prevented at the OS level, but WebDAV binding operations can create these circles if not carefully managed. When a Depth: infinity operation attempts to traverse a collection with a circular binding, the server detects it has visited a resource it has already processed in the same request and terminates with 508.

How to fix a 508

  1. Identify the circular binding. On the WebDAV server, audit the collection structure to find where a resource is bound to an ancestor collection. Use PROPFIND with limited depth to map the structure without triggering the loop.
  2. Remove the circular binding. Use the WebDAV UNBIND method to remove the problematic binding, or access the server filesystem directly to remove the circular link.
  3. Use bounded depth operations. Instead of Depth: infinity, use Depth: 0 or Depth: 1 for operations on collections that may contain circular bindings.
  4. Review server binding policies. Configure the WebDAV server to prohibit the creation of circular bindings. Most WebDAV server implementations have options to restrict binding operations that would create cycles.

508 vs related server errors

CodeMeaningContext
508Loop DetectedInfinite loop in WebDAV depth-infinite operation
506Variant Also NegotiatesCircular loop in transparent content negotiation
500Internal Server ErrorGeneric unhandled exception (may include infinite recursion)
507Insufficient StorageServer storage exhausted — different WebDAV error

FAQ

What does HTTP 508 Loop Detected mean?

HTTP 508 means a WebDAV server detected an infinite loop while processing a depth-infinite operation on a collection that contains a circular resource binding. It is a server-side WebDAV error and not actionable by the HTTP client without server intervention.

When does HTTP 508 occur?

Only in WebDAV environments during Depth: infinity operations like PROPFIND, COPY, or MOVE on collections that have circular bindings. It is extremely rare in modern web applications that do not implement WebDAV.

Is 508 the same as an infinite redirect loop?

No. Infinite redirect loops produce a browser error, not a 508. 508 is specifically a WebDAV protocol error for circular resource bindings during depth traversal.

How is 508 different from 506?

Both involve circular loops, but in different contexts. 506 is a content negotiation loop in Apache's transparent content negotiation. 508 is a resource binding loop in WebDAV depth-infinite operations.

Related resources

On this site: HTTP 508 Loop Detected — full guide · HTTP 506 Variant Also Negotiates · HTTP 507 Insufficient Storage · HTTP 500 Internal Server Error · All 5xx server errors

Standards: RFC 5842 §7.2 · IANA HTTP Status Code Registry · MDN Web Docs: 508