{"record":{"id":"9f1bbbc0a4a726d1","repo":"spacedriveapp/spacedrive","slug":"contentidentity-missing-uuid","errorCode":null,"errorMessage":"ContentIdentity missing UUID","messagePattern":"ContentIdentity missing UUID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/src/ops/media/proxy/processor.rs","lineNumber":120,"sourceCode":"\t\tentry: &ProcessorEntry,\n\t) -> Result<ProcessorResult> {\n\t\tif !self.enabled {\n\t\t\treturn Ok(ProcessorResult::success(0, 0));\n\t\t}\n\n\t\t// Get content UUID\n\t\tlet content_uuid = if let Some(content_id) = entry.content_id {\n\t\t\tuse crate::infra::db::entities::content_identity;\n\t\t\tuse sea_orm::{ColumnTrait, EntityTrait, QueryFilter};\n\n\t\t\tlet ci = content_identity::Entity::find()\n\t\t\t\t.filter(content_identity::Column::Id.eq(content_id))\n\t\t\t\t.one(db)\n\t\t\t\t.await?\n\t\t\t\t.ok_or_else(|| anyhow::anyhow!(\"ContentIdentity not found\"))?;\n\n\t\t\tci.uuid\n\t\t\t\t.ok_or_else(|| anyhow::anyhow!(\"ContentIdentity missing UUID\"))?\n\t\t} else {\n\t\t\treturn Ok(ProcessorResult::failure(\n\t\t\t\t\"Entry has no content_id\".to_string(),\n\t\t\t));\n\t\t};\n\n\t\tdebug!(\"→ Generating scrubbing proxy for: {}\", entry.path.display());\n\n\t\t// Call shared generation function\n\t\tlet count = super::generate_proxy_for_file(\n\t\t\t&self.library,\n\t\t\t&content_uuid,\n\t\t\t&entry.path,\n\t\t\t&[self.variant.clone()],\n\t\t\tself.use_hardware_accel,\n\t\t\t&self.preset,\n\t\t\tfalse, // Don't regenerate in processor\n\t\t)","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/core/src/ops/media/proxy/processor.rs#L102-L138","documentation":"The content_identity row was found but its uuid column is NULL. The proxy generator keys generated artifacts off content_uuid (stable across path changes), so a NULL uuid makes proxy generation impossible. Rows without uuid come from partial inserts, older schema versions before the column existed without backfill, or write paths that skip uuid assignment.","triggerScenarios":"Database migrated from a version where content_identity.uuid was not populated; a code path inserting content_identity without setting uuid; an interrupted update that cleared the column.","commonSituations":"Upgrades without uuid backfill migrations; mixed-version clients writing to one library; hand-crafted or restored rows missing the column value.","solutions":["Backfill content_identity.uuid for existing rows (generate v4 uuids) via migration","Audit all content_identity insert paths to confirm uuid is always set","Skip and re-identify affected entries so a fresh, complete identity row is written"],"exampleFix":"-- before: rows like (id, uuid=NULL, ...)\n-- after: backfill migration\nUPDATE content_identity SET uuid = random_blob(16) WHERE uuid IS NULL; -- sqlite example; use proper uuid generation","handlingStrategy":"type-guard","validationCode":"// Skip identities lacking a uuid and queue them for re-identification\nlet usable = ci.as_ref().map_or(false, |c| c.uuid.is_some());\nif !usable { /* re-identify entry instead of proxying */ }","typeGuard":"fn has_content_uuid(ci: &content_identity::Model) -> bool {\n    ci.uuid.is_some()\n}","tryCatchPattern":"let content_uuid = match ci.uuid {\n    Some(u) => u,\n    None => return Ok(ProcessorResult::failure(\"ContentIdentity missing UUID\".to_string())),\n};","preventionTips":["Backfill content_identity.uuid in migrations that introduce the column","Assert uuid is set on every content_identity insert path (and in tests)","Audit restored/imported databases for NULL uuids before enabling proxies"],"tags":["proxy","content-identity","migration","data-integrity"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}