stablyai/orca · error · Error
Could not create a temporary WSL Claude login directory.
Error message
Could not create a temporary WSL Claude login directory.
What it means
Thrown by createTemporaryClaudeConfigDir() when the WSL `mktemp -d` invocation returned a path that does not start with '/' (after stripping NULs and trimming). This means mktemp output was malformed or empty — the temp directory for the login was not actually created inside the distro, so the subsequent path translation would be invalid.
Source
Thrown at src/main/claude-accounts/service.ts:676
if (!location.wslDistro) {
throw new Error('Could not resolve the active WSL distribution for Claude login.')
}
const linuxPath = execFileSync(
'wsl.exe',
[
'-d',
location.wslDistro,
'--',
'bash',
'-lc',
'mktemp -d "${TMPDIR:-/tmp}/orca-claude-login.XXXXXX"'
],
{ encoding: 'utf-8', timeout: 5000 }
)
.replaceAll(String.fromCharCode(0), '')
.trim()
if (!linuxPath.startsWith('/')) {
throw new Error('Could not create a temporary WSL Claude login directory.')
}
return {
windowsPath: toWindowsWslPath(linuxPath, location.wslDistro),
linuxPath,
wslDistro: location.wslDistro
}
}
private removeTemporaryClaudeConfigDir(tempConfig: {
windowsPath: string
linuxPath: string | null
wslDistro: string | null
}): void {
if (tempConfig.linuxPath && tempConfig.wslDistro) {
try {
execFileSync(
'wsl.exe',
[View on GitHub (pinned to 1136503c6a)
Solutions
- Verify the WSL distro boots and `wsl -d <distro> -- bash -lc 'mktemp -d'` returns a valid /tmp path manually.
- Increase the 5000ms execFileSync timeout if the distro is slow to start.
- Ensure TMPDIR and /tmp are writable inside the distro.
- If wsl.exe returns CRLF or other encoding artifacts, normalize before validating (the code already strips NULs).
Defensive patterns
Strategy: try-catch
Try / catch
try {
return createTemporaryClaudeConfigDir(location)
} catch (error) {
if (error instanceof Error && /Could not create a temporary WSL/.test(error.message)) {
// verify distro health: wsl -d <distro> -- bash -lc 'mktemp -d'
}
throw error
} Prevention
- Verify the distro boots and mktemp works before login.
- Increase the 5s execFileSync timeout for slow distros.
- Ensure TMPDIR and /tmp are writable in the distro.
- Normalize wsl.exe stdout encoding (strip CRLF/NUL) before validating.
When it happens
Trigger: wsl.exe ran but mktemp produced no output, an error message instead of a path, or output that got mangled by encoding (CRLF, NUL, locale). The 5s timeout on execFileSync was hit and returned partial/empty stdout. The distro's TMPDIR is unset and /tmp is not writable.
Common situations: WSL distro misconfiguration (no /tmp, read-only). mktemp binary missing or broken in the distro. Locale/encoding corruption of wsl.exe stdout. The 5000ms timeout fired on a slow distro startup.
Related errors
- Managed Claude auth directory does not exist on disk.
- Could not resolve the active WSL distribution for Claude log
- Could not resolve the active WSL home directory for Claude l
- Managed WSL Claude auth storage is outside Orca account stor
- Packaged node-pty is missing ${conptyRoot}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/66256f27fe61e514.
Report an issue: GitHub.