stablyai/orca · error · Error

Managed Claude auth directory does not exist on disk.

Error message

Managed Claude auth directory does not exist on disk.

What it means

Thrown inside the Windows/WSL branch of assertManagedAuthPath when the bash verification script (readlink + test marker + case match) returns an empty string. The empty output means the canonicalized candidate path did not match the expected '$managed_root_real/*/auth' pattern, so the directory is treated as non-existent or not a valid managed auth dir.

Source

Thrown at src/main/claude-accounts/service.ts:994

              buildEncodedWslBashCommand(
                [
                  'set -euo pipefail',
                  `candidate=${shellQuote(wslInfo.linuxPath)}`,
                  'managed_root="${HOME%/}/.local/share/orca/claude-accounts"',
                  'candidate_real=$(readlink -f -- "$candidate")',
                  'managed_root_real=$(readlink -f -- "$managed_root")',
                  'test -f "$candidate_real/.orca-managed-claude-auth"',
                  expectedAccountId
                    ? `test "$(cat "$candidate_real/.orca-managed-claude-auth")" = ${shellQuote(expectedAccountId)}`
                    : 'test -n "$(cat "$candidate_real/.orca-managed-claude-auth")"',
                  'case "$candidate_real" in "$managed_root_real"/*/auth) printf "%s\\n" "$candidate_real" ;; *) exit 35 ;; esac'
                ].join('\n')
              )
            ],
            { encoding: 'utf-8', timeout: 5000 }
          ).trim()
          if (!canonicalLinuxPath) {
            throw new Error('Managed Claude auth directory does not exist on disk.')
          }
          return toWindowsWslPath(canonicalLinuxPath, wslInfo.distro)
        } catch (error) {
          throw new Error('Managed WSL Claude auth storage is outside Orca account storage.', {
            cause: error
          })
        }
      }
      if (
        !existsSync(candidatePath) ||
        !existsSync(join(candidatePath, '.orca-managed-claude-auth'))
      ) {
        throw new Error('Managed Claude auth storage is not owned by Orca.')
      }
      return candidatePath
    }

    this.getManagedAccountsRoot()

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Inside WSL, run 'ls -la ~/.local/share/orca/claude-accounts/<accountId>/auth/.orca-managed-claude-auth' and confirm both the directory and marker exist.
  2. Run 'readlink -f ~/.local/share/orca/claude-accounts/<accountId>/auth' and confirm the output matches the expected managed root pattern.
  3. Delete the orphaned directory and re-add the Claude account in Orca to recreate the managed auth path.
Defensive patterns

Strategy: validation

Validate before calling

import { execFileSync } from 'node:child_process'

function wslAuthDirExists(distro: string, linuxPath: string): boolean {
  try {
    execFileSync('wsl.exe', ['-d', distro, '--', 'bash', '-lc',
      `test -d "${linuxPath}" && test -f "${linuxPath}/.orca-managed-claude-auth"`],
      { encoding: 'utf-8', timeout: 5000 })
    return true
  } catch { return false }
}

Try / catch

try {
  assertManagedAuthPath(candidatePath, expectedAccountId)
} catch (error) {
  if (error instanceof Error && error.message === 'Managed Claude auth directory does not exist on disk.') {
    // Directory is gone; recreate it or prompt re-add
  } else { throw error }
}

Prevention

When it happens

Trigger: On win32, assertManagedAuthPath runs a bash script in WSL that canonicalizes the candidate path, checks for the .orca-managed-claude-auth marker, and matches the case pattern. If the script exits 0 but prints nothing (e.g., the marker file exists but the path doesn't match the case pattern), canonicalLinuxPath is empty.

Common situations: The auth directory was partially deleted (marker exists but directory is an orphan). A race condition where the directory is removed between mkdirSync and this check. WSL readlink resolves to a different path than expected due to bind mounts.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/79d78a17caf5f29f. Report an issue: GitHub.