Reference
Exit codes
The exit codes of the CLI (tuxcarectl), what each one means, and what to do about it.
The codes #
Code 1 is the result of a gate. Each other code that is not 0 means that the run did not finish.
| Code | Meaning | What to do |
|---|---|---|
| 0 | The run finished, and no finding reached the level that fails the job. | Nothing. See Troubleshooting: exit 0. |
| 1 | A finding failed the gate: a finding at the --fail-on level, a known-exploited finding under --fail-on-exploited, a new finding for compare --fail-on-new, a newer build for update --check-only, a problem that check found, or a finding that fix left. | Read the findings in the job log or in the portal. See Troubleshooting: exit 1. |
| 2 | The command cannot run as you wrote it: a wrong option, a configuration file that the CLI cannot read, no package manager that it knows, or a browser sign-in in a CI job. | Read the message. Check the options and the directory. See Troubleshooting: exit 2. |
| 3 | The token is missing, wrong, expired, or revoked, the workspace refused it, a limit stopped it, the --tenant pin does not match, or the workspace has no registry token. | Read the message. See Troubleshooting: exit 3. |
| 4 | The portal did not answer in time, or its answer failed a check. A CLI that is too old also gets this code, and so does a CLI version that the portal blocks (CLI 0.1.86 or later): the message then gives the reason, the version to use, and the command that pins it. | Run the job again. Upgrade the CLI if the message tells you to. For a blocked version, do what the message says. See Troubleshooting: exit 4. |
| 5 | A tool on your side failed: the install command of your package manager, or a file that the CLI cannot write. Starting with the release that adds shared configuration locking, a wait for the lock also exits 5 if it reaches the timeout or the command cancels the wait after a signal. If a portal or OIDC token is set and TUXCARE_PORTAL_URL and SECURECHAIN_PORTAL_URL name different portals, the CLI stops before sending anything. The CLI also stops before sending anything when the portal token and URL are set under different families of variable names with no matching pair (CLI 0.1.94 or later), for example only SECURECHAIN_PORTAL_TOKEN and only TUXCARE_PORTAL_URL. See The two names of each variable. | Read the job log. If the CLI was waiting for the lock, the error names the --timeout limit or the signal that ended the wait. For mixed variable names, set both variables under one family or set the token or URL under both names with the same value. See Troubleshooting: exit 5. |
| 6 | harden, update, unharden, or fix changed the project, but the installed packages are not the planned ones. The CLI put your files back. | Read the message: it names the package. Contact TuxCare if the error stays. See Troubleshooting: exit 6. |
| 7 | An error in the CLI. The CLI prints internal error: what the run was doing: error; please report this to TuxCare supportand writes no report file. | Run tuxcarectl doctor --bundle file, and send the archive to TuxCare. See Troubleshooting: exit 7. |
The last lines at a terminal #
When you run the CLI at a terminal outside CI, it can end with two more lines on stderr. A run that exits with a code other than 0 prints the Troubleshooting entry of that code:
tuxcarectl: what to do about exit 4 (portal): https://sc.tuxcare.cloud/guide/help#exit-4
The link names the guide of the portal of the run. A tuxcarectl sca scan that has a scan page in the portal and exits with code 0 or 1 also prints the next step: the Set up CI page of your workspace, which writes the CI job for the scan.
tuxcarectl: next: add this scan to your CI pipeline: https://workspace.sc.tuxcare.cloud/setup-ci
A CI job log, a pipe, and a file get neither line. The lines change no exit code, no stdout, and no report.
Next: REST API