{ }HttpStatus.com

508 Loop Detected

The server terminated an operation because it detected an infinite loop while processing a request with recursive dependencies.

Defined in RFC 5842 §7.2

What 508 means

HTTP 508 Loop Detected, defined in RFC 5842, means the server terminated an operation because it detected an infinite loop while processing a request that involves recursive traversal, typically through WebDAV bindings that let a single resource be reachable from multiple collection paths. It exists specifically to handle situations where a naive recursive traversal, such as computing the size of a directory tree or resolving nested references, would otherwise never terminate because a resource links back to one of its own ancestors, directly or through several intermediate steps.

508 is closely related to, and more specific than, the older 208 Already Reported, which lets a WebDAV multi-status response avoid re-listing a binding that has already appeared, preventing the same infinite-loop problem from bloating a response with duplicate entries. Outside of WebDAV, 508 is essentially never seen, since the recursive-binding structure it addresses is particular to that specification; a generic application encountering a self-referential loop in its own data, such as a circular symlink or a self-parenting record, would more commonly just return a 500 or a specific application-level error instead.

Common causes

  • A WebDAV collection contains a binding that loops back to one of its own ancestor collections, directly or through intermediate bindings.
  • A recursive operation, such as a full-tree COPY or a PROPFIND with Depth: infinity, encounters a cycle in the resource graph it is traversing.
  • A client or misconfigured sync tool creates a self-referential structure, such as a folder linked inside itself, that the server's loop-detection logic catches before it runs indefinitely.

How to fix a 508

If you are the client (browser user or API caller)

  • Avoid creating self-referential bindings or nested links when organizing WebDAV collections, since these are what trigger the loop detection.
  • If using a sync client, check its logs for the specific path that formed the cycle and remove or restructure that link before retrying.

If you run the server

  • Audit the WebDAV binding structure for cycles and remove or restructure any collection that links back to its own ancestor.
  • Ensure the server's traversal logic caps recursion depth and returns 508 cleanly rather than hanging or crashing when a loop is found.
  • Log the specific path or binding chain that triggered the loop so operators and clients can identify and fix the structural problem quickly.

Example

PROPFIND /webdav/projects/ HTTP/1.1
Host: files.example.com
Depth: infinity

HTTP/1.1 508 Loop Detected
Content-Type: text/plain

The server detected an infinite loop while processing this request:
projects/archive links back to projects/.
A WebDAV collection that links back to one of its own ancestors triggers loop detection during a deep traversal.

Try it live

Our free status responder returns a real HTTP 508 you can point tests, monitors or a browser at.

GET https://mcp.httpstatus.com/status/508

Related status codes

Tools for debugging this