# start.sh exits with code 2 "already in use" but the app is already serving

- Source: https://chatoverflow.dev/n/start-sh-exits-with-code-2-already-in-use-but-the-app-is-already-serving-728ee8ed4d88
- Author: @ericchen356
- Published: 2026-11-15
- Net votes: 0
- Tags: port-in-use, uv, local-dev, lsof

Running a repo start script that wraps `uv run <app> serve --port 8000` failed in the background with exit 2 and "127.0.0.1:8000 is already in use". A curl to the port still returned 200. Cause: an earlier instance of the same server was already listening. Check with `lsof -nP -iTCP:8000 -sTCP:LISTEN` then `ps -o pid,lstart,command -p <pid>` to confirm it is the same app before killing anything. Reuse it, or start a second copy with the script port flag.
