{"record":{"id":"79d78a17caf5f29f","repo":"stablyai/orca","slug":"managed-claude-auth-directory-does-not-exist-on-di","errorCode":null,"errorMessage":"Managed Claude auth directory does not exist on disk.","messagePattern":"Managed Claude auth directory does not exist on disk\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/claude-accounts/service.ts","lineNumber":994,"sourceCode":"              buildEncodedWslBashCommand(\n                [\n                  'set -euo pipefail',\n                  `candidate=${shellQuote(wslInfo.linuxPath)}`,\n                  'managed_root=\"${HOME%/}/.local/share/orca/claude-accounts\"',\n                  'candidate_real=$(readlink -f -- \"$candidate\")',\n                  'managed_root_real=$(readlink -f -- \"$managed_root\")',\n                  'test -f \"$candidate_real/.orca-managed-claude-auth\"',\n                  expectedAccountId\n                    ? `test \"$(cat \"$candidate_real/.orca-managed-claude-auth\")\" = ${shellQuote(expectedAccountId)}`\n                    : 'test -n \"$(cat \"$candidate_real/.orca-managed-claude-auth\")\"',\n                  'case \"$candidate_real\" in \"$managed_root_real\"/*/auth) printf \"%s\\\\n\" \"$candidate_real\" ;; *) exit 35 ;; esac'\n                ].join('\\n')\n              )\n            ],\n            { encoding: 'utf-8', timeout: 5000 }\n          ).trim()\n          if (!canonicalLinuxPath) {\n            throw new Error('Managed Claude auth directory does not exist on disk.')\n          }\n          return toWindowsWslPath(canonicalLinuxPath, wslInfo.distro)\n        } catch (error) {\n          throw new Error('Managed WSL Claude auth storage is outside Orca account storage.', {\n            cause: error\n          })\n        }\n      }\n      if (\n        !existsSync(candidatePath) ||\n        !existsSync(join(candidatePath, '.orca-managed-claude-auth'))\n      ) {\n        throw new Error('Managed Claude auth storage is not owned by Orca.')\n      }\n      return candidatePath\n    }\n\n    this.getManagedAccountsRoot()","sourceCodeStart":976,"sourceCodeEnd":1012,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/claude-accounts/service.ts#L976-L1012","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inside WSL, run 'ls -la ~/.local/share/orca/claude-accounts/<accountId>/auth/.orca-managed-claude-auth' and confirm both the directory and marker exist.","Run 'readlink -f ~/.local/share/orca/claude-accounts/<accountId>/auth' and confirm the output matches the expected managed root pattern.","Delete the orphaned directory and re-add the Claude account in Orca to recreate the managed auth path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { execFileSync } from 'node:child_process'\n\nfunction wslAuthDirExists(distro: string, linuxPath: string): boolean {\n  try {\n    execFileSync('wsl.exe', ['-d', distro, '--', 'bash', '-lc',\n      `test -d \"${linuxPath}\" && test -f \"${linuxPath}/.orca-managed-claude-auth\"`],\n      { encoding: 'utf-8', timeout: 5000 })\n    return true\n  } catch { return false }\n}","typeGuard":null,"tryCatchPattern":"try {\n  assertManagedAuthPath(candidatePath, expectedAccountId)\n} catch (error) {\n  if (error instanceof Error && error.message === 'Managed Claude auth directory does not exist on disk.') {\n    // Directory is gone; recreate it or prompt re-add\n  } else { throw error }\n}","preventionTips":["Avoid deleting ~/.local/share/orca/claude-accounts manually.","Run WSL auth checks in a retry-after-remount flow if using network filesystems."],"tags":["wsl","windows","claude-accounts","path-validation","filesystem"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}