codex icon indicating copy to clipboard operation
codex copied to clipboard

Chat GPT for Windows: duplicate CodexSandboxService errors / ERROR_NO_TOKEN (1008) on every boot and AppXDeployment/AppXDeployment-Server errors 0x8007045B and 0x80080008

Open mdruy opened this issue 1 month ago • 6 comments

What version of the Codex App are you using (From “About Codex” dialog)?

26.930.3930.0

What subscription do you have?

Plus

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64

What issue are you seeing?

This is a long-standing, repeatedly reproduced problem with the installed ChatGPT desktop app. Two CodexSandboxService errors appear after every Windows boot, even when I do not open ChatGPT or use Codex.

It also happens when using only ordinary ChatGPT chat or Work. Starting a coding task is not required.

I have encountered this over previous weeks and months on:

  • Windows 11 Pro 25H2 and 26H2, including earlier builds.
  • Previous Windows installations and fresh clean installations.
  • Other devices with the ChatGPT desktop app installed.

It is not limited to the current build or initial sandbox setup.

App reset does not help. A clean Windows reinstall and fresh ChatGPT installation do not resolve it. In my troubleshooting, signing out of and removing the ChatGPT desktop app stops the recurring errors; they return with the app installed.

Related: #50009 reports the same failing uninstall-listener operation, but with os error 2. My underlying error is os error 1008, and the reproduction occurs during Windows boot without launching the app.

What steps can reproduce the bug?

  1. Install the ChatGPT desktop app from Microsoft Store and sign in.
  2. Restart Windows.
  3. Do not manually launch ChatGPT or use Codex. (also tried with launching)
  4. Open the Windows Application event log.
  5. Observe two Event ID 1003 errors from CodexSandboxService.OpenAI.Codex.
  6. Observe also other errors such as Failed to start system service: appxsvc with error: 0x8007045B.
  7. Repeat the restart: the same errors return.

What is the expected behavior?

The installed background service should start successfully without producing duplicate errors after every single boot, including when ChatGPT is not opened or used.

Additional information

Actual error displayed in Event Viewer

This appears twice:

Provider: CodexSandboxService.OpenAI.Codex
Event ID: 1003

Cannot complete this function.

unable to restore package uninstall listener: open the logged-in user's token: An attempt was made to reference a token that does not exist. (os error 1008)

The displayed heading and localized Windows error suffix are rendered in English from the Dutch originals. Technical operation names, error codes, and timestamps are preserved.

Additional recorded errors

AppXDeployment:

Failed to start system service: appxsvc with error: 0x8007045B.

This also appeared twice during the latest captured restart.

Previously recorded AppXDeployment / AppXDeployment-Server notification error:

UnregisterNotification for AppId[{BE166B82-A8B7-40A0-B083-5D4748CC237F}] AppExtensionName[*] with error 0x80080008.

Codex sandbox provisioning failure — Event ID 2001:

Codex sandbox provisioning failed: helper_sandbox_lock_failed: lock sandbox bin dir \\?\C:\Users\<user>\.codex\.sandbox-bin failed: open directory \\?\C:\Users\<user>\.codex\.sandbox-bin

Preserved event timestamp: 2026-10-01T21:26:52.0218873Z.

Repeated helper error in retained sandbox logs:

hide users: failed to hide current user profile dir (C:\Users\Default): SetFileAttributesW failed for C:\Users\Default: 5 (Access is denied.)

Current verified environment

  • Windows 11 Pro, x64.
  • Registry DisplayVersion: 26H2.
  • Reported build: 26300.9550.
  • Microsoft Store package: OpenAI.Codex.
  • App version: 26.930.3930.0.
  • Current desktop-managed Codex CLI: 0.160.0.
  • Sandbox service: Running / Automatic / LocalSystem.
  • AppXSvc: currently Running / Auto / LocalSystem.

Latest directly verified restart

3 October 2026, Europe/Brussels time (UTC+2):

