# HTTP 508 Loop Detected — Meaning, Causes & Fixes

> The server found an infinite loop while processing the request (WebDAV).

508 (RFC 5842) is raised by WebDAV servers when an operation with `Depth: infinity` runs into a cycle, such as a folder binding that contains itself.

Shared hosts running CloudLinux also show '508 Resource Limit Is Reached' when an account exceeds its CPU, memory or process limits — a different, non-standard use of the same number, and the one most people actually meet.

- Class: 5xx Server Error
- Retry: With backoff (idempotent requests only)
- Cacheable by default: no
- Defined in: [RFC 5842 §7.2 — 508 Loop Detected](https://www.rfc-editor.org/rfc/rfc5842#section-7.2)

## Example response

```http
HTTP/1.1 508 Loop Detected
Content-Type: application/json
Content-Length: 25

{"error":"Loop Detected"}
```

## Common causes

- WebDAV bindings forming a cycle.
- Shared-hosting resource limits being hit (CloudLinux LVE).

## How to fix it

1. Remove the cyclic binding.
2. On shared hosting, reduce load with caching, find the heavy scripts, or upgrade the plan.

## Send a 508 from your server

### Express

```
res.status(508).json({ error: "Loop Detected" });
```

### Next.js route handler

```
return Response.json({ error: "Loop Detected" }, { status: 508 });
```

### Flask

```
return {"error": "Loop Detected"}, 508
```

### Go net/http

```
http.Error(w, "Loop Detected", http.StatusLoopDetected)
```

### nginx

```
return 508;
```

## FAQ

### Why does my shared hosting show '508 Resource Limit Is Reached'?

Your account exceeded the host's CPU, memory or process limits. Add caching, find the slow plugins or scripts, or move to a bigger plan.

## Related status codes

- [503 Service Unavailable](https://www.devkult.com/http/503.md)
- [500 Internal Server Error](https://www.devkult.com/http/500.md)
- [429 Too Many Requests](https://www.devkult.com/http/429.md)

Open the interactive page: https://www.devkult.com/http/508