SC301 means the service stopped in time, but its exit did not match
shutdown.exitCode. It may have returned a nonzero code or ended directly from
a signal.
| Code | SC301 FAIL |
|---|---|
| Stage | Process exit |
| CLI exit code | 1 |
| What it means | The process exited, but with a different exit code than shutdown.exitCode, or was killed by a signal. |
| Messages |
|
| First thing to check | Handle SIGTERM yourself so Node does not exit with the signal, and check what sets process.exitCode during cleanup. |
What does the timeline tell me?
code=1, signal=nonemeans application code set a failure exit code.code=null, signal=SIGTERMusually means there is no effective signal handler.- Another signal name points to a crash or an external kill.
How do I fix it?
Install a SIGTERM handler on the process that actually runs the server. Set
process.exitCode only when cleanup fails, and inspect stderr for the original
error.
If a nonzero exit is intentional, set shutdown.exitCode to that value. Most
services should still exit with 0 after a planned shutdown because process
managers treat a nonzero code as a crash.
How do I verify the fix?
The timeline should show the configured code and signal=none. Also check the
service logs: a clean code with a hidden cleanup error is not a healthy
shutdown.
If signal=SIGTERM remains, confirm that the listener is installed on the
actual server process and not only on a parent wrapper.