Time Observation
22:44:56 Windows restart requested.
22:44:59 Two AppXDeployment errors, appxsvc / 0x8007045B.
22:45:20.500 Windows starts.
22:45:27.7263682 AppXSvc records transition to Running.
22:45:27.7869001 First CodexSandboxService Event 1003.
22:45:27.7874953 Event 1000: “The Codex sandbox service is running.”
22:45:27.7886646 Second identical Event 1003.

The duplicate token errors occur approximately 7.3 seconds after OS startup, with the same service process ID.

The AppX errors in this capture occur during shutdown. Their timing does not establish that all listed errors have one underlying cause.

Diagnostic findings

Current codex doctor --json reports 22 OK and 3 warnings, with completed sandbox provisioning and successful desktop initialization. Later sandbox logs also contain successful setup steps.

Those successful checks do not resolve or explain the recurring boot-time errors. The older provisioning failure and notification error are preserved from previous troubleshooting; the latest boot errors were read directly from the current Windows event logs.

Please investigate the duplicate missing-user-token errors during automatic service startup and whether the listener should defer or retry initialization. This problem has persisted across builds and clean installations, and requires a fix beyond another app reset or Windows reinstall.

mdruy avatar Oct 03 '26 21:10 mdruy

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

  • #50009

Powered by Codex Action

github-actions[bot] avatar Oct 03 '26 21:10 github-actions[bot]

Further verified evidence, including a restart without clearing any event logs. This corrects the earlier statement that the errors occur on every restart: they were absent on the latest restart. It does not establish a permanent fix.

Current Store package: OpenAI.Codex_26.930.7945.0_x64__2p2nqsd0c76g0; bundled CLI 0.160.1; Windows 11 Pro build 26300.9550. The service remains Automatic / LocalSystem and is running. No startup configuration or service ACL was changed during this investigation.

Missing-token errors: startup order and source code

Two boot sequences on 7 October 2026, local time UTC+2, read directly from the retained Windows logs:

Observation Boot with errors Boot without errors
OS startup 01:48:40.500 02:16:38.500
User logon, LocalSessionManager event 21 01:49:32.3836824 02:16:45.8780274
Service running, Application event 1000 01:48:47.9265151 02:16:45.9329985
Service event 1003 / os error 1008 2, immediately before and after event 1000 0
AppXDeployment event 302 / 0x8007045B during the preceding shutdown and new boot 2 0

On the failing boot, the two token errors precede the recorded user logon by about 44 seconds. On the successful boot, user logon precedes the service-running event by about 55 ms.

The ProvisionedInstallation registry record under HKLM\SOFTWARE\OpenAI\Codex\WindowsSandboxService exists. Its owner SID matches the current user and its session ID is 1, matching the current session; runtime is null. These values were checked before and after the successful reboot. The record was not deleted or edited.

Restarting only the sandbox service while the user was logged in, at 02:10:11, also succeeded with no new event 1003 or AppX event 302. This was a diagnostic restart, not a permanent fix.

The public source in tag rust-v0.160.1 contains the matching path:

  • package_lifecycle.rs: restore_logged_in_owner tries the recorded session and other enumerated sessions. restore_authenticated_user calls WTSQueryUserToken and wraps failure with 'open the logged-in user's token'.
  • service/runtime_lifecycle.rs: restore_owner logs the failure as event 1003 but returns success. It runs before the service-running event and again through the session-refresh callback.
  • ipc.rs: after on_ready, the initial loop refreshes the recorded owner before blocking. This accounts for two startup restoration attempts.

The installed service binary contains the matching error strings and imports WTSQueryUserToken and WTSEnumerateSessionsW. The tag agrees with the bundled CLI version; an exact service-build/source hash match has not been independently verified.

PR #45224 registers desktop uninstall ownership before sandbox setup, so this path also applies to ordinary desktop usage without starting a coding task.

AppX errors and the log-cleaning procedure

