Skip to main content

Exit codes

Every command except the conversion commands below uses these codes. Changing a code requires a spec amendment.

CodeMeaningProbable causeRecovery
0success
1request or document failedHTTP non-success, a failed document in a batch, a plan-gate refusal in apply (unknown kind, duplicate metadata.name, a kind's own gate), a post-upload state-sync failure, user not foundRead the error message; re-run after fixing the input or the server state.
2misuse, config or internal errorInvalid flags, config file errors, no or unknown context, no password/token source, empty apply input, I/O, YAML/JSON parse errorsFix the command line or the config file.
4DNS resolution failureWrong host name in the server URLCheck the URL and DNS.
5connection refusedNothing listening on the host and port, or a firewallCheck the URL and port.
6timeoutServer or network too slowRetry; check the server.
7TLS handshake failedAn untrusted or invalid server certificate, or another TLS failureSee TLS.
8redirect loopWrong base URL or proxy configPoint the URL at /opennms.
9unsupported authentication schemeThe server asks for an auth scheme other than Basic or BearerUse a basic or bearer context.
10--wait timed outThe async operation outlasted --timeout (default 30m)Raise --timeout or check the operation's progress.
11--wait observed a server-side failureThe async operation failed on the serverRead the server-side error.
12write refused by a read-only context--read-only, ONMSCTL_READ_ONLY, or the context's read-only: trueSwitch to a writable context.
13IAM User apply refused: admin lockoutThe apply would remove the last holder of a protected roleKeep a holder, or set iam.allow-admin-lockout: true in the context.
14IAM User apply refused: self-lockoutThe apply would strip the caller's own protected role or accountApply with a different context.
15IAM User apply refused: caller unknownThe self-lockout check could not identify the callerUse a basic-auth context, or preview with --dry-run.

Conversion commands​

event-source convert, event-source export, event-source download --format yaml and requisition convert report conversion results with their own codes:

CodeMeaning
0clean, or info-only findings
1warnings; the YAML is still written
2blocking findings; no YAML written (also usage errors for requisition convert)
3usage error before conversion ran (event-source convert only)

A script running under set -e stops on 1 even though the output was written.