Skip to content

Windows daemon updater fails with Access denied (os error 5); manual package installation succeeds #50285

Closed as duplicate

Description

@SoftCreatR

What version of Codex CLI is running?

codex-cli 0.160.0 (also reproduced with 0.159.3)

What subscription do you have?

5x

Which model were you using?

gpt-6.1-sol (failure occurs during daemon update, not a model request)

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64; native Windows, not WSL

What terminal emulator and version are you using (if applicable)?

Reproduced from PowerShell 7.6.6. Original terminal emulator/version not recorded.

Codex doctor report

codex doctor --json captured on 2026-10-02 AFTER the manual workaround. Summary only; full report omitted to avoid including local paths and unrelated configuration.

CLI: 0.160.0; overallStatus: warning.
installation: ok (installation looks consistent)
runtime.provenance: ok (running npm on windows-x86_64)
config.load: ok
auth.credentials: ok
updates.status: ok (update configuration is locally consistent)
network.provider_reachability: ok
network.websocket_reachability: ok
state.paths: ok
app_server.status: warning (background server socket is stale or unreachable at report capture time)
Other warnings: optional MCP configuration issues, rollout/state DB inventory differences, TERM=dumb in the non-interactive diagnostic run.

Immediately after the manual workaround, daemon version/start reported the server running on 0.160.0. The later doctor socket warning is recorded here separately; its relationship to the updater failure is unknown.

What issue are you seeing?

Updating the local Windows background server fails and leaves it on an older version than the installed CLI.

The /daemon update action reports:

Updating the local background server...
Error: standalone Codex updater exited with status exit code: 1
Error: Daemon update failed with status exit code: 1

Running the update directly exposes a more specific error:

codex app-server daemon update --from-cli --yes
Error: Zugriff verweigert (os error 5)

(English: Access denied.)

Observed version mismatches:

  • CLI 0.159.3 / managed daemon 0.157.0 on Oct 1, 2026.
  • CLI 0.160.0 / managed daemon 0.159.3 on Oct 2, 2026.

The first mismatch coincided with GPT-6.1 Sol missing from the Windows CLI model picker, although it was available in WSL and the Windows app. Updating the daemon manually restored the model choice (confirmed afterward).

The exact failing filesystem operation and root cause have not been identified.

What steps can reproduce the bug?

Observed on this existing native Windows npm installation (not yet reproduced on a clean installation):

  1. Have a managed background server installed/running at an older version than the CLI.
  2. Update the npm-installed CLI; verify with codex --version.
  3. Try updating the background server via /daemon. It fails with updater/daemon exit code 1.
  4. Run codex app-server daemon update --from-cli --yes in PowerShell. It fails with Zugriff verweigert (os error 5).
  5. Run codex app-server daemon version: the CLI is newer, but the managed/running server remains on the old version.

For the 0.157.0 -> 0.159.3 attempt, stopping the server with codex app-server daemon stop before retrying did not resolve the error.

Please note that the second failure happened after the manual junction workaround described below. The first failure predated that workaround.

What is the expected behavior?

The daemon updater should install the selected CLI package and restart the managed server successfully, bringing the CLI and daemon versions into agreement. If an operation fails, the error should identify the affected path/operation so the cause can be diagnosed, rather than exposing only exit code 1 through /daemon.

Additional information

Installation: global npm package @openai/codex on native Windows. CODEX_HOME uses the default %USERPROFILE%.codex.

Checks during investigation:

  • The installation directory was writable under the current Windows user.
  • The install.lock file could be opened for exclusive read/write access and then closed.
  • Copying the same CLI vendor package into the managed daemon releases directory succeeded.
  • These checks do not prove that every operation performed by the updater has the required access.

Manual workaround used twice:

  1. Copy the installed npm CLI's vendor package into %USERPROFILE%\.codex\packages\app-server-daemon\releases\<version>-x86_64-pc-windows-msvc.
  2. Verify the copied executable's version.
  3. Stop the managed daemon.
  4. Rename the existing current directory junction to a backup junction, preserving the old release.
  5. Create a new current junction targeting the copied release and update the auto-update-version marker to the matching release identifier.
  6. Start the daemon and verify the CLI, managed package, and running server versions agree.

This brought the server to 0.159.3 and later 0.160.0. The original releases/backup junctions remain available; this is a workaround, not a fix to the updater.

No clean-install reproduction or confirmed root cause yet. No thread ID included because the failing operation is daemon management, not a model turn.

Activity

  1. added
    bug
    on Oct 2, 2026
  2. added
    CLI
    windows-os
    app-server
    on Oct 2, 2026
  3. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. aetherxeg-source commented on Oct 2, 2026

    @aetherxeg-source

    For the updater, I would make package installation != runtime convergence explicit.

    There are several independently meaningful identities here:

    requested release -> staged release -> current pointer/junction -> managed package version -> running daemon executable/version

    An update should only report success when the transition reaches a committed generation in which those identities are mutually consistent. If any filesystem operation fails, the previous committed generation should remain authoritative; a partially staged release must not become indistinguishable from the active one.

    A useful fault-injection matrix would fail each mutation point (copy, pointer replacement, marker write, restart) and assert either full convergence on the new generation or clean retention of the old generation—never a mixed state. Recording the exact failed operation/path plus before/after generation identities would also make Access denied actionable without exposing sensitive content.

  5. JohannesGESchmidt commented on Oct 8, 2026

    @JohannesGESchmidt

    I encountered the same generic daemon-updater failure on native Windows (npm CLI 0.161.0), and found a PowerShell module-path cause with a working workaround. This does not establish that the os error 5 reported here has the same cause.

    Diagnosis

    My CLI was 0.161.0 while the installed/running daemon was 0.160.0. The regular update failed with standalone Codex updater exited with status exit code: 1. Updater logs showed successful installer_fetch, followed by failed installer_run.

    Windows Event Viewer revealed the actual error in Microsoft-Windows-PowerShell/Operational: event 4100 reported Get-FileHash was not recognized (CommandNotFoundException). Event 4104 from the same installer process showed it loading:

    C:\Program Files\PowerShell\7\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1
    

    The updater was already launching Windows PowerShell 5.1 (powershell.exe), not pwsh. Its module search path exposed PowerShell 7 modules to that Windows PowerShell process.

    I reproduced the lookup failure by putting the PowerShell 7 Modules directory ahead of native Windows PowerShell modules in PSModulePath inside a Windows PowerShell 5.1 process. With only native Windows PowerShell module paths, Get-FileHash resolved and hashing worked. No matching Defender or AppLocker block events were recorded.

    Verified workaround

    Open a fresh Windows PowerShell 5.1 session directly, rather than running the update from PowerShell 7, then run:

    codex app-server daemon update

    This succeeded on my machine, returning status: updated, installedVersion: 0.161.0, and runningVersion: 0.161.0. No reinstall was needed.

    For completeness, codex app-server daemon update --from-cli --yes had also succeeded before this, bringing the daemon to 0.161.0 and pinning it, but the regular update still failed until I ran it from Windows PowerShell 5.1.

    A possible fix would be to ensure the Windows PowerShell installer child receives compatible module search paths. Surfacing the installer exception alongside exit code 1 would also help diagnosis. Future unattended updates from a PowerShell 7 launch environment have not been verified.

  6. etraut-openai commented on Oct 8, 2026

    @etraut-openai
    Contributor

    @JohannesGESchmidt, thanks for posting. We have a fix in place for this issue. It will be included in the 0.162.0 release, which should be published within the next 12 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIapp-serverbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions