Linux x86_64 glibc distro fails to execute bundled x86_64-unknown-linux-musl binary → ENOENT
What version of Codex is running?
unkown
What subscription do you have?
plus
Which model were you using?
gpt codex
What platform is your computer?
ubuntu 22
What issue are you seeing?
installed the package globally on Ubuntu (x86_64 glibc distro) and when running:
npm install -g @openai/codex
codex
I get the error:
Error: spawn /home/denis/.nvm/versions/node/v22.21.1/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex ENOENT
Even though the binary is present and executable:
ls -l ~/.nvm/versions/node/v22.21.1/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex
-rwxrwxr-x 1 denis denis … codex
Using strace:
execve("/home/…/vendor/x86_64-unknown-linux-musl/codex/codex", […] ) = -1 ENOENT (No such file or directory)
And checking loader:
ls -l /lib/ld-musl-x86_64.so.1
No such file or directory
What steps can reproduce the bug?
On a glibc-based Linux distribution (for example Ubuntu 22.04 x86_64), install Node (via nvm) and choose a version such as v22.21.1.
Install the CLI globally:
npm install -g @openai/codex
After installation, run:
codex --version
or simply codex.
Observe that the CLI fails with:
Error: spawn …/vendor/x86_64-unknown-linux-musl/codex/codex ENOENT
Confirm that the binary file exists and has -rwx permissions.
Run strace on the binary path to confirm execve returns ENOENT.
Check for the presence of musl loader:
ls /lib/ld-musl-x86_64.so.1
which on glibc systems will not exist, confirming the incompatibility.
What is the expected behavior?
Running codex on glibc-based Linux (Ubuntu 22.04 x86_64) should succeed or give a clear error message pointing to binary loader incompatibility—not an opaque ENOENT.
Environment
OS: Ubuntu 22.04 (x86_64, glibc)
Node: v22.21.1 via nvm
npm install -g @openai/codex (latest stable)
Binary path: vendor/x86_64-unknown-linux-musl/codex/codex
Root cause (hypothesis)
The release includes a Linux binary target x86_64-unknown-linux-musl (musl libc) only. On glibc-based distributions (like Ubuntu), there is no ld-musl-x86_64.so.1 loader by default, so execve returns ENOENT despite the file existing. The wrapper script doesn’t detect or adapt accordingly.
Additional information
_No response_
11 Comments
I ran into the same issue for 0.54 on my ubuntu desktop (using the
x86_64-unknown-linux-gnubuild). I got codex running again by reverting back to 0.53More context:
OS: Ubuntu 24.04.2 LTS
Node: v24.6.0
npm: v11.6.0
exactly same issue I experience as well:
error: spawn /home/.../tools/image/packages/@openai/codex/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex ENOENT at ChildProcess._handle.onexit (node:internal/child_process:285:19) at onErrorNT (node:internal/child_process:483:16) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) { errno: -2, code: 'ENOENT', syscall: 'spawn /home/.../tools/image/packages/@openai/codex/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex', path: '/home/.../tools/image/packages/@openai/codex/lib/node_modules/@openai/codex/vendor/x86_64-unknown-linux-musl/codex/codex', spawnargs: [] }
Ubuntu 22.04
Tried to install sudo apt install -y musl, than codex stopped loading at all. No errors. Downgraded to 0.53 and it work again
the same here
Same error in Debian GNU/Linux 13 (trixie) with npm 10.9.4 and nodejs 20.19.2
<img width="923" height="144" alt="Image" src="https://github.com/user-attachments/assets/6c1aee63-7db1-4950-80ef-175939147947" />
they forgot to add the glibc binary for Ubuntu/Debian, downgrade back to 0.52/0.53 for the time being and it will work.
Thanks for the detailed bug report.
The offending change was reverted:
https://github.com/openai/codex/pull/6222
and the new build with the fix is in flight:
https://github.com/openai/codex/actions/runs/19081250342
Bug Report: CLI fails on Linux due to incorrect path and missing dependency
Package:
@openai/codexSummary
The
@openai/codexCLI tool is currently unusable on standard Linux distributions for two main reasons:ENOENT(file not found) error.muslDependency: The binary is dynamically linked against themuslC library. This dependency is not documented. On systems that useglibcby default (like most Linux distributions), the binary fails to execute with acannot execute: required file not founderror, because themuslinterpreter is missing.Steps to Reproduce
muslC library pre-installed.``
bash
``npm install -g @openai/codex
``
bash
``codex --version
Expected Behavior
The CLI should either:
musldependency and providing instructions on how to install it.Actual Behavior
The command fails with the following error due to the incorrect path:
If the path issue is manually corrected (e.g., by creating a symlink), a second error occurs because of the missing dependency:
System Information
@openai/codexVersion: Latest available on npmAnalysis
The executable is an ELF 64-bit LSB pie executable, dynamically linked with the
muslinterpreter, as shown by thefilecommand:This confirms that the missing
/lib/ld-musl-x86_64.so.1is the cause of the second error.Recommended Solutions
.../node_modules/@openai/codex/....codexbinary during compilation. This would create a dependency-free executable that runs on any standard Linux distribution without requiring users to install additional libraries.musldependency in theREADME.mdfile, including installation instructions for major Linux distributions (e.g.,sudo apt-get install muslfor Debian/Ubuntu,sudo dnf install musl-libcfor Fedora/CentOS).We're back in business!
That's crazy. I can now imagine how the Codex degradation happened.
but honestly, this happens to the best of us
This has been fixed in v0.55.0, and v0.54.0 has been marked as deprecated. Thanks for the speedy reports folks.
Still not working on
0.63.0on OpenSUSE with neithernpm -gnor withdeno compile🙄So much for """10x developers""", how many SWE's are needed to statically link binaries against
muslin Rust? Go kinda does it for free, but I guess that's too much to ask for a vibe-coded vibecoding tool 🙃 but hey ItS MeM0ry S4Fe 🤡