{"record":{"id":"a1ad1322ee028556","repo":"spacedriveapp/spacedrive","slug":"invalid-sidecar-format","errorCode":null,"errorMessage":"Invalid sidecar format: {}","messagePattern":"Invalid sidecar format: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"core/src/service/sidecar_manager.rs","lineNumber":163,"sourceCode":"\t\t// Build presence map\n\t\tlet mut presence_map: HashMap<Uuid, HashMap<String, SidecarPresence>> = HashMap::new();\n\n\t\tfor sidecar in sidecars {\n\t\t\tlet entry = presence_map\n\t\t\t\t.entry(sidecar.content_uuid)\n\t\t\t\t.or_insert_with(HashMap::new);\n\n\t\t\tlet path = self\n\t\t\t\t.compute_path(\n\t\t\t\t\t&library.id(),\n\t\t\t\t\t&sidecar.content_uuid,\n\t\t\t\t\t&kind,\n\t\t\t\t\t&SidecarVariant::new(&sidecar.variant),\n\t\t\t\t\t&sidecar\n\t\t\t\t\t\t.format\n\t\t\t\t\t\t.as_str()\n\t\t\t\t\t\t.try_into()\n\t\t\t\t\t\t.map_err(|e: String| anyhow::anyhow!(e))?,\n\t\t\t\t)\n\t\t\t\t.await?;\n\n\t\t\tentry.insert(\n\t\t\t\tsidecar.variant.clone(),\n\t\t\t\tSidecarPresence {\n\t\t\t\t\tlocal: true,\n\t\t\t\t\tpath: Some(path.relative_path),\n\t\t\t\t\tstatus: sidecar\n\t\t\t\t\t\t.status\n\t\t\t\t\t\t.as_str()\n\t\t\t\t\t\t.try_into()\n\t\t\t\t\t\t.map_err(|e: String| anyhow::anyhow!(e))?,\n\t\t\t\t\tdevices: vec![],\n\t\t\t\t},\n\t\t\t);\n\t\t}\n","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/service/sidecar_manager.rs#L145-L181","documentation":"Converting the sidecar row's format string into SidecarFormat via TryInto failed while building sidecar availability; the passthrough error names the invalid value. The database contains a format identifier this build does not recognize, and one bad row aborts the whole availability listing for that content.","triggerScenarios":"A sidecar row written by a newer version with formats this version does not know; manually edited or imported databases; a format variant renamed or removed between versions.","commonSituations":"Downgrading an install; experimental formats enabled earlier and later removed; a sync peer on a newer version writing formats the local build cannot parse.","solutions":["Query the sidecar table for the affected content and inspect its format values; normalize or delete unknown ones","Skip rows with unknown formats (warn and continue) instead of failing the entire availability listing","On upgrade, run a data migration that maps or prunes retired format identifiers"],"exampleFix":"// before\nlet format = sidecar.format.as_str().try_into().map_err(|e: String| anyhow::anyhow!(e))?;\n\n// after\nlet Ok(format) = SidecarFormat::try_from(sidecar.format.as_str()) else {\n    warn!(format = %sidecar.format, \"unknown sidecar format, skipping row\");\n    continue;\n};","handlingStrategy":"fallback","validationCode":"// Filter unknown formats out before they abort the listing\nlet known: Vec<&SidecarRow> = rows.iter().filter(|r| SidecarFormat::try_from(r.format.as_str()).is_ok()).collect();","typeGuard":"fn is_known_sidecar_format(value: &str) -> bool {\n    SidecarFormat::try_from(value).is_ok()\n}","tryCatchPattern":"match SidecarFormat::try_from(sidecar.format.as_str()) {\n    Ok(format) => { /* use it */ }\n    Err(_) => {\n        warn!(format = %sidecar.format, \"unknown sidecar format, skipping row\");\n        continue;\n    }\n}","preventionTips":["Migrate or prune retired format identifiers on upgrade","Skip-and-warn on unknown enum values from the database instead of failing the batch","Add a database constraint or write path that only persists known formats"],"tags":["sidecar","data-validation","version-skew","database"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}