Server Error · 5xx

508 Loop Detected

The server detected an infinite loop while processing the request.

What 508 Loop Detected means

508 Loop Detected is another WebDAV code. The server detected that processing the request would create an infinite loop (e.g. circular symlinks, recursive PROPFIND on cyclic resource graph). Outside WebDAV, 508 is occasionally used by APIs to signal recursion-depth-exceeded errors.

When servers should return it: Return 508 when a request would cause infinite recursion or self-reference.

Example response

HTTP/2 508
content-type: application/json
{"error":"loop detected","depth":1024}

Related status codes

Frequently Asked Questions

When do you actually see 508?
Rarely. WebDAV servers use it for circular resource graphs. Some recursive query APIs adopt it for depth-limit errors.
Defined in: RFC 5842 · Class: 5xx Server Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.