# Too many levels of symbolic links (ELOOP)

**Code:** `Too many levels of symbolic links` · **Category:** Linux · **Seen on:** Linux

A symlink points to itself, directly or through a chain, so path resolution loops.

## Meaning

Usually a symlink created with a relative target from the wrong directory (ln -s file file) or two links pointing at each other; also broken NFS/autofs mounts.

## Common causes

- Symlink created with the same source and destination
- Relative target resolved from the link’s directory, not your current one
- Circular links between directories
- NFS/autofs mount loops

## Quick fix

1. Inspect: ls -l and readlink -f
2. Recreate with an absolute target: ln -sfn /abs/path link
3. Remove the circular link

## Detailed fix by platform

### Linux

1. 

```bash
ls -l /etc/nginx/sites-enabled/
namei -l /etc/nginx/sites-enabled/site.conf
sudo ln -sfn /etc/nginx/sites-available/site.conf /etc/nginx/sites-enabled/site.conf
```


## How to diagnose

1. **Chain** — namei -l path
2. **Target** — Absolute or relative?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/linux/too-many-levels-of-symbolic-links)
