Skip to content

[Windows] "Organization settings could not be loaded" gate blocks startup; app-server never spawns; codex app-server daemon start fails with os error 5 #50608

Open

Description

@fei259

Version / platform

Desktop (Microsoft Store MSIX) OpenAI.Codex 26.930.3930.0 (x64), bundled CLI / app-server 0.160.0. codex doctor: 22 ok, 0 fail. ChatGPT Plus, personal workspace (no Business/Enterprise). Windows 11 build 10.0.26200, zh-CN. Internet access requires a local HTTP proxy (system proxy enabled, 127.0.0.1:9674).

What I am seeing

On every launch the desktop app shows the native modal "Organization settings could not be loaded" ("The app is paused until your organization settings can be loaded safely. A network connection, proxy, or firewall may be preventing access. Check your connection and try again, or sign out and use another account..."). Buttons: Retry / Sign out / Quit.

The app never renders its UI, and no Codex backend process is ever spawned.

Retry, Sign out and signing back in, switching proxy exit nodes, resetting the app package data (311.9 MB -> 3.9 MB), and even launching with a fresh empty CODEX_HOME all reproduce it. Codex CLI and Codex on the web work fine on this machine with the same account and network. This started right after the desktop app and the standalone CLI were updated.

Evidence

1. The app fails before its own logging subsystem initializes. Logs normally land in %LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\<yyyy>\<MM>\<dd>\codex-desktop-*.log. The last log file is from the last successful run and shows working requirements reads:

info [AppServerConnection] response_routed ... method=configRequirements/read ... durationMs=2   errorCode=null
info [AppServerConnection] response_routed ... method=configRequirements/read ... durationMs=97  errorCode=null

Every launch afterwards (8 launches, including after an app-package reset) produced zero new log files, even though that directory is writable by this user.

2. The app-server is never spawned. Sampling the process tree for 40 s after launch, only the Electron main process plus helpers exist (crashpad-handler, gpu-process, network.mojom.NetworkService, storage.mojom.StorageService):

 5s: ChatGPT.exe 6 processes | codex.exe backend 0
10s: ChatGPT.exe 6 processes | codex.exe backend 0
...
30s: ChatGPT.exe 6 processes | codex.exe backend 0

No renderer process, no \\.\pipe\codex-*, no app-server-control.sock.

3. codex app-server daemon start fails deterministically - this is the exact operation the app needs during startup:

PS> codex app-server daemon start
Installing daemon from CLI version 0.160.0 into C:\Users\<user>\.codex\packages/app-server-daemon...
Error: 拒绝访问。 (os error 5)

PS> codex app-server daemon version
Error: failed to connect to C:\Users\<user>\.codex\app-server-control\app-server-control.sock
Caused by:
    套接字操作遇到了一个已死的网络。 (os error 10050)

This is not a generic filesystem permission problem: the same user can write to that very directory, and the ACL grants FullControl (inherited) to SYSTEM, Administrators and the user:

OK   C:\Users\<user>\.codex\packages\app-server-daemon\releases\_t.tmp
OK   C:\Users\<user>\.codex\packages\app-server-daemon\_t.tmp

4. Cloudflare challenges the workspace-policy endpoint while a sibling endpoint succeeds. Using the account's stored ChatGPT token through the same proxy:

Request Result
GET https://chatgpt.com/backend-api/codex/models?client_version=0.160.0 200 OK
GET https://chatgpt.com/backend-api/accounts/{account_id}/workspace_policy 403, Cf-Mitigated: challenge
GET https://chatgpt.com/backend-api/me 403, Cf-Mitigated: challenge
GET .../workspace_policy without an auth header 403, Cf-Mitigated: challenge

Identical with a Chrome User-Agent, with a codex/0.160.0 User-Agent, and with no User-Agent at all; the body is the Cloudflare interstitial. The app-server itself does honor the system proxy and reaches the backend:

INFO codex_http_client::client: Request completed method=GET
  url=https://chatgpt.com/backend-api/codex/models?client_version=0.160.0 status=200 OK