The failing capture records a real Windows restart request (System/User32 event 1074) at 01:48:19.8398759, user logoff at 01:48:21.2613888, and a system-shutdown notification at 01:48:21.2963699. AppXSvc reports Stopping at 01:48:21.5268214. The two AppX event 302 errors follow at 01:48:21.5278762 and 01:48:21.5283963, both from PID 14524. Kernel-General events 13 and 12 independently record OS shutdown and the next startup.

The previous-boot identity of PID 14524 was not captured, so the exact emitting app/service call remains unproved. The AppX errors and token errors have not been shown to share one root cause.

An important procedural difference: earlier log clearing used a custom batch file that attempts sc stop eventlog, takes ownership of the Windows event-log directory, grants Administrators full control, deletes EVTX and several ETL/CBS/DISM logs, then invokes shutdown /r /t 0. It does not check success. The latest restart used the normal Windows restart action, without that batch. Multiple conditions changed; the batch has not been proved to cause either error.

The latest shutdown still stopped AppXSvc and the OpenAI service, without AppX event 302. App closure may affect shutdown ordering but has not been isolated in a controlled comparison.

Requested maintainer response

  1. Should a recorded owner who has not yet logged into Windows be treated as deferred restoration rather than generating duplicate event 1003 errors? Is there a released fix or supported workaround for this startup ordering?
  2. Is there a known desktop/uninstall-watcher shutdown path requesting AppXSvc after system shutdown has started? Which trace would reliably identify that caller?
  3. Please identify any supported setting or released fix. The packaged service startup dropdown is disabled; selecting delayed automatic startup in services.msc is not available on this installation.

I am leaving the working installation and service settings unchanged for now and keeping the issue open. One successful reboot does not establish resolution.

mdruy avatar Oct 07 '26 00:10 mdruy

Follow-up — 14 October 2026: please continue the existing investigation using the complete historical evidence already supplied.

This is the same recurring Windows background-service issue reported across weeks/months, app builds and Windows installations. My current observed pattern is the duplicate CodexSandboxService error on every boot/reboot, regardless of whether ChatGPT was opened before or after the restart. The previously documented exceptional test boots do not establish a fix.

The original dossier retains the full Windows event records and context for the duplicate Event 1003 / ERROR_NO_TOKEN 1008 failures, the later occurrence of os error 2 in the same restore operation, and the earlier AppXDeployment Event 302 / 0x8007045B shutdown errors. Other previously supplied evidence includes the AppX notification error 0x80080008 and the historical sandbox provisioning/helper failures. These records must remain part of the investigation; a limited current capture cannot reproduce or replace all older events and does not demonstrate that unobserved error types have stopped.

Existing doctor reports, the available sandbox setup logs, the PDF dossier and original EVTX/XML have already been provided privately. The generic .sandbox/sandbox.log requested earlier does not exist on this installation. The available setup logs are explicitly identified as setup history, not as a boot-time trace.

The support response of 13 October acknowledges the supplied evidence and completed reset/reinstall/update/native-Windows troubleshooting, but refers to public documentation that does not explain these errors or identify a product fix.

Please have the Windows desktop/service team review the actual uninstall-listener startup/shutdown code path and the existing historical records. Please confirm an engineering tracking reference, a supported workaround or fixing release, or the exact additional trace required to establish one. Full identifying logs remain in private support. Related follow-up: https://github.com/openai/codex/issues/51528 . Forum follow-up: https://community.openai.com/t/chatgpt-windows-service-logs-duplicate-error-no-token-1008-at-boot-errors-stop-when-the-app-is-removed/1403904/2 .

mdruy avatar Oct 14 '26 18:10 mdruy

