# 508 Loop Detected

> A 508 means the server stopped an operation because it found an infinite loop. See the WebDAV Depth: infinity case, the Vercel error, and how to fix each.

Canonical: https://scaplet.com/errors/http/508

Guide Error · HTTP status codes

A 508 means the server stopped an operation because it found an infinite loop. See the WebDAV Depth: infinity case, the Vercel error, and how to fix each.

4 min

read

6

sources

Oct 30, 2026

updated

Scaplet Editorial Team

author

508 5xx · Server error

Defined in

RFC 5842 (WebDAV Binding Extensions), section 7.2

Class

5xx server error

Vercel error code

INFINITE_LOOP_DETECTED (508)

The short answer

A 508 Loop Detected means the server ended an operation because it hit an infinite loop. In WebDAV (RFC 5842) it answers a PROPFIND with Depth: infinity that walks a collection containing a binding loop. On Vercel the same status is INFINITE_LOOP_DETECTED, raised when an app keeps requesting itself. Fix the loop, or request a finite depth.

1. [What 508 means, and the two places you meet it](#what-508-means-and-the-two-places-you-meet-it)
2. [WebDAV: the Depth: infinity case](#webdav-the-depth-infinity-case)
3. [Vercel: INFINITE_LOOP_DETECTED](#vercel-infinite-loop-detected)
4. [What a 508 does to SEO](#what-a-508-does-to-seo)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F508%20(%22508%20Loop%20Detected%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F508%20(%22508%20Loop%20Detected%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F508%20(%22508%20Loop%20Detected%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F508%20(%22508%20Loop%20Detected%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

RFC 5842 (WebDAV Binding Extensions), section 7.2

Defined in

5xx server error

Class

INFINITE_LOOP_DETECTED (508)

Vercel error code

DavDepthInfinity off

Apache mod_dav default

_01_Where a 508 shows up

## What 508 means, and the two places you meet it

RFC 5842 defines it: the 508 (Loop Detected) [status code](/glossary/http-status-codes) indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". This status indicates that the entire operation failed. MDN adds that it was introduced as a fallback for WebDAV clients that do not support `208 Already Reported` responses.

Context

### WebDAV server (RFC 5842 bindings)

What loops

A collection that contains a binding back to one of its own ancestors, walked by a `Depth: infinity` request

Who sees it

WebDAV clients, file-sync tools, mounted network drives

Fix

Request `Depth: 0` or `Depth: 1`, or remove the bind loop on the server

Context

### Vercel (`INFINITE_LOOP_DETECTED`)

What loops

The app makes an infinite number of requests to itself, or to an external API or database

Who sees it

Any visitor or crawler hitting that route

Fix

Break the loop in code, rewrites or redirects; check logs and Vercel's status page

Context

### A browser redirect loop

What loops

Two redirects sending the browser back and forth

Who sees it

Browser shows `ERR_TOO_MANY_REDIRECTS`, not a 508

Fix

See [Cloudflare too many redirects](/errors/cdn/cloudflare-too-many-redirects) and [redirect loops](/seo-issues/redirect-loops)

**Not the same as ERR_TOO_MANY_REDIRECTS**A redirect loop ends in a browser error because the client gives up after too many 3xx responses. A 508 is a server-sent status that says the server found the loop itself.

_02_How it works

## WebDAV: the Depth: infinity case

A PROPFIND request must carry a `Depth` header of `0`, `1` or `infinity` (RFC 4918). With `infinity` the server walks every member of a collection. If bindings make the collection contain itself, that walk never ends. RFC 5842 describes two outcomes: a client that signalled bind support through the `DAV` request header can get `208 Already Reported` inside a multistatus body, and a non-bind-aware client gets the whole request rejected with a 508.

Send the PROPFIND from RFC 5842's example with curl

```
curl -i -X PROPFIND https://dav.example.com/Coll/ \ -H "Depth: infinity" \ -H "Content-Type: application/xml; charset=utf-8" \ --data '<?xml version="1.0" encoding="utf-8" ?> <D:propfind xmlns:D="DAV:"> <D:prop> <D:displayname/> </D:prop> </D:propfind>' # A loop on a non-bind-aware client: # HTTP/1.1 508 Loop Detected # Same request with a finite depth, which avoids the walk: # -H "Depth: 1"
```

Many servers refuse infinite depth outright. RFC 4918 says support for infinite-depth requests MAY be disabled because of performance and security concerns, and that a server MAY reject PROPFIND on collections with `Depth: infinity` using a 403 with the `propfind-finite-depth` precondition in the error body. Apache's `mod_dav` disallows them by default: `DavDepthInfinity` is `off`, because such a request could constitute a denial-of-service attack.

Apache mod_dav: infinite-depth PROPFIND is off unless you enable it

```
<Location "/dav"> Dav On # Default is off. Turning it on lets one request walk the whole tree. # DavDepthInfinity on </Location>
```

1. 01

### Check the Depth header the client sends

A request with no `Depth` header should be treated like `Depth: infinity`, per RFC 4918, so set an explicit finite depth in sync tools and scripts.
2. 02

### Look for bindings that cycle

On a server that supports bindings, find a collection with a binding to one of its own ancestors and remove or retarget it.
3. 03

### Send the `DAV` header from bind-aware clients

RFC 5842 says `208` should not be used unless the client has signalled support with the `DAV` request header, which is why other clients get the 508.

_03_Worth knowing

## Vercel: INFINITE_LOOP_DETECTED

Vercel's error page for `INFINITE_LOOP_DETECTED` (HTTP 508, "Loop Detected") says the error occurs when an infinite loop is detected within the application, for example when the app makes an infinite number of requests to itself or to an external API or database. Its troubleshooting steps are the checklist to follow.

### Application source

look for code that can loop, such as a looping `fetch` or an unconditional redirect.

### Configuration

review files such as `next.config.js` and `vercel.json` to make sure they are not causing the loop.

### External calls

confirm that API or database calls your app makes do not have errors or loops.

### Logs

check the application logs for unhandled exceptions that might cause the loop.

### Status page

if nothing above explains it, check Vercel's status page for CDN outages, which Vercel says can sometimes cause this error.

A route that requests itself (the pattern Vercel describes), and a guard

```
// Loops: this handler calls its own URL, which runs the same handler. export async function GET(request) { const res = await fetch(new URL(request.url)); // never terminates return res; } // Guard: refuse to recurse if the request already came from this route. export async function GET(request) { if (request.headers.get('x-internal-hop')) { return new Response('Loop refused', { status: 400 }); } const res = await fetch('https://api.example.com/data', { headers: { 'x-internal-hop': '1' }, }); return res; }
```

**The guard header is a suggestion**Vercel's page documents the cause and the checklist above. The `x-internal-hop` header is an illustrative pattern for stopping self-requests, not something Vercel prescribes.

_04_Explained

## What a 508 does to SEO

Crawlers do not send PROPFIND, so a WebDAV 508 is invisible to search. A 508 on a page route (for example from a Vercel app) is a 5xx: Google says [5xx errors](/errors/http/5xx-errors) make crawlers temporarily slow down, indexed URLs are preserved but eventually dropped, and content from a 5xx response is ignored. Google's guide does not list 508 on its own, so it applies the class behavior. See [5xx server errors](/seo-issues/server-errors-5xx) and [502 Bad Gateway](/errors/http/502) for a more common gateway failure.

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ What does 508 Loop Detected mean?

The server stopped an operation because it found an infinite loop. In WebDAV it is returned for a request with Depth: infinity that hits a binding loop. Vercel uses 508 for INFINITE_LOOP_DETECTED when an app keeps requesting itself.

_02_ How do I fix a 508 on Vercel?

Follow Vercel's troubleshooting list: check the source for looping fetches or unconditional redirects, review next.config.js and vercel.json, confirm external API and database calls are not looping, read the logs for unhandled exceptions, and check Vercel's status page.

_03_ What is the difference between 208 and 508?

RFC 5842 uses 208 Already Reported inside a multistatus body for clients that support bindings, to avoid listing a collection twice. For clients that do not, the whole request is rejected with 508.

_04_ Is 508 a redirect loop?

No. A redirect loop shows up in the browser as ERR_TOO_MANY_REDIRECTS after repeated 3xx responses. A 508 is a status the server sends when it detects a loop itself.

Sources · 6

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- rfc-editor.org
- mozilla.org
- vercel.com
- apache.org
- google.com

1. 01 [RFC 5842: Binding Extensions to WebDAV](https://www.rfc-editor.org/rfc/rfc5842.html) rfc-editor.org · checked 2026-11-01
2. 02 [RFC 4918: HTTP Extensions for WebDAV](https://www.rfc-editor.org/rfc/rfc4918.html) rfc-editor.org · checked 2026-11-01
3. 03 [MDN: 508 Loop Detected](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/508) developer.mozilla.org · checked 2026-11-01
4. 04 [Vercel docs: INFINITE_LOOP_DETECTED](https://vercel.com/docs/errors/INFINITE_LOOP_DETECTED) vercel.com · checked 2026-11-01
5. 05 [Apache httpd: mod_dav (DavDepthInfinity)](https://httpd.apache.org/docs/2.4/mod/mod_dav.html) httpd.apache.org · checked 2026-11-01
6. 06 [How HTTP status codes affect Google's crawlers](https://developers.google.com/crawling/docs/troubleshooting/http-status-codes) developers.google.com · checked 2026-11-01

## Keep learning

[All errors](/errors)

[Learn HTTP 500 Internal Server Error HTTP status codes](/errors/http/500) [Related Redirect loops Redirects](/seo-issues/redirect-loops) [Read next 502 Bad Gateway HTTP status codes](/errors/http/502) [Do Run a free site audit Free, about two minutes](/site-audit)

More in HTTP status codes
[424 Failed Dependency](/errors/http/424) [425 Too Early](/errors/http/425) [426 Upgrade Required](/errors/http/426) [428 Precondition Required](/errors/http/428) [429 Too Many Requests](/errors/http/429) [451 Unavailable For Legal Reasons](/errors/http/451) [502 Bad Gateway](/errors/http/502) [503 Service Unavailable](/errors/http/503) [504 Gateway Timeout](/errors/http/504) [505 HTTP Version Not Supported](/errors/http/505) [506 Variant Also Negotiates](/errors/http/506) [507 Insufficient Storage](/errors/http/507) [508 Loop Detected](/errors/http/508) [510 Not Extended](/errors/http/510) [511 Network Authentication Required](/errors/http/511) [5xx errors](/errors/http/5xx-errors) [HTTP 200 OK](/errors/http/200) [HTTP 201 Created](/errors/http/201) [HTTP 204 No Content](/errors/http/204) [HTTP 206 Partial Content](/errors/http/206) [HTTP 301 Moved Permanently](/errors/http/301) [HTTP 302 Found](/errors/http/302) [HTTP 303 See Other](/errors/http/303) [HTTP 304 Not Modified](/errors/http/304)

Terms on this page
[HTTP status codes](/glossary/http-status-codes)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
