{"record":{"id":"6da42c0d38ea47ca","repo":"sxyazi/yazi","slug":"incompatible-version-ya-yazi-restart-all","errorCode":null,"errorMessage":"Incompatible version (Ya {}, Yazi {}). Restart all `ya` and `yazi` processes if you upgraded either.","messagePattern":"Incompatible version \\(Ya (.+?), Yazi (.+?)\\)\\. Restart all `ya` and `yazi` processes if you upgraded either\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-cli/src/dds/shot.rs","lineNumber":49,"sourceCode":"\t\t\tmatch line.split(',').next() {\n\t\t\t\tSome(\"hey\") => {\n\t\t\t\t\tif let Ok(Ember::Hey(hey)) = Payload::from_str(&line).map(|p| p.body) {\n\t\t\t\t\t\t(peers, version) = (hey.peers, Some(hey.version));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSome(\"bye\") => break,\n\t\t\t\t_ => {}\n\t\t\t}\n\t\t}\n\n\t\tSelf::ensure_version(version.as_deref())?;\n\t\tSelf::ensure_ability(&peers, kind, receiver)?;\n\t\tOk(())\n\t}\n\n\tpub(super) fn ensure_version(version: Option<&str>) -> Result<()> {\n\t\tif version != Some(yazi_version::version()) {\n\t\t\tbail!(\n\t\t\t\t\"Incompatible version (Ya {}, Yazi {}). Restart all `ya` and `yazi` processes if you upgraded either.\",\n\t\t\t\tyazi_version::version(),\n\t\t\t\tversion.unwrap_or(\"Unknown\")\n\t\t\t);\n\t\t}\n\t\tOk(())\n\t}\n\n\tpub(super) fn ensure_ability(peers: &HashMap<Id, Peer>, kind: &str, receiver: Id) -> Result<()> {\n\t\tmatch (receiver, peers.get(&receiver).map(|p| p.able(kind))) {\n\t\t\t// Send to all receivers\n\t\t\t(Id::ZERO, _) if peers.is_empty() => {\n\t\t\t\tbail!(\"No receiver found. Check if any receivers are running.\")\n\t\t\t}\n\t\t\t(Id::ZERO, _) if peers.values().all(|p| !p.able(kind)) => {\n\t\t\t\tbail!(\"No receiver has the ability to receive `{kind}` messages.\")\n\t\t\t}\n\t\t\t(Id::ZERO, _) => Ok(()),","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-cli/src/dds/shot.rs#L31-L67","documentation":"`Shot::ensure_version` compares the version string reported by the peer's handshake (`hey.version`) with the local `yazi_version::version()`. On any mismatch — or when the peer reports no version — it bails, warning that `ya` and `yazi` must be restarted after an upgrade because their protocol payloads are version-locked.","triggerScenarios":"Calling any `ya pub`/`ya call` against a Yazi process started from a different build than the `ya` binary; Yazi was upgraded (e.g. via `cargo yazi install`) while the old instance kept running; the peer omits the version (reported as `Unknown`).","commonSituations":"Upgrading Yazi in place without restarting the running instance; `ya` and `yazi` installed from different commits; multiple versions installed across PATH entries.","solutions":["Quit the running Yazi instance(s) and start the freshly installed binary so both sides report the same version.","Verify both binaries come from the same build: `ya --version` vs the running yazi's version.","If a version mismatch is intentional (dev/testing), rebuild one side to match the other."],"exampleFix":"// before\n# ya 25.5.1 talking to a still-running yazi 25.4.8 after an upgrade\n$ ya pub-to ...\nError: Incompatible version (Ya 25.5.1, Yazi 25.4.8)...\n// after\n$ pkill yazi && yazi &   # restart yazi with the new build\n$ ya pub-to ...","handlingStrategy":"validation","validationCode":"// shell: refuse to run when versions diverge\n[ \"$(ya --version | awk '{print $2}')\" = \"$(yazi --version | awk '{print $2}')\" ] || { echo \"version mismatch: restart yazi\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"match Shot::ensure_version(hey.version.as_deref()) {\n  Err(e) => { eprintln!(\"{e}; quitting yazi and restarting usually fixes this\"); return; }\n  Ok(()) => {}\n}","preventionTips":["After upgrading yazi, always quit and restart every running instance.","Install ya and yazi from the same commit/tag in one step.","Compare `ya --version` with the running yazi version in startup scripts."],"tags":["versioning","ipc","dds","upgrade"],"backgroundTag":"version-mismatch","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}