{"record":{"id":"c26d6023e973cfe5","repo":"astrid-runtime/astrid","slug":"live-astrid-volume-has-no-name","errorCode":null,"errorMessage":"live Astrid volume has no name","messagePattern":"live Astrid volume has no name","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/astrid-core/src/dirs_layout_records.rs","lineNumber":205,"sourceCode":"                path.display()\n            ),\n        ));\n    }\n    crate::platform_fs::verify_no_redirects(&path)\n}\n\npub(super) fn verify_receipt_destination_is_live_path(\n    destination: &LayoutTreeIdentityV1,\n    live_path: &Path,\n) -> io::Result<()> {\n    let parent = live_path.parent().ok_or_else(|| {\n        io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"live Astrid volume has no parent\",\n        )\n    })?;\n    let file_name = live_path.file_name().ok_or_else(|| {\n        io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"live Astrid volume has no name\",\n        )\n    })?;\n    let canonical_parent = std::fs::canonicalize(parent)?;\n    if physical_path(destination)? != canonical_parent.join(file_name) {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidData,\n            \"layout migration receipt destination path does not match the live Astrid volume\",\n        ));\n    }\n    verify_receipt_destination_authority(destination)\n}\n\nfn physical_path(destination: &LayoutTreeIdentityV1) -> io::Result<PathBuf> {\n    let bytes = hex::decode(&destination.physical_path_hex)\n        .map_err(|error| io::Error::other(format!(\"decode layout destination path: {error}\")))?;\n    encoded_bytes_to_os_string(bytes).map(PathBuf::from)","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-core/src/dirs_layout_records.rs#L187-L223","documentation":"verify_receipt_destination_is_live_path extracts the file-name component of the live Astrid volume path after checking its parent. If the path has no final file-name component (e.g. it ends in \"..\" or is a directory root), file_name() returns None and this InvalidInput error is raised. The name is needed to join with the canonicalized parent for the receipt comparison.","triggerScenarios":"Called via retire_verified_legacy_source with a live_path such as \"/some/dir/..\" or \"/\" where Path::file_name() yields None, immediately after the parent check succeeds.","commonSituations":"A trailing \"..\" or \".\" left in a configured path; path normalization not performed before passing the live volume path; template-expanded config leaving a dangling path segment.","solutions":["Normalize the live path (strip trailing \".\"/\"..\") so it terminates in an actual file name.","Use path.canonicalize() or clean the configured value before invoking retirement.","Verify the config value points directly at the volume file, not its containing directory."],"exampleFix":"// before\nlet live_path = Path::new(\"/var/lib/astrid/..\");\n// after\nlet live_path = std::fs::canonicalize(\"/var/lib/astrid\")?.join(\"volume.bin\");","handlingStrategy":"validation","validationCode":"let live = Path::new(&volume_config);\nif live.file_name().is_none() {\n    return Err(\"live volume path must end in a concrete file name\");\n}","typeGuard":null,"tryCatchPattern":"match retire_verified_legacy_source(...) {\n    Err(e) if e.kind() == std::io::ErrorKind::InvalidInput && e.to_string().contains(\"no name\") => normalize_and_retry(),\n    other => other,\n}","preventionTips":["Canonicalize configured paths before use to strip \".\"/\"..\" segments.","Reject configs with trailing path separators or relative components.","Use std::fs::canonicalize on the live path before passing it in."],"tags":["filesystem","path","configuration","io"],"backgroundTag":"invalid-config-value","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}