DEBUG reqwest::connect: proxy(http://127.0.0.1:9674/) intercepts 'https://chatgpt.com/'

What I already ruled out

  • config.toml corruption: 3837 bytes, 0 NUL bytes, no BOM, parses cleanly with tomllib; codex doctor reports config.toml parse ok and config loaded.
  • Local user-state corruption: launching with a brand-new empty CODEX_HOME reproduces the failure identically.
  • Database corruption: codex doctor reports rollout files and state DB thread inventory agree; all SQLite integrity checks ok.
  • Auth: stored auth mode: chatgpt, tokens present and valid.
  • App package data: reset via Windows Settings, relaunch -> same modal.
  • Reinstall / app update: the issue survived both.
  • Proxy node switch and sign out / sign in: no change.

Expected behavior

With healthy local data, valid auth and a working network path to the backend, the desktop app should load its workspace requirements and start, as it did before the update.

Suggestions

  1. Surface the underlying error (file/line, or the failing fetch with its HTTP status) instead of the generic network/proxy/firewall text - duplicate reports show users reinstalling and renaming data directories for hours.
  2. If organization settings cannot be loaded, fall back to unrestricted defaults instead of hard-blocking the app before the renderer starts.
  3. Investigate whether codex app-server daemon installation can fail with os error 5 on machines where the target directory is writable, and whether the desktop app reports that failure as a policy-load failure.
  4. Treat a Cloudflare challenge (HTTP 403 + Cf-Mitigated: challenge) on /backend-api/accounts/*/workspace_policy as retryable/transient rather than a hard block.

Related reports

#49663, #49469, #50311, #49845

Activity

  1. added
    bug
    app
    windows-os
    app-server
    connectivity
    on Oct 3, 2026
  2. fei259 commented on Oct 3, 2026

    @fei259
    Author

    Follow-up: daemon install failure confirmed as part of this, and further narrowing

    Adding hard evidence gathered on the affected machine. Two things: (a) the app-server daemon install genuinely fails at startup, and (b) the app still hard-fails after that is worked around, before it does anything observable.

    1. codex app-server daemon start fails deterministically — same root cause as #49449

    PS> codex app-server daemon start
    Installing daemon from CLI version 0.160.0 into C:\Users\<user>\.codex\packages/app-server-daemon...
    Error: 拒绝访问。 (os error 5)
    

    This is the operation the desktop app needs during startup. Per the analysis in #49449, the failing call is std::fs::rename(stage, release) in prepare_install.rs — MoveFileEx on a directory returns ERROR_ACCESS_DENIED while something (scanner/handle) briefly holds a file inside the freshly-written ~427 MB tree. Staging is complete but releases/ stays empty.

    Workaround applied (from #49449 / #50285), which works: pre-stage the full vendor tree so release.try_exists() is true and the warm path skips the rename:

    # copy the complete 45-file vendor tree (bin\codex.exe, bin\codex-code-mode-host.exe,
    # codex-path\, codex-resources\, codex-package.json) into:
    #   %USERPROFILE%\.codex\packages\app-server-daemon\releases\0.160.0-x86_64-pc-windows-msvc

    After that, codex app-server daemon start no longer fails with os error 5, and the daemon metadata is created correctly:

    app-server-daemon\current  -> Junction -> ...\releases\0.160.0-x86_64-pc-windows-msvc
    app-server-daemon\auto-update-version  = 0.160.0-x86_64-pc-windows-msvc
    

    (It then stopped at "this Windows launcher prevents background processes from outliving it" when invoked through the PATH launcher — expected for a launcher shim, and not relevant to the desktop app, which uses its own bundled binary.)

    2. The desktop app still fails hard, and does nothing observable

    With the daemon metadata now in place, the app still shows the same modal on every launch, and:

    • No logs are written at all. The app's log directory (...\LocalCache\Local\Codex\Logs\<yyyy>\<MM>\<dd>\) receives zero new files on every launch since the breakage — including after manually pre-creating the directory tree and verifying it is writable.
    • No network requests are issued. All ChatGPT traffic on this machine goes through a local proxy; a successful app-server run logs reqwest::connect: proxy(http://127.0.0.1:9674/) intercepts 'https://chatgpt.com/' and gets /backend-api/codex/models → 200. During app startup, nothing appears in the proxy log from the app or any Codex child process.
    • No backend process is ever spawned. Sampling for 40–50 s: only the Electron main process plus helpers (crashpad / gpu / network / storage). No renderer, no codex.exe, no \\.\pipe\codex-*, no app-server-control.sock.
    • The modal is a native #32770 dialog with CommandButton_100/101/102 (Retry / Sign out / Quit), shown before any UI renders.

    3. Things ruled out by direct test on this machine

    Hypothesis Test performed Result
    Corrupted config.toml (per #49663, #50311) 3837 bytes, 0 NUL bytes, no BOM, parses with tomllib; codex doctor: config.toml parse ok not the cause
    config.toml content in general Replaced with a minimal 138-byte config (provider + auth only, no [desktop] section) and relaunched identical failure; the app did not even rewrite the file
    Local user state (per #49663) Launched with a brand-new empty CODEX_HOME identical failure
    App package state Reset package data via Windows Settings (data 311.9 MB → 3.9 MB; package re-registered per AppX deployment log) identical failure
    Missing daemon metadata Pre-staged release + correct current junction + auto-update-version; verified identical failure
    Missing/unwritable log directory Pre-created the full Logs\<yyyy>\<MM>\<dd> tree, verified writable app wrote nothing
    Auth codex doctor: stored auth mode: chatgpt, tokens valid; CLI reaches inference endpoint healthy
    Databases codex doctor: rollout files and state DB thread inventory agree; all SQLite integrity ok healthy
    Proxy / node Multiple exit nodes tried no change
    Sign out / sign in Performed modal returns immediately

    4. Request

    Two independent problems seem to be in play, and both deserve a fix:

    1. The daemon installer's std::fs::rename failing with ERROR_ACCESS_DENIED (Windows 0.159.2: daemon install os error 5 is at std::fs::rename(stage, release), not the junction in #48853 #49449, Windows daemon updater fails with Access denied (os error 5); manual package installation succeeds #50285). A MoveFileEx retry loop, or staging on the target volume before populating, would make this robust — a partially staged release must never be indistinguishable from a working one, and the error should name the failing path/operation rather than surfacing a bare os error 5.
    2. The startup policy gate being fail-closed and unobservable. When workspace requirements cannot be established, the app blocks before the renderer starts, emits no log line, issues no network request, and shows a generic "network, proxy, or firewall" message. unknown policy state != explicit policy decision — as raised in Desktop app stuck on "Organization settings could not be loaded" after auto-update to 26.930.2377.0 (works fine on 26.928.4866.0) #50254, the "policy absent / not applicable" case for a personal (non-managed) workspace should resolve to unrestricted rather than hard-blocking, and the UI should distinguish "policy unavailable" from "policy denied".

    Environment: Windows 11 build 10.0.26200 x64; Store MSIX OpenAI.Codex 26.930.3930.0; bundled CLI 0.160.0; codex doctor 22 ok / 0 fail; ChatGPT Plus personal workspace.

    Related: #49449, #50285, #50254, #49663, #49469, #50311, #49845

  3. edwardswhiskeyblues-alt commented on Oct 4, 2026

    @edwardswhiskeyblues-alt

    Additional reproducible evidence from another Windows machine, using the same affected desktop build:

    Environment

    • Windows 11/Windows NT build 10.0.26300.0, x64
    • Package: OpenAI.Codex_26.930.3930.0_x64__2p2nqsd0c76g0
    • AppX status: Ok
    • WinHTTP: direct access; Windows user proxy disabled
    • Browser access to ChatGPT works on the same machine/account

    Distinguishing evidence

    A previous desktop build, 26.928.3736.0, had remained resident and usable since before the update. After installing 26.930.3930.0:

    1. Launching from the Windows app list or via the registered AUMID OpenAI.Codex_2p2nqsd0c76g0!App produces the blocking “Organization settings could not be loaded” modal.
    2. AppModel Runtime records successful process creation for the new package followed by container destruction approximately one second later. This was reproduced twice (2026-10-04 20:18:02 and 20:25:58 local time).
    3. A shortcut targeting the stable AUMID through explorer.exe shell:AppsFolder\OpenAI.Codex_2p2nqsd0c76g0!App reproduces the same failure. Therefore this is not caused by a stale shortcut or a versioned executable path.
    4. Running the official installer again reports that no update is available. Clicking the installer’s Open button restores a usable window, but process inspection shows that window is still backed by the older resident package path (26.928.3736.0). No persistent root UI process from 26.930.3930.0 is present.

    The installer’s Open action can therefore mask the regression by reactivating an older surviving process, while every clean activation path for the newly installed build fails at the workspace-policy gate.

    No reset, sign-out, or uninstall was attempted after identifying this, because the older resident instance is the only working session and contains ongoing work.

    Assessment

    This strongly suggests a build-specific workspace-policy/auth recovery regression rather than a general installation, shortcut, DNS, proxy, or firewall failure. It also exposes a side-by-side activation ambiguity: after an update, Open may focus an older resident process instead of proving that the newly installed package started successfully.

    It would help if the dialog surfaced the actual failing endpoint/status and the running package version, and if the installer/update flow detected and handled an older resident instance explicitly.

  4. MazDragon commented on Oct 5, 2026

    @MazDragon

    Adding a local native-Windows reproduction of the app-server daemon version failure with OS error 10050 shown in section 3 of this report. The matching evidence is the default control-socket connection failure. The organization-settings dialog and the daemon installer's OS error 5 have not been reproduced in this test, so a shared root cause is unconfirmed.

    Environment and scope:

    • Installed Codex CLI executable verified as version 0.160.0.
    • Delegated diagnostic shell: PowerShell 7.6.6, non-elevated.
    • The same command was also run directly by the account owner in a normal, non-administrator PowerShell window and returned the same error.
    • Native local Windows execution; no SSH or WSL was involved in this reproduction.
    • The running app-server version remains unknown because the version probe cannot connect. The current Desktop app build and exact Windows build were not collected.

    Minimal read-only reproduction:

    codex app-server daemon version

    Result, with the personal profile path redacted:

    Error: failed to connect to <USERPROFILE>\.codex\app-server-control\app-server-control.sock
    
    Caused by:
        A socket operation encountered a dead network. (os error 10050)
    

    Observed on 2026-10-05 (UTC):

    1. At 04:50:44, one default codex app-server proxy read attempt exited with code 1 and OS error 10050 before application-level initialization.
    2. Around 05:17, the built-in app-server daemon version diagnostic reproduced the native control-socket connection failure.
    3. Around 05:19, the direct non-administrator PowerShell run reproduced the error above.

    An earlier generic proxy-failure record exists from 2026-10-03 with 0.159.0-alpha.12.1. These observations do not establish a regression introduced specifically in 0.160.0.

    Technical notes:

    • In the official 0.160.0 daemon client, connect_at() calls UnixStream::connect() before the WebSocket upgrade; initialization follows only after that succeeds. The reported “failed to connect to” context identifies this earlier stage.
    • The stdio-to-UDS proxy also connects through codex_uds::UnixStream and then relays bytes.
    • The Windows UDS implementation uses uds_windows::UnixStream::connect() and an asynchronous wrapper. The error alone does not identify which Windows operation failed or establish a general internet/LAN outage.
    • A separate custom probe had a framing bug: it sent newline-delimited JSON instead of performing a WebSocket handshake. That probe was corrected and passed 23 offline tests, but the corrected probe has not been live-validated. The built-in daemon-version reproduction is independent of that custom probe and fails before WebSocket upgrade.

    No daemon restart, alternate socket, network/security setting change, credential read, or transcript read was performed for this reproduction. No account or quota result was obtained.

    Related symptom: #22965 reports the same default-socket OS error 10050 through app-server proxy, but its reproduction uses Remote SSH. This comment adds a local reproduction without that SSH bootstrap layer.

    Is this a known native-Windows AF_UNIX/default-control-socket failure? A supported, non-mutating diagnostic that distinguishes an absent or stale daemon from a native socket/launcher problem would help, especially one that preserves active sessions and existing permissions.

  5. xingyun-code commented on Oct 5, 2026

    @xingyun-code

    Confirming this exact signature on a second machine, and adding the missing piece: a reboot after the MSIX update fixed it.

    Environment

    • Windows, Codex desktop MSIX OpenAI.Codex_26.930.6422.0 (x64), bundled CLI codex-cli 0.160.0
    • Personal ChatGPT account (no Business/Enterprise workspace), local HTTP proxy 127.0.0.1:10792

    Timeline (local time, UTC+8)

    18:41:40–18:41:42 — the update 26.930.3930.0 → 26.930.6422.0 was registered. System event log:

    18:41:40  7040  The start type of the ChatGPT service was changed from Auto to Disabled
    18:41:41  7045  A service was installed in the system.
                    Service Name: ChatGPT
                    File Name: "...\WindowsApps\OpenAI.Codex_26.930.6422.0_x64__2p2nqsd0c76g0\app\resources\codex-windows-sandbox-service.exe"
                    Service Start Type: Auto    Service Account: LocalSystem
    18:41:41  7040  IsolationSession start type: On-demand -> Auto
    18:42:11  7040  IsolationSession start type: Auto -> On-demand
    

    18:41 → 19:13 — every launch failed identically and quickly (~4 s):

    • zero new files in %LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\<yyyy>\<MM>\<dd>\ (exactly as you reported)
    • no codex.exe app-server process and no app-server handshake
    • each attempt left a new empty directory %LOCALAPPDATA%\OpenAI\Codex\bin\.staging-2ffcf3015ebd52b4-<random> — 12 accumulated, none ever became a real directory
    • Retry looped (dialog dismissed and returned); Sign out / relaunch did not help

    Resolution: reboot

    19:14:16  boot
    19:14:29  packaged service started (codex-windows-sandbox-service.exe)
    19:14:54  app started
    19:14:55  the runtime materialized for the first time:
                %LOCALAPPDATA%\OpenAI\Codex\bin\2ffcf3015ebd52b4\
                    codex.exe (326 MB), codex-code-mode-host.exe,
                    codex-command-runner.exe, codex-windows-sandbox-setup.exe
                %LOCALAPPDATA%\OpenAI\Codex\bin\0f15060ef4040ea6\   (rg.exe)
              the previous 2026-10-03 runtime directories were removed,
              and all .staging-* directories were cleaned up automatically
    19:14:59  app-server spawned -> gate cleared
    

    The first lines of the new desktop log name the failing step

    11:14:59.177Z info windows_core_runtime_component_resolved ... component=codex      copiedRuntimeLocation=true
    11:14:59.179Z info windows_core_runtime_component_resolved ... component=app-server copiedRuntimeLocation=true
    11:14:59.179Z info windows_core_runtime_component_resolved ... component=node       copiedRuntimeLocation=true
    11:14:59.179Z info windows_core_runtime_component_resolved ... component=ripgrep    copiedRuntimeLocation=true
    11:14:59.179Z info [StdioConnection] stdio_transport_spawned
                        executablePath=...\AppData\Local\OpenAI\Codex\bin\2ffcf3015ebd52b4\codex.exe pid=25012
    11:14:59.224Z info windows_core_runtime_launch_selected ... selectedRuntimeSource=bundled
    11:15:07.024Z info response_routed ... method=configRequirements/read ... errorCode=null
    

    Suggested mechanism

    The failing step is Windows core-runtime materialization: copy the bundled components into
    %LOCALAPPDATA%\OpenAI\Codex\bin\<hash> via a .staging-<hash>-<random> directory followed by an atomic rename.
    After the update that copy never completed, so <hash>\codex.exe never existed, the app-server was never
    spawned, and the startup-requirements read failed with a message that (misleadingly) blames the network.

    Two details that made this so hard to diagnose, and that may be worth fixing:

    1. This step runs before the desktop log file is opened. That is why there are zero new log files —
      the "no logs" symptom is exactly what this failure should produce, not evidence of something exotic.
      Please consider opening the log file, or buffering, earlier.
    2. The MSIX update re-registered the packaged service (old ChatGPT service disabled, a new one
      installed pointing at the new package path). That servicing state appears to need a restart to settle,
      and the app has no visible way to recover from it short of a reboot.

    Ruled out on this machine

    • config.toml: parses cleanly with tomllib, no duplicate keys, no malformed lines, no NUL bytes;
      mtime predates the update. Neither the "duplicate notify key" nor the "appearanceLightChromeTheme
      split across lines" workarounds applied here.
    • Filesystem permissions: copying the bundled 311 MB codex.exe into %LOCALAPPDATA%\OpenAI\Codex\
      succeeds in 0.14 s.
    • Network: GET https://chatgpt.com/backend-api/codex/models → 200 OK from the same machine through
      the same proxy. (GET /backend-api/me did return 403 Cf-Mitigated: challenge, but that is not what
      blocked startup here.)
    • Local auth/state: auth.json, .codex-global-state.json, and all SQLite DBs pass integrity checks.
    • Daemon socket: ~\.codex\packages and ~\.codex\app-server-control did not exist before the reboot, and
      codex app-server daemon version failed with os error 10050. However on Windows the desktop app uses
      stdio transport ([StdioConnection] in the log), so the daemon socket is likely a red herring for this
      symptom.

    Practical workaround for anyone hitting this

    1. After a desktop update, if you get the "Organization settings could not be loaded" dialog, look at
      %LOCALAPPDATA%\OpenAI\Codex\bin. If you see only empty .staging-<hash>-<random> directories and no
      real <hash> directory
      , you are hitting this same step.
    2. Reboot. The packaged service restarts and the runtime copy completes.
    3. Retry / Sign out / reinstall / resetting package data do not help.
  6. LanceSandino commented on Oct 7, 2026

    @LanceSandino

    I can't get it working on mac os intel 26.1002.52244

    I had issue with preivous version too. I'm stuck on 26.917.71314 for now.

    Tried removing .codex and nothing.

    Edit

    I had a hook setting the CODEX_CLI_PATH and that was breaking it... uninstalled and updated and working!

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

    appapp-serverbugconnectivitywindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions