{"record":{"id":"4e8de267a9fbd24a","repo":"unicity-aos/aos-ce","slug":"completed-product-runtime-is-not-installed","errorCode":null,"errorMessage":"completed product runtime is not installed","messagePattern":"completed product runtime is not installed","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/unicity-aos-bootstrap/src/migration.rs","lineNumber":658,"sourceCode":"    for entry in fs::read_dir(target)? {\n        let entry = entry?;\n        let path = entry.path();\n        let metadata = fs::symlink_metadata(&path)?;\n        if path != bin || metadata.file_type().is_symlink() || !metadata.is_dir() {\n            return invalid(\"product runtime home contains data; migration refuses to merge state\");\n        }\n    }\n    Ok(())\n}\n\nfn validate_completed_target(\n    target: &Path,\n    release_runtime_bin: &Path,\n    _receipt: &Receipt,\n) -> io::Result<()> {\n    validate_release_runtime_bin(release_runtime_bin)?;\n    let target_metadata = fs::symlink_metadata(target).map_err(|_| {\n        io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"completed product runtime is not installed\",\n        )\n    })?;\n    if target_metadata.file_type().is_symlink() || !target_metadata.is_dir() {\n        return invalid(\"completed product runtime must be a real directory\");\n    }\n    let bin = target.join(\"bin\");\n    match fs::symlink_metadata(&bin) {\n        Ok(bin_metadata) => {\n            if bin_metadata.file_type().is_symlink() || !bin_metadata.is_dir() {\n                return invalid(\"completed product runtime bin must be a real directory\");\n            }\n            for entry in fs::read_dir(&bin)? {\n                let entry = entry?;\n                let name = entry.file_name();\n                if RUNTIME_EXECUTABLE_NAMES\n                    .iter()","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/crates/unicity-aos-bootstrap/src/migration.rs#L640-L676","documentation":"validate_completed_target mirrors validate_target for the completed-migration path: it requires the target to exist (symlink_metadata) and be a real directory. A missing target maps to this InvalidInput error with the \"completed product runtime\" wording. It indicates the post-migration runtime installation is absent.","triggerScenarios":"Calling migrate_runtime's completed-path validation when the final target directory has not been created or was deleted before validation runs.","commonSituations":"A migration run interrupted before the target was installed; running the completed-state validation against a machine where only staging exists; a wrong receipt/target pairing.","solutions":["Ensure the migration step that installs the completed runtime actually ran and wrote the target directory","Re-run the migration to completion before invoking the completed-state validation","Verify the receipt's recorded target matches the actual installed path"],"exampleFix":"// before\nvalidate_completed_target(&target, &bin, &receipt)?; // target absent\n\n// after\nassert!(target.symlink_metadata().is_ok(), \"runtime not installed\");\nvalidate_completed_target(&target, &bin, &receipt)?;","handlingStrategy":"validation","validationCode":"fn completed_runtime_installed(target: &std::path::Path) -> bool {\n    std::fs::symlink_metadata(target)\n        .map(|m| m.is_dir())\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match migrate_runtime(&target, ...) {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"completed product runtime is not installed\") =>\n        eprintln!(\"migration incomplete; re-run to install the completed runtime\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Only invoke completed-state validation after a migration run reported success","Persist migration state so interrupted runs can resume instead of being validated early","Verify the receipt's target path matches the machine's actual layout"],"tags":["rust","filesystem","migration"],"backgroundTag":"file-not-found","analyzedSha":"f6f22024fb1e8d122f28a1b4a9f75aee448ae839","analyzedAt":"2026-09-13T03:04:44.565Z","contentChangedAt":"2026-09-13T03:04:44.565Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}