stablyai/orca · error · Error
Managed Codex home directory does not exist on disk.
Error message
Managed Codex home directory does not exist on disk.
What it means
Thrown by assertManagedHomePath in two cases: (1) WSL branch — the wsl.exe canonicalization returned an empty string, meaning the path does not resolve to a real directory inside the distro (service.ts:1506); (2) the non-Windows-UNC fallback — existsSync(candidatePath) is false (service.ts:1520). Orca will not operate on a managed home that is not actually present on disk.
Source
Thrown at src/main/codex-accounts/service.ts:1506
'managed_root_real=$(readlink -f -- "$managed_root")',
'test -f "$candidate_real/.orca-managed-home"',
...(expectedAccountId === undefined
? [
'case "$candidate_real" in "$managed_root_real"/*/home) printf "%s\\n" "$candidate_real" ;; *) exit 35 ;; esac'
]
: [
`expected_marker=${shellQuote(expectedAccountId)}`,
'test "$candidate_real" = "$managed_root_real/$expected_marker/home"',
'test "$(cat "$candidate_real/.orca-managed-home")" = "$expected_marker"',
'printf "%s\\n" "$candidate_real"'
])
].join('\n')
)
],
{ encoding: 'utf-8', timeout: 5000 }
).trim()
if (!canonicalLinuxPath) {
throw new Error('Managed Codex home directory does not exist on disk.')
}
return toWindowsWslPath(canonicalLinuxPath, wslInfo.distro)
} catch (error) {
throw new Error('Managed WSL Codex home is outside Orca account storage.', {
cause: error
})
}
}
if (wslInfo.linuxPath.split('/').includes('..')) {
throw new Error('Managed WSL Codex home is outside Orca account storage.')
}
if (!existsSync(candidatePath)) {
throw new Error('Managed Codex home directory does not exist on disk.')
}
if (!existsSync(join(candidatePath, '.orca-managed-home'))) {
throw new Error('Managed Codex home is missing Orca ownership marker.')
}View on GitHub (pinned to 1136503c6a)
Solutions
- For host accounts on re-auth, ensureManagedHomeForReauthentication (service.ts:1370) recreates the home at the exact persisted path — ensure that path matches and re-run reauthenticateAccount.
- For WSL, confirm the distro is registered and the linux path exists; if the distro was reset, re-add the account.
- If the home cannot be recovered, remove the account and add it again so a fresh managed home is created.
Defensive patterns
Strategy: validation
Validate before calling
// Confirm the managed home exists on disk before re-auth/import.
import { existsSync } from 'node:fs'
if (!existsSync(account.managedHomePath)) {
// for host re-auth, ensureManagedHomeForReauthentication will recreate it at the persisted path;
// for other flows, remove + re-add the account
} Try / catch
try {
await service.reauthenticateAccount(accountId)
} catch (error) {
if (error instanceof Error && error.message === 'Managed Codex home directory does not exist on disk.') {
// remove and re-add the account to recreate its managed home
} else throw error
} Prevention
- Do not delete <userData>/codex-accounts or the WSL managed-home trees.
- Back up managed homes alongside settings when migrating installations.
When it happens
Trigger: Re-authenticating or importing into a managed home whose directory was deleted from disk (host branch), or whose WSL path does not exist inside the distro (WSL branch returns empty canonical path).
Common situations: User or a cleanup tool deleted <userData>/codex-accounts/<id>/home; the WSL distro was unregistered/reset (so the linux path is gone); or the account was restored from a backup that did not include the home directories.
Related errors
- Could not create a temporary WSL Claude login directory.
- Managed Claude auth directory does not exist on disk.
- targetChanged
- accountRuntimeChanged
- That Codex account belongs to a different runtime.
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/1a17d4269514aa6c.
Report an issue: GitHub.