508

Loop Detected

5xx Server Error

Back to list

Server perspective

Use 508 when a WebDAV operation fails because the server detected an infinite loop while traversing resources.

When to use

  • Return 508 when a recursive or Depth: infinity operation cannot finish due to cyclic bindings or references
  • Use it when the entire operation fails because loop detection is required to prevent unbounded traversal

How to respond

  • Track visited resources or bindings during traversal so loops are detected deterministically
  • Prefer 208 Already Reported inside Multi-Status when you can complete the response safely without repeating members

Headers to consider

  • No status-specific header is required; standard WebDAV response metadata may still apply

Response body

  • A body is recommended; explain that a cyclic reference or traversal loop was detected and include enough safe detail for operators or clients to find the offending structure

Server-side pitfalls

  • Do not use 508 for ordinary deep trees that are merely slow but not cyclic
  • Do not use 508 when duplicate suppression with 208 Already Reported would let the operation succeed

Examples

WebDAV server aborts cyclic collection walk

Request:PROPFIND /archive Depth: infinity
Response:508 Loop Detected with error: cyclic_binding

The server identified a recursive binding path and stopped the traversal instead of recursing indefinitely.

References

Related 5xx Server Error Codes