Ignition
Guides

Error Handling

Error modes, retries, timeouts, and the error type hierarchy.

Error modes

Ignition has three error modes, controlled via --error-mode:

ModeBehaviorUse case
fail-fastStop immediately on first failureDefault. CI pipelines, critical deploys.
fail-at-endRun everything, report all failures at the endAuditing, understanding full scope of issues.
ignoreLog failures and keep goingBest-effort automation, non-critical tasks.
ignition run deploy.ts @web --error-mode fail-fast      # stop on first error (default)
ignition run deploy.ts @web --error-mode fail-at-end    # run everything, then report
ignition run deploy.ts @web --error-mode ignore         # log and continue

In fail-fast mode with multiple hosts, a failure on one host cancels all sibling hosts.

Error types

All Ignition errors extend IgnitionError and carry a discriminant tag field:

ErrorTagDescription
SSHConnectionErrorSSHConnectionErrorFailed to establish SSH connection
SSHCommandErrorSSHCommandErrorCommand exited with non-zero status
TransferErrorTransferErrorSCP file transfer failed
ResourceErrorResourceErrorResource check or apply failed
RecipeLoadErrorRecipeLoadErrorFailed to import recipe file
InventoryErrorInventoryErrorFailed to load or resolve inventory
CapabilityErrorCapabilityErrorTransport doesn't support required capability

SSHCommandError includes the exitCode, stdout, and stderr from the failed command.

Retry behavior

Ignition retries transient failures automatically. Only two error types are retryable:

ErrorRetryableRationale
SSHConnectionErrorYesNetwork glitch, server briefly unreachable
TransferErrorYesSCP failure due to transient network issue
All othersNoLikely a real problem, not transient

Retry configuration

FlagDefaultDescription
--retries2Number of retry attempts per phase
--retry-delay1000Initial backoff in milliseconds

Retries use exponential backoff with jitter:

delay = baseDelay * 2^(attempt - 1) + random(0..baseDelay/2)

For the default of 1000ms base delay:

AttemptBase delayWith jitter
1st retry1000ms1000–1500ms
2nd retry2000ms2000–2500ms

Timeouts

Resource timeout

Each resource phase (check, apply) has a timeout:

ignition run deploy.ts @web --resource-timeout 60000   # 60 seconds

Default: 30000ms (30 seconds). When a resource times out, it's treated as a failure.

Host timeout

Set a maximum time for an entire host's recipe execution:

ignition run deploy.ts @web --host-timeout 300000   # 5 minutes

Default: 0 (unlimited). When a host times out, all its in-progress resources are cancelled.

Exit codes

CodeMeaning
0Command completed successfully
1Resource failures or other CLI/config/runtime errors

On this page