Independent observation on another installation (read-only inspection; not a controlled reproduction):

  • Current environment: Windows 11 Pro 25H2, build 26200.8894; installed Microsoft Store package OpenAI.Codex version 26.1013.4894.0 x64. The installed package version at the times of older events is unknown.
  • In the Windows Application log over the 30 days ending 8 November 2026, provider CodexSandboxService.OpenAI.Codex recorded 22 Error-level events with ID 1003. The EventData for 20 contained unable to restore package uninstall listener: open the logged-in user's token and os error 1008; the other two contained the same operation chain and os error 2.
  • Two of the 1008 records occurred at the same second, about 18 seconds after the most recent OS boot. Whether this was before user logon, and what triggered the attempts, were not established. The service was running when checked later.

This is a log observation, not evidence that the error caused a system freeze or a particular user-facing failure. We did not test every boot or restart the service. Could the maintainers clarify whether an unsuccessful listener restoration has lasting effects after login, and what supported diagnostics would distinguish a transient startup error from a persistent failure?

telemetrya2018-dotcom avatar Nov 08 '26 15:11 telemetrya2018-dotcom

I am on the latest public build (Win 11Pro 26H2 + store-app)

Update:

Additionally, since a few days (might be related to 2026-10 Preview Update (KB5127936) or introduced by 2026-11 Security Update (KB5132061) on 11/11/2026), underlying AppX deployment, AppContainer, and package cleanup bugs introduced in this build are also impacting the Desktop ChatGPT / Codex app.

These 0x80073D02 (ERROR_PACKAGES_IN_USE) errors cannot be resolved on the user side—regardless of any troubleshooting. They only disappear when uninstalling ChatGPT and immediately reappear upon reinstallation:

At every boot (AppXDeployment-Server - 3 errors):

  • Error 0x80073D02: The request cannot be processed because package OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt is in use.
  • Deployment Remove operation with target volume C: on Package OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt from: (OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt) failed with error 0x80073D02.
  • AppX Deployment operation failed for package OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt with error 0x80073D02. The specific error text for this failure is: Error 0x80073D02: The request cannot be processed because package OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt is in use.

Every time the ChatGPT / Codex app is opened (AppXDeployment-Server - 2 errors):

  • Error 0x80073D02: The request cannot be processed because package OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt is in use.
  • Deployment Remove operation with target volume C: on Package OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt from: (OpenAI.CodexPrimaryRuntime.<version>_x64__3k8sg7r9htsxt) failed with error 0x80073D02.

These errors were already appearing occasionally before this update (for months) on exits/reboots as Codex/OpenAI tries to start this system service early (along with the Codex OpenAI Sandbox service not being able to complete the function - error OS 1800 on the subsequent boot):

  • AppXDeployment: Failed to start system service: appxsvc with error: 0x8007045B
  • CodexSandboxService.OpenAI.Codex: unable to restore package uninstall listener: open the logged-in user's token and os error 1008

mdruy avatar Nov 14 '26 02:11 mdruy

November 25 follow-up with a fresh capture after the November 23 Windows reinstall. Windows 11 Pro 26H2 26300.10075, desktop MSIX 26.1120.6357.0. The boot was at 17:46:55 CET. At 17:47:02 the provider CodexSandboxService.OpenAI.Codex recorded two Application events 1003, records 7 and 9. Both report failure to restore the package uninstall listener because opening the logged-in user's token failed with OS error 1008. The service is set to automatic start as LocalSystem.

This is the same listener failure recorded in my September exports. App resets and Windows reinstallations did not prevent the recurrence in my testing. An earlier delayed-start test appeared to help this token symptom in a recorded boot, but did not address all the AppX errors. I also retained 16 AppXDeployment 302 records with 0x8007045B from the November 23 install session. Those records do not identify the initiating package and should be investigated separately from the listener.

Please have the Windows service owner review why listener registration is attempted before a usable logon token is available, whether the service is supposed to defer or retry it, and which supported trace would show that sequence. Please provide a tracking reference or a fixing build. The separate Primary Runtime cleanup failures are documented in #62868.

mdruy avatar Nov 25 '26 18:11 mdruy