{"record":{"id":"c256e12d4b4fec69","repo":"jdx/mise","slug":"cannot-establish-pitchfork-supervisor-status-status","errorCode":null,"errorMessage":"cannot establish pitchfork supervisor status: {status}","messagePattern":"cannot establish pitchfork supervisor status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/daemons/runtime.rs","lineNumber":164,"sourceCode":"    pub(crate) async fn status(&self, root: &Path, id: &str) -> Result<serde_json::Value> {\n        let out = self\n            .output(root, &[\"status\".into(), id.into(), \"--json\".into()])\n            .await?;\n        Ok(serde_json::from_str(&out)?)\n    }\n\n    pub(crate) async fn supervisor_up(&self, root: &Path) -> Result<bool> {\n        let out = self\n            .output(\n                root,\n                &[\"supervisor\".into(), \"status\".into(), \"--json\".into()],\n            )\n            .await?;\n        let status: serde_json::Value = serde_json::from_str(&out)?;\n        match status[\"status\"].as_str() {\n            Some(\"up\") => Ok(true),\n            Some(\"down\") => Ok(false),\n            _ => bail!(\"cannot establish pitchfork supervisor status: {status}\"),\n        }\n    }\n\n    async fn active(&self, root: &Path, state: &State) -> Result<bool> {\n        for id in &state.ids {\n            if let Ok(value) = self.status(root, id).await\n                && matches!(\n                    value[\"status\"].as_str(),\n                    Some(\"running\" | \"waiting\" | \"stopping\")\n                )\n            {\n                return Ok(true);\n            }\n        }\n        if self.supervisor_up(root).await? {\n            let sessions: Vec<serde_json::Value> = serde_json::from_str(\n                &self\n                    .output(root, &[\"project\".into(), \"list\".into(), \"--json\".into()])","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/daemons/runtime.rs#L146-L182","documentation":"mise determines whether the pitchfork supervisor is running by parsing `pitchfork supervisor status --json` and expecting a top-level \"status\" string of exactly \"up\" or \"down\". Any other shape — missing field, null, unexpected value — is unrecoverable for mise's logic, so it bails including the raw JSON. This indicates an unexpected pitchfork response rather than a user mistake.","triggerScenarios":"supervisor_up (via active/prepare) receives JSON from `pitchfork supervisor status --json` whose status[\"status\"].as_str() is neither Some(\"up\") nor Some(\"down\") — e.g. a changed schema in a newer/older pitchfork, an error object, or a partial JSON payload.","commonSituations":"A pitchfork version whose supervisor status JSON schema differs from what mise expects, a corrupted or truncated pitchfork response, or pitchfork emitting a JSON error object because the supervisor is in a broken state.","solutions":["Run `pitchfork supervisor status --json` manually and inspect the JSON; compare against pitchfork 2.25.0+ output.","Upgrade or align pitchfork to the version mise expects (2.25.0+) so the status schema matches.","Restart the pitchfork supervisor (`pitchfork supervisor restart`) and retry the mise command.","Report the raw JSON from the error to mise/pitchfork if the schema looks correct — it may be a parsing bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Check the supervisor status shape before relying on it\nconst raw = execSync('pitchfork supervisor status --json').toString();\nconst s = JSON.parse(raw);\nif (!['up','down'].includes(s?.status)) console.warn('unexpected supervisor status payload:', raw);","typeGuard":"function hasKnownStatus(v) {\n  return v && typeof v.status === \"string\" && [\"up\", \"down\"].includes(v.status);\n}","tryCatchPattern":"try {\n  await mise.daemons.start();\n} catch (e) {\n  if (String(e).includes(\"cannot establish pitchfork supervisor status\")) {\n    console.error(\"Pitchfork JSON schema mismatch — align pitchfork version with mise's expectation.\");\n  }\n}","preventionTips":["Use a pitchfork version known to work with your mise version (2.25.0+)","Run `pitchfork supervisor status --json` manually after pitchfork upgrades to spot schema changes","Keep pitchfork and mise updated together"],"tags":["pitchfork","json","unexpected-response"],"backgroundTag":"unexpected-response-shape","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}