Too many levels of symbolic links 🐧 Linux

Too many levels of symbolic links (ELOOP)

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

Seen on: Linux

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?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.