Canonfig
Reference

Doctor probes and exit codes

Look up what each canonfig doctor probe checks, what its result proves, and which exit code each failure category returns.

canonfig doctor checks this machine with seven probes. Each probe has its own time limit, so one slow or failing probe does not hide the others. To fix a specific error, see Recover from a failed or blocked sync.

canonfig doctor --no-input
canonfig doctor --no-input --timeout-ms 10000 --json
OptionEffect
--no-inputNever prompt. Use it in scripts and over SSH.
--timeout-ms <ms>Time limit for each probe. Default 5000.
--jsonPrint the full report, schema canonfig.doctor/v1, including each probe's details.

Report and exit code

Each probe ends as pass, warning, skipped, or fail. The report's status is:

statusWhen
healthyEvery probe passed.
degradedNo probe failed, and at least one warned or was skipped.
unhealthyAt least one probe failed.

A failed probe carries a failure category. doctor exits with the code of the most serious failed category, in this order: internal, apply failure, authentication, transport, Human Action Required, drift, configuration. Warnings do not change the exit code.

A probe that runs past --timeout-ms fails with <probe> probe timed out.

Probes

ProbeChecks
runtimeNode.js version, Canonfig version, platform, and architecture
stateThat Canonfig's state database is valid, migrated, readable, and writable
credentialsThe credential store and how much access this session proved
sourceThat this Follower Machine can load its credential, reach the Source Machine, match its pinned certificate, and authenticate
schedulerThe installed native job, its next run, and the last unattended run
package-managersWhich of apt, brew, bun, cargo, npm, pnpm, uv, and winget Canonfig can start
agent-adapterThe agent policy and whether the configured harness executable exists

runtime

ResultMessage
passruntime is supported
fail, Human Action RequiredNode.js <version> is unsupported; Canonfig requires Node.js 24 or newer

state

ResultMessage
passSQLite state is migrated, readable, and writable
fail, internalSQLite state health check failed

credentials

details.verification says what was proven:

ResultverificationMeaning
passsession-probeCanonfig wrote, read, and deleted a test item in this session (macOS Keychain).
passcredential-loadThe source probe read the follower credential from the store in this session. Write access is not proven.
warningprovider-presenceThe store exists. Write access and access from a scheduled run are not proven.
warningconfigurationThe local-file policy is in use; credentials are stored unencrypted.
warningnot-verifiednoninteractive credential storage is unavailable: <what to do>. The same text is in details.recovery.
fail, Human Action Requiredcredential capability check failed: <detail>

On a Source Machine, or on a Follower Machine whose source probe cannot read the credential, a working keyring on Linux or Windows reports provider-presence, so the report is degraded, not healthy.

source

The probe reads the follower credential first and contacts the Source Machine only after that succeeds.

ResultMessageMeaning
passsource is reachable, TLS-pinned, and authenticated
skippedNo Source Machine is configured, for example on the Source Machine itself.
fail, Human Action Requiredthis machine's credential store could not return the follower credential, so no Source request was made: <detail>The store is locked or unreachable. The Follower Identity is not revoked.
fail, Human Action Requiredthis machine's credential store did not return the follower credential within <ms> ms, so no Source request was made; ...A locked keyring or Keychain may be waiting for an unlock prompt this session cannot show. details.stage is credential-load.
fail, transportconfigured source is unreachableNo connection.
fail, transportconfigured source is unreachable because the managed tunnel <endpoint> is down: <detail> (or stopped)The managed tunnel is not running. Run canonfig tunnel start.
fail, authenticationsource TLS pin validation failedThe Source Machine's certificate differs from the pinned one.
fail, authenticationsource authentication failedThe Source Machine rejected the credential, for example because it revoked this Follower Machine.
fail, configurationsource probe configuration is invalidThe recorded Source Machine endpoint cannot be used.

When the Follower Machine reaches the Source Machine through the managed tunnel, details.tunnel holds the tunnel state.

scheduler

The probe reads what the operating system has installed, not only what Canonfig wrote. details includes state, timezone, nextRun, and after the first run lastFiredAt, lastFiredOutcome, and lastFiredReason.

ResultWhen
passThe job is current and the native scheduler has run it.
warningThe job is current, but one of these applies: no run has been observed yet; the last unattended run failed (the last unattended run failed at <time>: <reason>; ...); a run started and recorded no outcome; Linux lingering is off; the Windows task runs only while you are logged on; a Windows run did not start; the installed job points at an older Canonfig binary that still works; or a job is installed with no schedule decision on this Follower Machine.
fail, apply failureThe job will not run as you chose: requested scheduler definition is <state>: <detail>, where state is for example disabled, inactive, not-installed, or overridden; or installed scheduler runtime or entrypoint is unavailable: <detail>.
skippedThis Follower Machine has no schedule and no installed job.

For each schedule state and its fix, see Sync on a schedule.

package-managers

ResultMessage
passinstaller invocation is available; details.available lists the managers
fail, configurationno supported package manager is available

The probe honors installer bindings set with canonfig installer set.

agent-adapter

ResultMessage
passdeterministic-only policy requires no adapter
passconfigured agent adapter executable is available
skippedagent policy and adapter are not configured
fail, configurationconfigured agent policy requires an adapter: the policy is agent-propose or agent-apply and no harness is set.
fail, configurationconfigured agent adapter is unsupported: the harness is not codex, claude, or custom.
fail, configurationconfigured agent adapter executable is unavailable

Set the harness with canonfig agent harness; see Let a Configuration Agent resolve work.

Exit codes

Every Canonfig command uses these exit codes:

ExitCategoryMeaning
0Success.
1internalA defect in Canonfig. Report it with the message.
2usage or configurationA wrong option, a missing setup step, or a release mismatch between the Source Machine and a Follower Machine.
3Human Action RequiredA step only a person can take, such as a login or unlocking a credential store.
4conflict or driftFollower Drift, an open run, another running Canonfig process, or a changed service definition.
5authentication or revocationA revoked or invalid credential, a certificate mismatch, or an expired or used invitation.
6transportThe Source Machine or the managed tunnel cannot be reached.
7verification or apply failureAn action or its verification failed, disk space ran out, or a service did not start serving.

The fix for each message is in Recover from a failed or blocked sync.

On this page