{"record":{"id":"17eb099e5ad1ff51","repo":"Hmbown/CodeWhale","slug":"android-loaded-image-is-not-an-executable-reg","errorCode":null,"errorMessage":"Android loaded image `{}` is not an executable regular file; refusing to select an update target","messagePattern":"Android loaded image `(.+?)` is not an executable regular file; refusing to select an update target","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/update.rs","lineNumber":462,"sourceCode":"            \"failed to canonicalize Android loaded-image mapping {}\",\n            mapping.path.display()\n        )\n    })?;\n    if resolved_dladdr != resolved_mapping {\n        bail!(\n            \"Android loaded-image authorities disagree: dladdr resolved to {}, but /proc/self/maps resolved to {}\",\n            resolved_dladdr.display(),\n            resolved_mapping.display()\n        );\n    }\n    if is_android_linker_name(&resolved_mapping) {\n        bail!(\n            \"Android loaded-image authorities resolved to runtime linker {}; refusing to use the linker as an update target\",\n            resolved_mapping.display()\n        );\n    }\n    if !is_executable_file(&resolved_mapping) {\n        bail!(\n            \"Android loaded image `{}` is not an executable regular file; refusing to select an update target\",\n            resolved_mapping.display()\n        );\n    }\n\n    validate_android_mapping_identity(&mapping, &resolved_mapping)?;\n    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() {","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/update.rs#L444-L480","documentation":"After both path authorities agree and the path is not the linker, the updater stats the resolved file to confirm it is an executable regular file before selecting it as the update target. If it is missing, a directory, a symlink to nothing, or lacks the execute bit, the updater refuses — replacing such a path would not yield a runnable updated binary.","triggerScenarios":"android_loaded_executable_proof when is_executable_file() returns false for the resolved mapping path (file deleted after mapping, permissions stripped, path now points at a non-regular file).","commonSituations":"The binary was deleted or replaced on disk while the process still ran (maps refers to the unlinked inode path); a package manager or cleaner app removed the app's native lib/binary; the executable bit was lost after copying the binary manually (common when extracting from an archive on Android).","solutions":["Re-install the binary freshly so a live executable file exists at the path, then re-run the update.","Restore the execute bit: `chmod 755 <path-to-binary>`, then retry.","Verify with `ls -l` and `stat` that the resolved path from the error message exists, is a regular file, and is executable.","If the binary was replaced underneath the running process, kill the old process and start the newly installed binary by its full path before updating again."],"exampleFix":"// before\ncp codewhale $PREFIX/bin/ && $PREFIX/bin/codewhale update   # exec bit lost\n// after\ninstall -m 755 codewhale $PREFIX/bin/codewhale && $PREFIX/bin/codewhale update","handlingStrategy":"validation","validationCode":"use std::os::unix::fs::PermissionsExt;\nfn is_executable_file(p: &std::path::Path) -> bool {\n    std::fs::metadata(p)\n        .map(|m| m.is_file() && m.permissions().mode() & 0o111 != 0)\n        .unwrap_or(false)\n}\nif !is_executable_file(&target) { /* reinstall or chmod before updating */ }","typeGuard":null,"tryCatchPattern":"match run_update() {\n    Err(e) if e.to_string().contains(\"not an executable regular file\") => {\n        // prompt: reinstall the release, then retry\n    }\n    other => other?,\n}","preventionTips":["Always copy releases with the executable bit set (install -m 755).","Never delete or replace a binary that a running process was started from.","Verify the target exists and is executable before triggering self-update.","Exclude install directories from cleaner apps / aggressive package managers."],"tags":["android","self-update","filesystem","permissions"],"backgroundTag":"file-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}