{"record":{"id":"08b4a8b62bd6e7d6","repo":"zeroclaw-labs/zeroclaw","slug":"unsupported-auth-profile-schema-version-max-su","errorCode":null,"errorMessage":"Unsupported auth profile schema version {} (max supported: {})","messagePattern":"Unsupported auth profile schema version (.+?) \\(max supported: (.+?)\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/auth/profiles.rs","lineNumber":430,"sourceCode":"\n        if bytes.is_empty() {\n            return Ok(PersistedAuthProfiles::default());\n        }\n\n        let mut persisted: PersistedAuthProfiles =\n            serde_json::from_slice(&bytes).with_context(|| {\n                format!(\n                    \"Failed to parse auth profile store at {}\",\n                    self.path.display()\n                )\n            })?;\n\n        if persisted.schema_version == 0 {\n            persisted.schema_version = CURRENT_SCHEMA_VERSION;\n        }\n\n        if persisted.schema_version > CURRENT_SCHEMA_VERSION {\n            anyhow::bail!(\n                \"Unsupported auth profile schema version {} (max supported: {})\",\n                persisted.schema_version,\n                CURRENT_SCHEMA_VERSION\n            );\n        }\n\n        Ok(persisted)\n    }\n\n    async fn write_persisted_locked(&self, persisted: &PersistedAuthProfiles) -> Result<()> {\n        if let Some(parent) = self.path.parent() {\n            fs::create_dir_all(parent).await.with_context(|| {\n                format!(\n                    \"Failed to create auth profile directory at {}\",\n                    parent.display()\n                )\n            })?;\n        }","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/auth/profiles.rs#L412-L448","documentation":"`read_persisted_locked` rejects an auth-profiles.json whose `schema_version` exceeds `CURRENT_SCHEMA_VERSION` (1). A version of 0 is tolerated and silently upgraded; anything above the compiled-in maximum means the file was written by a newer ZeroClaw and may contain fields this binary cannot safely interpret. Because every store operation reads through this path, one newer file blocks all auth profile I/O.","triggerScenarios":"Opening a state directory written by a newer zeroclaw release (schema_version 2+) with an older binary; syncing or replicating the state dir between machines running different versions.","commonSituations":"Downgrading after trying a pre-release; CI using an older image against a home-dir volume produced by a newer local build; shared dotfiles managers pushing a newer store to an older host.","solutions":["Upgrade the zeroclaw binary to at least the version that wrote the file","Or move the file aside (e.g. `auth-profiles.json.bak`) and re-authenticate into a fresh store","Do not hand-edit `schema_version` down — newer field layouts can silently lose or corrupt data","Pin one zeroclaw version across machines that share the state directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let raw = tokio::fs::read_to_string(store.path()).await.unwrap_or_default();\nif let Ok(v) = serde_json::from_str::<serde_json::Value>(&raw) {\n    if v[\"schema_version\"].as_u64().unwrap_or(1) > 1 {\n        // written by a newer build: upgrade the binary or quarantine the file before store ops\n    }\n}","typeGuard":null,"tryCatchPattern":"match store.load().await {\n    Ok(d) => d,\n    Err(e) if e.to_string().contains(\"schema version\") => {\n        return Err(anyhow!(\"auth store written by a newer zeroclaw; upgrade or remove {}\", store.path().display()));\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Pin one zeroclaw version across machines that share a state directory","Back up auth-profiles.json before upgrades","Never hand-lower schema_version to silence the error"],"tags":["schema","versioning","auth","profiles","rust"],"backgroundTag":"schema-version-mismatch","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}