{"record":{"id":"62649e9fc2674a5c","repo":"astrid-runtime/astrid","slug":"duplicate-fuse-provider-mountpoint-in-records","errorCode":null,"errorMessage":"duplicate FUSE provider mountpoint {} in records {} and {}","messagePattern":"duplicate FUSE provider mountpoint (.+?) in records (.+?) and (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-provider-fuse/src/registry.rs","lineNumber":75,"sourceCode":"        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.\npub(crate) fn write_record(record: &MountRecord) -> Result<()> {\n    let directory = registry_directory()?;\n    astrid_core::platform_fs::ensure_private_directory(&directory)?;\n    let path = record_path(&record.mount_id)?;\n    let mut bytes = serde_json::to_vec(record)?;\n    bytes.push(b'\\n');\n    astrid_core::platform_fs::atomic_write_private_file(&path, &bytes)?;","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-provider-fuse/src/registry.rs#L57-L93","documentation":"The registry maps canonical mountpoint paths to mount records. During load_registry, if two record files claim the same mountpoint, inserting the second reveals the duplicate and load_registry aborts, since two mounts on one path is ambiguous and unsafe.","triggerScenarios":"Two registry record files containing identical mountpoint values (e.g. a file copied or duplicated under a different name, or two sessions registering the same path without cleanup).","commonSituations":"Manual copy of a record file with a different name; leftover record from a crashed run plus a newly created record for the same path; restoring a backup over an existing registry.","solutions":["Remove one of the duplicate record files (keep the record with the live mount_id)","Delete stale records for mounts that no longer exist and re-register","Check /proc/mounts to see which mount_id is actually live before choosing","Deduplicate by canonical mountpoint path when restoring registries"],"exampleFix":"// before\nrecords: 1111.json {mountpoint:/mnt/fuse}, 2222.json {mountpoint:/mnt/fuse}\n// after\nrm 2222.json   # keep only the live mount's record","handlingStrategy":"validation","validationCode":"fn registry_has_duplicate_mountpoints(paths: &[std::path::PathBuf]) -> std::io::Result<bool> {\n    use std::collections::HashSet;\n    let mut seen = HashSet::new();\n    for p in paths {\n        let rec: serde_json::Value = serde_json::from_slice(&std::fs::read(p)?)?;\n        if !seen.insert(rec[\"mountpoint\"].as_str().unwrap_or_default().to_string()) {\n            return Ok(true);\n        }\n    }\n    Ok(false)\n}","typeGuard":null,"tryCatchPattern":"match load_registry() {\n    Err(e) if e.to_string().contains(\"duplicate FUSE provider mountpoint\") => {\n        eprintln!(\"remove one of the records naming the same mountpoint, then retry\");\n    }\n    other => other?,\n}","preventionTips":["Never copy record files under a new name","Clean up records for dead mounts before re-registering a path","Restore registries by replacing the whole directory, not merging","Deduplicate records by canonical mountpoint after backups"],"tags":["registry","duplicate","mount"],"backgroundTag":"file-already-exists","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}