Utilo

HTTP 508 Loop Detected – Free, Online, Private

508 Loop Detected means the server stopped because it found an infinite loop in the operation.

What HTTP 508 means

508 says the server detected an infinite loop while processing the request and stopped. WebDAV defines it for operations that would recurse forever through bindings or collections. A server may also use it when it notices a cycle in its own request handling. It is not a client redirect loop, which the client can observe as repeated 3xx. 508 means the server stopped its own loop.

508 Loop Detected belongs to the 5xx server error class. Clients that only look at the class will group it with its neighbors. Clients that care about the exact code should use the narrower rule on this page, because the class is only the first digit.

When you see HTTP 508

When you see HTTP 508 Loop Detected, stop on that exact status line. 508 Loop Detected means the server stopped because it found an infinite loop in the operation. The trace that usually produces it: A WebDAV depth operation followed a binding cycle. The 5xx server error class only tells you the first digit. A neighbor in that class is a different fault, and the fix on this page does not transfer to it.

Return 508 when you abort because you detected a cycle in the operation you were asked to perform. Include enough detail to identify the cycle if you can do it safely. Do not use 508 for a retry storm the client is causing. That is 429. Do not use it for a misconfigured variant negotiation. That is 506.

How to fix HTTP 508

To fix HTTP 508, change the condition that made the server choose Loop Detected. Do not retry until the cycle is gone. If you created the cycle, break it. If the server created it, you cannot fix it from the client except by stopping. No. The loop is still there. If the log line is a different code, leave this page. The mix-up people make with 508 is this one: 506 is a content-negotiation loop of variants. A 3xx loop is the client being bounced. 508 is the server detecting a loop inside the operation.

  • A server-side include or a subrequest called itself until a detector fired.
  • The body did not name the cycle, so the user could not break it.
  • A client retried and reentered the same cycle.

An access log that only stores 508 is not enough to tell these apart. Keep the method, the path, and a request id. Do not keep the Authorization header or a request body that might be a token. The status explains the outcome. It is not a place to echo secrets back to the client either.

Example response

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

Loop detected.

The operation did not complete. The client or the operator has to remove the cycle. A retry hits the same loop. In a WebDAV tree, the cycle is in the bindings. In an application, it may be a workflow that points at itself. Say which, if you know.

What the client should do

Do not retry until the cycle is gone. If you created the cycle, break it. If the server created it, you cannot fix it from the client except by stopping.

Do not cache 508 as a successful representation of the tree.

No. The loop is still there.

Codes people confuse with HTTP 508

506 is a content-negotiation loop of variants. A 3xx loop is the client being bounced. 508 is the server detecting a loop inside the operation.

Frequently asked questions

Is 508 a redirect loop?

No. A redirect loop is a chain of 3xx responses the client can see. 508 is the server stopping its own loop.

Should the client retry?

Not until the cycle is removed.

Who defined it?

WebDAV, for operations that would recurse forever.

How is 506 different?

506 is a negotiation variant that itself negotiates. 508 is a loop in the operation.

What should I do first when I see HTTP 508?

Read the status as 508 Loop Detected specifically. 508 Loop Detected means the server stopped because it found an infinite loop in the operation. Then check the cause that matches the request you sent, starting with: A WebDAV depth operation followed a binding cycle.