{"record":{"id":"24522ec3e0758fc4","repo":"Hmbown/CodeWhale","slug":"android-authority-reported-deleted-loaded-image","errorCode":null,"errorMessage":"Android {authority} reported deleted loaded image `{}`","messagePattern":"Android (.+?) reported deleted loaded image `(.+?)`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/update.rs","lineNumber":455,"sourceCode":"    Ok(AndroidExecutableProof {\n        path: resolved_mapping,\n        device_major: mapping.device_major,\n        device_minor: mapping.device_minor,\n        inode: mapping.inode,\n        proof_kind: AndroidExecutableProofKind::DladdrAndProcMaps,\n    })\n}\n\n#[cfg(any(target_os = \"android\", all(test, unix)))]\nfn validate_android_reported_path(authority: &str, path: &Path) -> Result<()> {\n    if !path.is_absolute() {\n        bail!(\n            \"Android {authority} reported non-absolute loaded-image path `{}`\",\n            path.display()\n        );\n    }\n    if path.to_string_lossy().ends_with(\" (deleted)\") {\n        bail!(\n            \"Android {authority} reported deleted loaded image `{}`\",\n            path.display()\n        );\n    }\n    if is_android_linker_name(path) {\n        bail!(\n            \"Android {authority} identifies runtime linker `{}`; refusing to use the linker as an update target\",\n            path.display()\n        );\n    }\n    Ok(())\n}\n\n#[cfg(any(target_os = \"android\", all(test, unix)))]\nfn validate_android_mapping_identity(\n    mapping: &AndroidImageMapping,\n    candidate: &Path,\n) -> Result<()> {","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/cli/src/update.rs#L437-L473","documentation":"A reported loaded-image path ends with ' (deleted)', the kernel suffix marking that the mapped file was unlinked after the process started. Writing an update to a deleted path is unsafe/meaningless, so the updater refuses and asks you to restart or reinstall first.","triggerScenarios":"Android self-update after the binary file was replaced or removed while the process keeps running: a previous in-place self-update already swapped the file, or a package manager/cleanup tool unlinked it.","commonSituations":"Re-running update in a session whose binary was already replaced by an earlier update; installers that remove-then-rename during upgrade.","solutions":["Restart the CLI so the process maps the new file, then run update again","If the binary is actually gone, reinstall it with the documented installer","Avoid cleaning/replacing the install directory while the CLI is running"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn current_image_is_deleted() -> bool {\n    std::fs::read_link(\"/proc/self/exe\")\n        .map(|p| p.to_string_lossy().ends_with(\" (deleted)\"))\n        .unwrap_or(false)\n}\n\n// run before self-update:\nif current_image_is_deleted() {\n    eprintln!(\"running image was replaced; restart the process before updating\");\n}","typeGuard":null,"tryCatchPattern":"Catch the error and instruct a restart: after the process re-execs onto the new file, the '(deleted)' suffix disappears and update can proceed.","preventionTips":["Restart long-lived CLI sessions before running update again","Do not delete/replace the install directory while sessions are open","Sequence installers to complete before launching the binary"],"tags":["android","deleted-file","self-update"],"backgroundTag":"deleted-binary-still-running","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}