{"record":{"id":"9acfd836827b38a8","repo":"spacedriveapp/spacedrive","slug":"unknown-config-version","errorCode":null,"errorMessage":"Unknown config version: {}","messagePattern":"Unknown config version: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"core/src/config/app_config.rs","lineNumber":385,"sourceCode":"\t\t\t\t// Migration from v3 to v4: Add multi-stream logging configuration\n\t\t\t\tself.logging = LoggingConfig::default();\n\t\t\t\tself.version = 4;\n\t\t\t\tOk(())\n\t\t\t}\n\t\t\t4 => {\n\t\t\t\t// Migration from v4 to v5: Add proxy pairing configuration\n\t\t\t\tself.proxy_pairing = ProxyPairingConfig::default();\n\t\t\t\tself.version = 5;\n\t\t\t\tself.migrate()\n\t\t\t}\n\t\t\t5 => {\n\t\t\t\t// Migration from v5 to v6: Add Spacebot companion configuration\n\t\t\t\tself.spacebot = SpacebotConfig::default();\n\t\t\t\tself.version = 6;\n\t\t\t\tOk(())\n\t\t\t}\n\t\t\t6 => Ok(()), // Already at target version\n\t\t\tv => Err(anyhow!(\"Unknown config version: {}\", v)),\n\t\t}\n\t}\n}\n","sourceCodeStart":367,"sourceCodeEnd":389,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/config/app_config.rs#L367-L389","documentation":"app_config.migrate() walks a chain of version steps (v1 through v6, with 6 as terminal) and any other version value falls into the catch-all arm. A version above 6 means the config file was written by a newer build than the one reading it; a garbage value means corruption or hand-editing. Because migrate() fails, config load and daemon startup fail with it.","triggerScenarios":"Downgrading the daemon/CLI after a newer release wrote a v7+ config; two builds of different versions sharing one data dir; manual edits to the version field.","commonSituations":"Rolling back a release to fix a regression; testing builds side by side against the same data dir; config files synced between machines running different versions.","solutions":["Upgrade back to (or past) the version that wrote the config so it understands the version","Or back up and remove/recreate the config file to reset to defaults (accepting loss of app settings)","Never share one data dir between old and new builds; use separate --data-dir per version"],"exampleFix":"# before: data dir written by newer build\nsd daemon start   # Unknown config version: 7\n\n# after: quarantine old config, start fresh\nmv ~/.spacedrive/app_config.json ~/.spacedrive/app_config.json.bak\nsd daemon start","handlingStrategy":"validation","validationCode":"fn config_version_supported(path: &std::path::Path) -> anyhow::Result<bool> {\n    let v: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(path)?)?;\n    Ok(v.get(\"version\").and_then(|v| v.as_u64()).map_or(false, |n| (1..=6).contains(&n)))\n}","typeGuard":"fn is_known_config_version(v: u64) -> bool {\n    (1..=6).contains(&v)\n}","tryCatchPattern":"match config.migrate() {\n    Ok(()) => {}\n    Err(e) if e.to_string().contains(\"Unknown config version\") => {\n        eprintln!(\"Config was written by a newer build. Upgrade the daemon, or back up and remove the config to reset.\");\n        std::process::exit(1);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Never share one data dir between different versions of the daemon; use per-version directories","Before downgrading, back up the config file so you can restore it when upgrading again","Make the error message include the supported range (1..=6) and the file path for quick triage"],"tags":["config","migration","versioning","compatibility"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}