Skip to content

Windows sandbox cannot spawn local commands: CreateProcessWithLogonW 1326/1909 and spawn setup refresh failure #27170

Open

Description

@neimarwizvip-hash

Summary

On Windows with Codex CLI 0.138.0, local command execution failed while attempting to restore a Google Drive backup into local Windows folders. Even simple read-only shell checks could not start.

Environment

  • OS: Windows
  • Codex CLI: 0.138.0
  • Context: Codex session attempting to restore a Google Drive backup
  • Target local folder: C:\Users\neima\Documents\Projetos Codex Restaurados
  • Related local folder: C:\Users\neima\.codex
  • Backup source: Google Drive folder named Backup Codex completo - instalacao limpa - 2026-05-25

Errors Observed

  • CreateProcessWithLogonW failed: 1326
  • CreateProcessWithLogonW failed: 1909
  • windows sandbox failed: spawn setup refresh

What Happened

The session had access to Google Drive and could locate/list the backup folder, but could not execute local filesystem commands. Attempts to run simple PowerShell commands such as checking the current directory or listing local paths failed before the process started.

A fallback attempt using the Node REPL also failed with:

windows sandbox failed: spawn setup refresh

The failure prevented the session from:

  • confirming local filesystem access;
  • creating destination folders;
  • copying backup files from Drive to C:\Users\neima\Documents\Projetos Codex Restaurados;
  • restoring .codex files into C:\Users\neima\.codex;
  • comparing restored files against the Drive backup.

Expected Behavior

Codex should be able to start local read-only commands, and, when permissions allow, create/copy files into the requested Windows folders. If sandbox or credential state prevents execution, the error should identify the actionable cause and recovery step.

Actual Behavior

Local command execution failed at process startup with Windows sandbox / logon errors, even for trivial commands. Google Drive access worked, but local restore work was blocked.

Impact

A backup restoration workflow cannot proceed even though the remote Drive backup is accessible and intact. The user cannot complete local recovery of Codex projects, configuration, useful chat/session history, or .codex contents through Codex.

Notes

The backup's own instruction file reports approximately 28,551 files, about 13.3 GB, and FALHA 0 in the original copy logs. No local files were deleted or overwritten during this failed restore attempt.

Activity

  1. added
    bug
    CLI
    windows-os
    sandbox
    tool-calls
    on Jun 9, 2026
  2. nayumiDEV commented on Nov 16, 2026

    @nayumiDEV

    Hope this help, run in Powershell with Administrator Permission

    $users = @(Get-LocalUser | Where-Object {
        $_.Name -like 'codex*' -or $_.Description -match 'codex'
    })
    
    if ($users.Count -eq 0) {
        Write-Host 'Cannot find Codex Sandbox accounts. Status list:'
        Get-CimInstance Win32_UserAccount -Filter 'LocalAccount=True' |
            Select-Object Name, Disabled, Lockout
    }
    
    foreach ($u in $users) {
        $path = 'WinNT://{0}/{1},user' -f $env:COMPUTERNAME, $u.Name
        $account = [ADSI]$path
        $account.psbase.InvokeSet('IsAccountLocked', $false)
        $account.psbase.CommitChanges()
    
        $check = [ADSI]$path
        [pscustomobject]@{
            Account = $u.Name
            LockedAfter = [bool]$check.psbase.InvokeGet('IsAccountLocked')
        }
    }
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

    CLIbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions