Exit Codes
What each numeric exit code from HEAL commands and scripts means.
Exit Codes#
The exit codes are numeric values returned by a command or a script has been executed. These codes provide information about the success or failure of the command or script. By convention, an exit code of 0 indicates success, and any non-zero exit code indicates an error or failure.
Exit codes are useful for scripting and automation purposes as they allow the calling program to determine the result of the executed command and take appropriate actions based on the outcome.
Exit codes are as follows:
-
Exit Code 0: Success (clean exit)
The container's main process completed successfully and exited cleanly with status 0. In the container lifecycle this is a purposely stopped container — one that finished its work or was gracefully shut down — not an error.
-
Exit Code 1: Application Error
The container was stopped due to an application error or incorrect reference in the image specification
-
Exit Code 125: Container failed to run error
The docker run command did not execute successfully
-
Exit Code 126: Command invoke error
A command specified in the image specification could not be invoked
-
Exit Code 127: File or directory not found
File or directory specified in the image specification was not found
-
Exit Code 128: Invalid Argument used on exit
Exit was triggered with an invalid exit code (valid codes are integers between 0-255)
-
Exit Code 134: Abnormal termination (SIGABRT)
The container aborted itself using the abort() function.
-
Exit Code 137: Immediate termination (SIGKILL)
Container was immediately terminated by the operating system via SIGKILL signal
-
Exit Code 139: Segmentation fault (SIGSEGV)
Container attempted to access memory that was not assigned to it and was terminated
-
Exit Code 143: Graceful termination (SIGTERM)
Container received warning that it was about to be terminated, then terminated
-
Exit Code 255: Exit Status Out of Range
Container exited, returning an exit code outside the acceptable range, meaning the cause of the error
Next
- Basic Commands — the Linux commands used to inspect containers and their logs.
- Nomad Issues — when a container exits repeatedly under the orchestrator.