codex exec fails on Android (Termux): "lock() not supported" in acquire_app_server_startup_lock
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- android, rust
- Domain
- cli, operating-systems
Research direction
Start in app-server-transport/src/transport/unix_socket.rs at acquire_app_server_startup_lock, then compare the existing Android guards in codex-rs/core/src/installation_id.rs and codex-rs/arg0/src/lib.rs. Done means codex exec can initialize on Android without the lock() not supported error while the startup-lock file remains open.
Written by the indexing model from the issue text.
Description
Problem
When running codex exec on Android (Termux), the following error occurs at startup:
Error: failed to initialize in-process app-server client: lock() not supported
Root cause: acquire_app_server_startup_lock in
app-server-transport/src/transport/unix_socket.rs calls file.lock()
unconditionally. On Android, flock(2) is unsupported on the /data
partition (returns ENOTSUP), which surfaces as "lock() not supported".
Reproduction:
- Environment: Android (
target_os = "android"), Termux (aarch64), Node v24 - Command:
codex exec "echo hello"(inside a git repo) - Error:
Error: failed to initialize in-process app-server client: lock() not supported
Fix
Add #[cfg(not(target_os = "android"))] before file.lock()?;:
- file.lock()?;
+ #[cfg(not(target_os = "android"))]
+ file.lock()?;
The identical guard is already applied in two other places in this codebase:
codex-rs/core/src/installation_id.rs:32-33codex-rs/arg0/src/lib.rs:329-330
The AppServerStartupLock struct still holds the file open for the process
lifetime (UDS path cleanup on drop). Only the advisory lock acquisition is
skipped on Android.
A branch with this fix is available at:
bash0816:fix/android-startup-lock-unix-socket
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100