| Status code | 508 |
|---|---|
| Status text | Loop Detected |
| Category | 5xx Server Error |
| Response has body | Usually |
| Specification | RFC 5842 |
What does 508 Loop Detected mean?
The server found an infinite loop while processing the request and stopped. It belongs to the 5xx Server Error class, which means the server failed to fulfil an apparently valid request. The problem is on the server side.
When do APIs return 508?
In WebDAV, when a request with Depth: infinity walks a collection that contains a binding back to one of its own ancestors. Separately, some shared-hosting platforms show a page titled “508 Resource Limit Is Reached” when an account exceeds its CPU, memory or process allowance, which has nothing to do with the WebDAV meaning.
How to fix a 508 Loop Detected
For WebDAV, remove the circular binding or request a limited depth. For the hosting-platform page, the account has hit a resource cap: check its usage graphs for the script or traffic spike responsible, and optimise, cache or move to a larger plan.
Reproduce a 508 response
The fastest way to understand a status code is to trigger one and read the full response. Open the
API tester and send a request to https://httpbin.org/status/508 — you will
see the 508 status along with every response header the server sent. Comparing those headers against
a working request is often what reveals the cause.
When you are debugging a real endpoint, check the response headers as carefully as the body, and confirm you are using the right HTTP method for the operation.
Related 5xx status codes
500 Internal Server Error
The server hit an unexpected condition and could not complete the request.
501 Not Implemented
The server does not support the functionality required to fulfil the request.
502 Bad Gateway
A server acting as a gateway or proxy received an invalid response from the upstream server.
503 Service Unavailable
The server is temporarily unable to handle the request.
504 Gateway Timeout
A gateway or proxy did not receive a timely response from the upstream server.
505 HTTP Version Not Supported
The server does not support the major HTTP version named in the request.
See also
- 507 Insufficient Storage — The server cannot store the representation needed to complete the request.
References
- RFC 5842 — The specification that defines this status code.
- MDN: 508 Loop Detected — MDN's reference page for this status code.