{"record":{"id":"d935830d81821d51","repo":"atuinsh/atuin","slug":"reason-enable-daemon-autostart-true-or-rest","errorCode":null,"errorMessage":"{reason}. Enable `daemon.autostart = true` or restart the daemon manually","messagePattern":"(.+?)\\. Enable `daemon\\.autostart = true` or restart the daemon manually","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/daemon.rs","lineNumber":442,"sourceCode":"    let message = daemon_mismatch_message(version, protocol);\n    if settings.daemon.autostart {\n        bail!(\"{message}\");\n    }\n\n    bail!(\"{message}. Enable `daemon.autostart = true` or restart the daemon manually\");\n}\n\n/// Acquire a [`HistoryClient`] connected to a daemon we expect to understand us, probing over the\n/// wire-stable Status RPC first and restarting the daemon if it is absent or version/protocol\n/// skewed.\n///\n/// TODO(markovejnovic): This is egregious slop, but not worse than the original solution. I want to\n///                      remove this in a future PR: <https://github.com/atuinsh/atuin/pull/4002>\npub async fn ready_client(settings: &Settings) -> Result<HistoryClient> {\n    match probe(settings).await {\n        Probe::Ready(client) => return Ok(client),\n        Probe::NeedsRestart(reason) if !settings.daemon.autostart => {\n            bail!(\"{reason}. Enable `daemon.autostart = true` or restart the daemon manually\");\n        }\n        Probe::Unreachable(err) if is_legacy_daemon_error(&err) => {\n            return Err(err.wrap_err(LEGACY_DAEMON_RESTART_MESSAGE));\n        }\n        Probe::Unreachable(err) if !settings.daemon.autostart => return Err(err),\n        Probe::Unreachable(err) if !should_retry_after_error(&err) => return Err(err),\n        Probe::NeedsRestart(_) | Probe::Unreachable(_) => {}\n    }\n\n    restart_daemon(settings).await\n}\n\n/// Send a request to the daemon, first ensuring (via [`ready_client`]) that it is running and\n/// speaks our version.\nasync fn try_with_restart<C, F, R>(settings: &Settings, send_request: F, context: C) -> Result<R>\nwhere\n    F: AsyncFn(&mut HistoryClient, C) -> Result<R> + Sync,\n    R: atuin_daemon::grpc::VersionedReply,","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/atuinsh/atuin/blob/c0c717ab04c881764bcad4b3d169a507e2432643/crates/atuin/src/command/client/daemon.rs#L424-L460","documentation":"ready_client probes the daemon for readiness and returns a ready HistoryClient only if version/protocol match. When the probe reports NeedsRestart but autostart is disabled, the client cannot recover on its own and bails with the same remediation hint. It is the top-level guard used before issuing daemon RPCs.","triggerScenarios":"probe() returns Probe::NeedsRestart(reason) (version or protocol skew) while settings.daemon.autostart is false; called from try_with_restart during any daemon-backed command.","commonSituations":"Same as error 80: stale daemon after an upgrade, mixed installations, autostart disabled in config.","solutions":["Restart the daemon manually so version/protocol match the CLI","Enable daemon.autostart = true in the Atuin config so the client restarts skewed daemons automatically","Ensure only one atuin installation provides the daemon"],"exampleFix":"// before (config.toml)\n[daemon]\nautostart = false\n// after\n[daemon]\nautostart = true","handlingStrategy":"try-catch","validationCode":"let cfg: toml::Value = toml::from_str(&std::fs::read_to_string(\"~/.config/atuin/config.toml\")?)?;\nif !cfg[\"daemon\"][\"autostart\"].as_bool().unwrap_or(false) {\n    eprintln!(\"autostart disabled: ensure the running daemon matches this CLI version\");\n}","typeGuard":null,"tryCatchPattern":"match ready_client(&settings).await {\n    Err(e) if e.to_string().contains(\"Enable `daemon.autostart = true`\") => {\n        // restart daemon and retry\n    }\n    other => other?,\n}","preventionTips":["Enable autostart to avoid manual restarts","Probe daemon status (`atuin daemon status`) after upgrades","Pin CLI and daemon to the same version"],"tags":["daemon","version-mismatch","protocol","configuration"],"backgroundTag":"version-incompatible","analyzedSha":"c0c717ab04c881764bcad4b3d169a507e2432643","analyzedAt":"2026-09-12T07:40:01.341Z","contentChangedAt":"2026-09-12T07:40:01.341Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}