Windows elevated sandbox setup fails when `node_repl.exe` is running (OS error 32)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 18/100
Research direction
The failure comes from the Windows elevated sandbox setup helper, which logs an ACL validation on the node_repl.exe runtime under cua_node; the issue does not name the source file, so first locate where the helper opens ACL targets for the runtime root-only update. Reproduce by running a sandboxed codex exec while an interactive session holds node_repl.exe open. Done would mean setup succeeds with that executable in use, without weakening the sandbox ACL requirements.
Written by the indexing model from the issue text.
Description
Environment
- Windows 11 Home, build 10.0.26300
windows.sandbox = "elevated"- Affected setup helpers:
- npm CLI
0.160.1(@openai/codex-win32-x64,codex-windows-sandbox-setup.exe) - App-server daemon
0.161.0and0.162.0
- npm CLI
- Codex runtime present at
%LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe, used by thenode_replMCP server
Observed behavior
Sandboxed Codex commands intermittently fail with:
helper_unknown_error: setup refresh had errors
The sandbox log (~/.codex/.sandbox/sandbox.<date>.log) reports:
runtime read/execute validation failed: validate runtime read/execute access on C:\Users\<user>\AppData\Local\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe: open ACL target for root-only update: The process cannot access the file because it is being used by another process. (os error 32)
setup refresh completed with errors: [...]
setup error: setup refresh had errors
setup refresh: exited with status ExitStatus(ExitStatus(1))
The same refresh also reports a non-fatal OS error 32 while attempting to update an ACE on the user-profile directory.
Evidence
- Examined 28 failed sandbox refreshes over approximately 24 hours. All 28 reported the same
node_repl.exefile-sharing error. - The failures began when
node_replwas first used on this machine (~/.codex/node_repl/created at the time of the first failure), although thecua_noderuntime had been installed about two weeks earlier. Approximately 1,060 earlier refreshes in the examined logs had no recorded errors. - Failures also occurred with
codex exec --ignore-user-config, suggesting the behavior is not controlled solely by the user's[mcp_servers.node_repl]configuration. - The executable already had an inherited Modify permission for
CodexSandboxUsers. The helper nevertheless failed while opening the target for its ACL operation. - In observed sessions, sandbox refreshes resumed succeeding after the sessions hosting
node_repl.exeexited and that process terminated.
The relationship between process lifetime and failures is supported by observations and timestamps, but was not captured through simultaneous process and file-handle tracing.
Possible cause (unconfirmed)
The sandbox setup helper may be opening runtime executables with access or sharing flags incompatible with a running executable.
This could cause a Windows sharing violation (ERROR_SHARING_VIOLATION, OS error 32) during ACL validation or modification.
The exact file-opening flags and internal helper behavior have not been verified.
Expected behavior
Codex sandbox initialization should succeed while other Codex sessions are using Codex-provided runtime executables.
Potential fixes to investigate include:
- Opening ACL targets with compatible sharing flags.
- Avoiding unnecessary ACL operations when effective permissions are already sufficient.
- Handling executable-in-use sharing violations without aborting setup, provided sandbox security requirements remain satisfied.
Suggested reproduction (inferred; not deliberately reproduced)
- Install or initialize the Codex runtime containing
cua_node. - Configure Windows elevated sandbox mode.
- Start an interactive Codex session that launches the
node_replMCP server, and confirmnode_repl.exeis running. - In another terminal, execute:
codex exec --ignore-user-config -c windows.sandbox="elevated" --sandbox workspace-write "Run git status."
- Sandbox initialization may fail with
setup refresh had errors. Inspect~/.codex/.sandbox/sandbox.<date>.logfor the sharing violation onnode_repl.exe.
Workaround
Exit interactive Codex sessions hosting node_repl.exe and wait for that process to terminate before dispatching another sandboxed Codex worker.
This has restored successful sandbox initialization in the observed cases.
- Dominant language
- Rust
- Stars
- 129k
- Forks
- 20.3k
- Avg merge
- 1m
- Merged PRs (30d)
- 998
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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
-
bug context
Difficulty 2/5 Under an hour Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Standalone Unix updater reports success when curl fails (`curl | sh` masks the exit status); Windows path is unaffectedPossibly taken @akhil9tiet claimed this 1 day ago. Openbug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openai/codex#54465 · 1 comment ·
Maintainers usually reply within 1 day
-
codex-skills-extension: pass ModelInfo context window in SkillsExtension::contribute_thread_contextOpenbug CLI context skills
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
apply_patch drops trailing spaces from filenamesPossibly taken @akhil9tiet claimed this 5 days ago. Openbug tool-calls
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openai/codex#53245 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
test: sim_zero_omega_tests race on shared temp-file names, so two pairs of tests fail at randomOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
pop-os/cosmic-comp#2956 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:release criticality:p3 documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
registrystack/registry-stack#2085 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
libp2p/rust-libp2p#6694 ·
Maintainers usually reply within 1 day