What do the installer exit codes mean? They do not match the CLI ones
Asked 1,690 views3 answers
11votes
I want our provisioning script to react differently depending on why the install failed — retry a download, but fail the build for a bad flag. I found the CLI exit code table and started using it, then noticed the numbers did not line up with what I was seeing.
Two different sets, yes, and that trips people up because they are both "SDODS exit codes". The installer is a standalone script and answers a different set of questions than the CLI does.
The installer codes:
text
0 success (also --help, --version-check, a cancelled uninstall)
1 generic failure
2 usage error: unknown flag, missing value, invalid choice
3 unsupported platform
4 missing prerequisite: git, curl, or the requested package manager
5 Node missing or too old
6 download failure
7 install failure, including an incomplete checkout
8 permission problem: bin directory not writable, or running as root
For your branching: 6 is the retryable one, and 2, 3, 4 and 8 are all "the environment or the command is wrong" and should fail fast rather than loop.
Every failure also prints a docs link on the last line, so a captured log tells you where to look without needing the table.
Do not carry the CLI table over by accident — the CLI uses 2 for a configuration or usage error and 3 for lint errors, which is nothing like 3 on the installer. Two tables, two pages: Reference → Installer and Reference → Exit codes.
Practical note from wiring this up: retrying 6 blindly is not always right either. A download failure behind a proxy that is refusing the host will fail identically every time, and three retries just makes the job three times slower before it reports the same thing. We retry once and then surface the log.