508 Loop Detected
HTTP response status code 508 is a server error message that is relevant to either WebDAV and alternatively to Cloudflare.
For WebDAV, 508 Loop Detected indicates that the server has terminated the directory tree request because an infinite loop has been detected.
For Cloudflare, 508 Resource Limit Reached indicates that the client account is exceeding one of the allocated resource limits.
Usage specific to WebDAV
When the 508 Loop Detected status code is received, it is because the client has submitted a WebDAV request for an entire directory and as part of the result, it creates a target somewhere in the same tree. As such, an infinite request/response loop is created and the server responds with Depth: Infinity
. Consequently, the entire operation fails.
Usage specific to Cloudflare
When the 508 Resource Limit Reached status code is received, it is an error that is generated on the origin server indicating that one of the resource limits has been exceeded. Examples of resource limits include CPU usage, physical memory, and the number of processes.
Code references
.NET
HttpStatusCode.LoopDetected
Rust
http::StatusCode::LOOP_DETECTED
Rails
:loop_detected
Go
http.StatusLoopDetected
Symfony
Response::HTTP_LOOP_DETECTED
Python3.5+
http.HTTPStatus.LOOP_DETECTED
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_LOOP_DETECTED
Angular
@angular/common/http/HttpStatusCode.LoopDetected
Takeaway
The 508 status code generated by WebDAV indicates that an infinite loop has been discovered while attempting to display a directory tree, whereas, with Cloudflare, the 508 status code indicates that a resource limit has been reached, as reported by the origin server.