{"record":{"id":"81858dcad14c57b0","repo":"stablyai/orca","slug":"could-not-resolve-the-active-wsl-distribution-for","errorCode":null,"errorMessage":"Could not resolve the active WSL distribution for Claude login.","messagePattern":"Could not resolve the active WSL distribution for Claude login\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/claude-accounts/service.ts","lineNumber":659,"sourceCode":"      throw cleanupError\n    }\n    return captured!\n  }\n\n  private createTemporaryClaudeConfigDir(location: ManagedClaudeAuthLocation): {\n    windowsPath: string\n    linuxPath: string | null\n    wslDistro: string | null\n  } {\n    if (location.managedAuthRuntime !== 'wsl') {\n      return {\n        windowsPath: mkdtempSync(join(tmpdir(), 'orca-claude-login-')),\n        linuxPath: null,\n        wslDistro: null\n      }\n    }\n    if (!location.wslDistro) {\n      throw new Error('Could not resolve the active WSL distribution for Claude login.')\n    }\n    const linuxPath = execFileSync(\n      'wsl.exe',\n      [\n        '-d',\n        location.wslDistro,\n        '--',\n        'bash',\n        '-lc',\n        'mktemp -d \"${TMPDIR:-/tmp}/orca-claude-login.XXXXXX\"'\n      ],\n      { encoding: 'utf-8', timeout: 5000 }\n    )\n      .replaceAll(String.fromCharCode(0), '')\n      .trim()\n    if (!linuxPath.startsWith('/')) {\n      throw new Error('Could not create a temporary WSL Claude login directory.')\n    }","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/claude-accounts/service.ts#L641-L677","documentation":"Thrown by createTemporaryClaudeConfigDir() when the managed auth runtime is 'wsl' but location.wslDistro is null/empty. A WSL login requires a concrete distro to target with `wsl.exe -d <distro>`. A null distro means the caller did not resolve the active WSL distro before requesting a WSL login.","triggerScenarios":"Calling runClaudeLoginAndCapture with managedAuthRuntime='wsl' but wslDistro=null. The WSL distro detection (wsl.exe -l -q) returned empty or was not run. Account.wslDistro was not persisted at add time.","commonSituations":"WSL is installed but no default distro is set. The distro detection ran before WSL was ready. A stale account record lost its wslDistro. The user removed the distro after adding the account.","solutions":["Resolve and pass a concrete wslDistro (from wsl.exe -l -q or the WSL distro picker) before initiating a WSL login.","Ensure account.wslDistro is populated when the account is created and re-read at login time.","If no WSL distro is available, fall back to host runtime or guide the user to install one.","Detect WSL availability earlier and disable the WSL login option if no distro exists."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (location.managedAuthRuntime === 'wsl' && !location.wslDistro) {\n  throw new Error('Resolve the WSL distro before starting a WSL login.')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve wslDistro via wsl.exe -l -q before offering WSL login.","Persist account.wslDistro at add time and re-read at login time.","Disable the WSL login option when no distro is detected.","Fall back to host runtime if WSL is unavailable."],"tags":["claude-accounts","wsl","windows","login","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}