{"record":{"id":"f97f91cf905aad3f","repo":"unicity-aos/aos-ce","slug":"bundled-label-executable-is-not-executable-at","errorCode":null,"errorMessage":"bundled {label} executable is not executable at {}","messagePattern":"bundled (.+?) executable is not executable at (.+?)","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/unicity-aos-bootstrap/src/lib.rs","lineNumber":544,"sourceCode":"                )\n            } else {\n                error\n            }\n        })?;\n        if !metadata.is_file() {\n            return Err(io::Error::new(\n                io::ErrorKind::NotFound,\n                format!(\n                    \"bundled {label} executable not found at {}\",\n                    binary.display()\n                ),\n            ));\n        }\n        #[cfg(unix)]\n        {\n            use std::os::unix::fs::PermissionsExt;\n            if metadata.permissions().mode() & 0o111 == 0 {\n                return Err(io::Error::new(\n                    io::ErrorKind::PermissionDenied,\n                    format!(\n                        \"bundled {label} executable is not executable at {}\",\n                        binary.display()\n                    ),\n                ));\n            }\n        }\n        Ok(())\n    }\n}\n\nfn create_private_dir(path: &Path) -> io::Result<()> {\n    fs::create_dir_all(path)?;\n    let metadata = fs::symlink_metadata(path)?;\n    if metadata.file_type().is_symlink() || !metadata.is_dir() {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidInput,","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/crates/unicity-aos-bootstrap/src/lib.rs#L526-L562","documentation":"This io::Error (PermissionDenied) is thrown by ensure_runtime_executable in crates/unicity-aos-bootstrap/src/lib.rs when a bundled executable exists as a regular file but its Unix permission bits grant no execute access to anyone (mode & 0o111 == 0). The library checks the binary before spawning it so a confusing exec failure never happens later; here the file was found but is not runnable as-is.","triggerScenarios":"Calling foreground_daemon_command or ensure_runtime_available (or run/spawn variants that call ensure_runtime_executable) when the binary at the resolved runtime path exists and is a file, but has permission bits like 0644/0600 — i.e. no x bit for user, group, or other.","commonSituations":"The bundled binary was extracted from an archive (tar/zip) that lost the execute bit; a package or container build copied the file without preserving permissions; a post-install chmod step was skipped; the file was written programmatically with default non-executable permissions.","solutions":["Restore the execute bit: chmod +x <path shown in the error message> and retry.","Re-extract or reinstall the bundled artifact in a way that preserves the executable permission (tar -xpf, correct umask).","If packaging the binary yourself, set mode 0755 (or at least 0o111 bits) on the file in the build/install step.","Verify with 'ls -l <path>' that at least one execute bit (u/g/o) is set before re-running."],"exampleFix":"// before (shell): archive extraction lost the exec bit\ntar -xzf aos-bundle.tar.gz -C /opt/aos\n// after\nchmod +x /opt/aos/bin/runtime && tar -xzf aos-bundle.tar.gz -C /opt/aos  # or chmod after extraction","handlingStrategy":"validation","validationCode":"use std::os::unix::fs::PermissionsExt;\nlet md = std::fs::metadata(&binary)?;\nif !md.is_file() || md.permissions().mode() & 0o111 == 0 {\n    return Err(format!(\"{} is missing the execute bit; run: chmod +x {}\", binary.display(), binary.display()));\n}","typeGuard":null,"tryCatchPattern":"match std::fs::metadata(&binary) {\n    Ok(md) if md.is_file() && md.permissions().mode() & 0o111 != 0 => { /* proceed */ }\n    _ => eprintln!(\"bundled runtime missing or not executable; run `chmod +x <path>` or reinstall\"),\n}","preventionTips":["Extract bundles with tools that preserve the executable bit (tar -xpf) instead of unzip where possible.","Add a chmod +x step to install scripts and containerfiles after copying the binary.","Verify the packaged file mode (0755) in CI before publishing artifacts."],"tags":["filesystem","permissions","rust","unix"],"backgroundTag":"permission-denied","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"}