{"record":{"id":"3a9ebec64c4cdd76","repo":"astrid-runtime/astrid","slug":"fuse-provider-registry-filename-does-not-match-its","errorCode":null,"errorMessage":"FUSE provider registry filename does not match its mount identity: {}","messagePattern":"FUSE provider registry filename does not match its mount identity: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/registry.rs","lineNumber":68,"sourceCode":"    let entries = std::fs::read_dir(&directory);\n    let entries = match entries {\n        Ok(entries) => entries,\n        Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(records),\n        Err(error) => return Err(error).context(\"read FUSE provider registry\"),\n    };\n    for entry in entries {\n        let entry = entry?;\n        let path = entry.path();\n        if path.extension().is_none_or(|extension| extension != \"json\") {\n            continue;\n        }\n        let record: MountRecord = serde_json::from_slice(&std::fs::read(&path)?)\n            .with_context(|| format!(\"decode FUSE provider record {}\", path.display()))?;\n        if path\n            .file_stem()\n            .is_none_or(|stem| stem.to_string_lossy() != record.mount_id.to_string())\n        {\n            anyhow::bail!(\n                \"FUSE provider registry filename does not match its mount identity: {}\",\n                path.display()\n            );\n        }\n        let key = path_key(&record.mountpoint)?;\n        if let Some(existing) = records.insert(key, record.clone()) {\n            anyhow::bail!(\n                \"duplicate FUSE provider mountpoint {} in records {} and {}\",\n                record.mountpoint.display(),\n                existing.mount_id,\n                record.mount_id\n            );\n        }\n    }\n    Ok(records)\n}\n\n/// Atomically persist one private record.","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/registry.rs#L50-L86","documentation":"When loading the FUSE provider registry, each record file's filename stem must equal the mount_id stored inside the JSON record. A mismatch means the file was renamed, copied, or corrupted, so load_registry bails rather than trusting inconsistent registry state.","triggerScenarios":"Manually renaming a record file in the registry directory; copying a record file to a new name; a crash or tooling writing a record under the wrong filename; restoring backups with stale names.","commonSituations":"Hand-editing or scripts renaming registry files; syncing registry dirs between machines; partial cleanup that renamed but did not rewrite records.","solutions":["Rename the file so its stem matches the record's mount_id field","Delete the offending record file if the mount is stale","Regenerate the registry by re-registering the mount","Inspect the JSON record to confirm its mount_id before renaming"],"exampleFix":"// before\nmv abc123.json deadbeef.json   # stem no longer matches mount_id\n// after\n# keep filename stem equal to record.mount_id\nmv deadbeef.json abc123.json","handlingStrategy":"validation","validationCode":"fn record_filename_matches(path: &std::path::Path, mount_id: uuid::Uuid) -> bool {\n    path.file_stem()\n        .map(|s| s.to_string_lossy() == mount_id.to_string())\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match load_registry() {\n    Err(e) if e.to_string().contains(\"does not match its mount identity\") => {\n        eprintln!(\"registry file renamed/corrupted; remove or rename the offending record\");\n    }\n    other => other?,\n}","preventionTips":["Never rename registry record files manually or in scripts","Let the library create and clean up registry records","Back up and restore the registry directory atomically (whole directory)","Validate registry consistency after restoring from backups"],"tags":["registry","corruption","naming"],"backgroundTag":"internal-invariant-violation","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}