openai/codex · error

failed to resolve current executable path

Error message

failed to resolve current executable path: {err}

What it means

Resolving the path of the currently running executable failed while building the inner seccomp-stage command. This panic in build_inner_seccomp_command fires when std::env::current_exe() errors — /proc/self/exe unavailable or unreadable, or exotic launch environments — so the helper cannot re-exec itself inside the bubblewrap sandbox to apply seccomp.

Solutions

  1. Verify /proc is mounted and /proc/self/exe is readable inside the launch environment
  2. Avoid launching the sandbox helper via mechanisms that obscure the exe path (deleted binaries, memfd)
  3. Run the helper from a stable path on disk
  4. Report as a bug with launch-environment details
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1525 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/ffed1f81d534af4e. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/linux-sandbox/src/linux_run_main.rs:1525

    permission_profile: &'a PermissionProfile,
    allow_network_for_proxy: bool,
    proxy_route_spec: Option<String>,
    command: Vec<String>,
}

/// Build the inner command that applies seccomp after bubblewrap.
fn build_inner_seccomp_command(args: InnerSeccompCommandArgs<'_>) -> Vec<String> {
    let InnerSeccompCommandArgs {
        sandbox_policy_cwd,
        command_cwd,
        permission_profile,
        allow_network_for_proxy,
        proxy_route_spec,
        command,
    } = args;
    let current_exe = match std::env::current_exe() {
        Ok(path) => path,
        Err(err) => panic!("failed to resolve current executable path: {err}"),
    };
    let permission_profile_json = match serde_json::to_string(permission_profile) {
        Ok(json) => json,
        Err(err) => panic!("failed to serialize permission profile: {err}"),
    };

    let mut inner = vec![
        current_exe.to_string_lossy().to_string(),
        "--sandbox-policy-cwd".to_string(),
        sandbox_policy_cwd.to_string_lossy().to_string(),
    ];
    if let Some(command_cwd) = command_cwd {
        inner.push("--command-cwd".to_string());
        inner.push(command_cwd.to_string_lossy().to_string());
    }
    inner.extend([
        "--permission-profile".to_string(),
        permission_profile_json,

View on GitHub (pinned to 339751715c)