{"record":{"id":"53665b8337daedf9","repo":"openai/codex","slug":"failed-to-normalize-system-bubblewrap-path-er","errorCode":null,"errorMessage":"failed to normalize system bubblewrap path {}: {err}","messagePattern":"failed to normalize system bubblewrap path (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/launcher.rs","lineNumber":166,"sourceCode":"fn system_bwrap_launcher_for_path_with_probe(\n    system_bwrap_path: &Path,\n    system_bwrap_capabilities: impl FnOnce(&Path) -> Option<SystemBwrapCapabilities>,\n) -> Option<SystemBwrapLauncher> {\n    if !system_bwrap_path.is_file() {\n        return None;\n    }\n\n    let Some(SystemBwrapCapabilities {\n        supports_argv0,\n        supports_perms: true,\n        supports_ro_bind_fd,\n    }) = system_bwrap_capabilities(system_bwrap_path)\n    else {\n        return None;\n    };\n    let system_bwrap_path = match AbsolutePathBuf::from_absolute_path(system_bwrap_path) {\n        Ok(path) => path,\n        Err(err) => panic!(\n            \"failed to normalize system bubblewrap path {}: {err}\",\n            system_bwrap_path.display()\n        ),\n    };\n    Some(SystemBwrapLauncher {\n        program: system_bwrap_path,\n        supports_argv0,\n        supports_ro_bind_fd,\n    })\n}\n\npub(crate) fn preferred_bwrap_supports_argv0() -> bool {\n    match preferred_bwrap_launcher() {\n        BubblewrapLauncher::System(launcher) => launcher.supports_argv0,\n        BubblewrapLauncher::Bundled(_) | BubblewrapLauncher::Unavailable => true,\n    }\n}\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/launcher.rs#L148-L184","documentation":"After the capability probe accepts a system bwrap, its path is normalized with AbsolutePathBuf::from_absolute_path, which only accepts absolute paths. When bwrap is resolved through a relative PATH entry (for example '.', an empty segment, or a relative directory), the discovered path is relative, normalization fails, and system_bwrap_launcher_for_path_with_probe panics with this message.","triggerScenarios":"A $PATH containing a relative directory that resolves to bwrap, for example launching with PATH=bin:/usr/bin from a directory that holds bin/bwrap.","commonSituations":"Launch scripts exporting relative PATH entries; systemd units with malformed Environment=PATH values; embedded or portal environments that assemble PATH dynamically.","solutions":["Make every PATH entry absolute, e.g. export PATH=\"$PWD/bin:/usr/bin:$PATH\"","Fix the service unit or container environment so PATH contains no relative or empty segments","Launch codex with a sanitized, fully absolute PATH"],"exampleFix":"# before -- relative PATH entry, discovered bwrap path is relative\nPATH=bin:/usr/bin ./bin/codex\n\n# after -- absolute entries only\nPATH=\"$PWD/bin:/usr/bin\" \"$PWD/bin/codex\"","handlingStrategy":"validation","validationCode":"fn path_entries_are_absolute() -> bool {\n    std::env::var_os(\"PATH\")\n        .map(|v| {\n            v.to_string_lossy()\n                .split(':')\n                .all(|p| p.starts_with('/'))\n        })\n        .unwrap_or(false)\n}\n\nif !path_entries_are_absolute() {\n    return Err(\"PATH contains relative entries; bwrap lookup would panic\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never put '.', an empty segment, or a relative directory in PATH","Set PATH explicitly in service units and container entrypoints","Log PATH at startup in services that use the Linux sandbox"],"tags":["bubblewrap","path","environment","linux-sandbox","panic"],"backgroundTag":"relative-path-in-path-variable","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}