What it means
Only one socket can listen on an address and port (EADDRINUSE). The usual holder is an older instance of the same service, another service with the same default port, or a container publishing it.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. Another process listens on the port
Check:
ss -ltnp 'sport = :8080'
lsof -i :8080
Fix: Stop that process (systemctl stop, kill <pid>), or configure your service on another port.
2. Docker publishes the port for a container
Check:
docker ps --format '{{.Names}} {{.Ports}}' | grep 8080
Fix: Stop the container or change its published port.
3. The same program started twice (a stale instance, a supervisor plus a manual start)
Check:
pgrep -af <name>
Fix: Run it under one supervisor only.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
Open the labNo account needed for your first tries.
Related errors
- connect: connection refused
The host answered, but nothing listens on that address and port.