Shutdown Check

Search documentation

Find a page or section

SC001: Port already in use

SC001 (port already in use) means something answered on the configured port before shutdown-check launched your service. Find what holds it and fix it.

SC001 means the port in baseUrl was not free before startup. shutdown-check stops because it cannot separate your service from the process that is already listening.

CodeSC001 FAIL
StageBefore launch
CLI exit code1
What it meansSomething already answered on the configured port before the service was launched, so the check could not tell your service apart from it.
Message
  • The local port at <origin> is already occupied or cannot be confirmed free; use a dedicated port
First thing to checkGive the test a dedicated port, and stop any dev server or earlier run still listening on it.

Why does it happen?

  • A development server is still running.
  • Another test uses the same port.
  • Parallel CI jobs share one baseUrl.
  • The configured port belongs to a database, proxy, or service container.
  • A previous run left a child process alive.

How do I fix it?

  1. Stop the process that owns the port.
  2. Give shutdown-check a port reserved for this test.
  3. Pass the same port to the service through env.
  4. Give parallel tests different ports.
shutdown-check.json
{
  "env": { "PORT": "3510" },
  "baseUrl": "http://127.0.0.1:3510"
}

If the problem appears after a previous test, check for a launcher that exits without stopping its child server. That later failure is reported as SC302.

How do I verify the fix?

Run the same command again. The first timeline event should now be process launched, not check failed — SC001. If the service then fails to become ready, continue with SC100 or SC101; the port conflict itself is gone.

When the failure occurs only in CI, inspect parallel jobs and service containers. A locally free port can still be shared on the runner.