{"record":{"id":"f12dd1aed130f1e6","repo":"atuinsh/atuin","slug":"message-enable-daemon-autostart-true-or-res","errorCode":null,"errorMessage":"{message}. 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":428,"sourceCode":"    Ok(())\n}\n\nasync fn restart_daemon(settings: &Settings) -> Result<HistoryClient> {\n    ensure_daemon_running(settings).await?;\n    connect_client(settings).await\n}\n\nfn ensure_reply_compatible(settings: &Settings, version: &str, protocol: u32) -> Result<()> {\n    if daemon_matches_expected(version, protocol) {\n        return Ok(());\n    }\n\n    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),","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/daemon.rs#L410-L446","documentation":"The client could not talk to a daemon whose version/protocol matches its own; `daemon_mismatch_message` describes the skew. Because `daemon.autostart` is disabled, the client cannot restart the daemon itself and tells you the two supported remedies. This is raised by `ensure_reply_compatible` during the Status RPC probe in `try_with_restart`.","triggerScenarios":"Running a client command (e.g. history writes via the daemon) while a running daemon reports a version or wire-protocol mismatch, and `settings.daemon.autostart` is false.","commonSituations":"Upgrading the atuin binary while an old daemon process is still running; running two different atuin versions (e.g. a package-manager build vs a cargo-installed build); having autostart explicitly disabled in config.","solutions":["Stop the old daemon (`atuin daemon stop` or kill the process) and let the new binary start one.","Set `daemon.autostart = true` in ~/.config/atuin/config.toml so the client restarts the daemon automatically.","Ensure only one atuin version is installed and on PATH."],"exampleFix":"// before (config.toml)\n[daemon]\nautostart = false\n\n// after\n[daemon]\nautostart = true","handlingStrategy":"validation","validationCode":"// before relying on daemon-backed commands:\nlet cfg = std::fs::read_to_string(\"~/.config/atuin/config.toml\")?;\nif !cfg.contains(\"autostart = true\") {\n    eprintln!(\"daemon.autostart disabled: restart the daemon manually after upgrading atuin\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep daemon.autostart = true so version skews self-heal.","After upgrading atuin, always restart the daemon.","Install only one atuin build to avoid version skew."],"tags":["daemon","version-mismatch","config"],"backgroundTag":"invalid-config-value","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}