{"record":{"id":"1644f68d78c0931a","repo":"unicity-aos/aos-ce","slug":"bundled-product-runtime-is-not-installed","errorCode":null,"errorMessage":"bundled product runtime is not installed","messagePattern":"bundled product runtime is not installed","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/unicity-aos-bootstrap/src/migration.rs","lineNumber":617,"sourceCode":"}\n\nfn checked_root(path: &Path, description: &str) -> io::Result<PathBuf> {\n    if !path.is_absolute() {\n        return invalid(&format!(\"{description} must be an absolute path\"));\n    }\n    let metadata = fs::symlink_metadata(path)?;\n    if metadata.file_type().is_symlink() || !metadata.is_dir() {\n        return invalid(&format!(\n            \"{description} must be a real directory, not a symlink\"\n        ));\n    }\n    path.canonicalize()\n}\n\nfn validate_target(target: &Path, release_runtime_bin: &Path) -> 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            \"bundled product runtime is not installed\",\n        )\n    })?;\n    if target_metadata.file_type().is_symlink() || !target_metadata.is_dir() {\n        return invalid(\"bundled 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(\"bundled product runtime bin must be a real directory\");\n            }\n            if fs::read_dir(&bin)?.next().transpose()?.is_some() {\n                return invalid(\n                    \"product runtime home contains data; migration refuses to merge state\",\n                );\n            }","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/crates/unicity-aos-bootstrap/src/migration.rs#L599-L635","documentation":"validate_target checks that the bundled product runtime target exists via symlink_metadata and is a real directory (not a symlink). If the target path does not exist at all, the metadata lookup failure is mapped to this InvalidInput error. It means the migration destination runtime has never been installed.","triggerScenarios":"Calling migrate_runtime with validate flow where the target directory path does not exist on disk (symlink_metadata returns NotFound for the target).","commonSituations":"Running migration before the product installation step completed; a typo'd install prefix; the runtime directory was removed by cleanup or a failed upgrade.","solutions":["Install the bundled product runtime at the target path first, then rerun migrate_runtime","Verify the target path with fs::symlink_metadata(target).is_ok() before migrating","Correct the configured install prefix if the runtime is installed at a different location","Reinstall the product if the directory was deleted by a failed upgrade or cleanup"],"exampleFix":"// before\nmigrate_runtime(&target, ...)?; // target missing\n\n// after\nif target.symlink_metadata().is_err() {\n    install_product_runtime(&target)?;\n}\nmigrate_runtime(&target, ...)?;","handlingStrategy":"validation","validationCode":"fn bundled_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(\"bundled product runtime is not installed\") =>\n        eprintln!(\"install the product runtime at {} first\", target.display()),\n    Err(e) => return Err(e),\n}","preventionTips":["Run product installation before migration in your deployment order","Pre-flight check symlink_metadata on the target path","Pin and verify the install prefix in configuration to avoid path typos","Guard cleanup scripts so they cannot delete the installed runtime directory"],"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"}