{"record":{"id":"f10fc451f45670ae","repo":"thedotmack/claude-mem","slug":"doctor-failed-to-probe-bin-version-f10fc4","errorCode":null,"errorMessage":"[doctor] Failed to probe \\`${bin} --version\\`:","messagePattern":"\\[doctor\\] Failed to probe \\\\`(.+?) --version\\\\`:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/commands/doctor.ts","lineNumber":35,"sourceCode":"import { isPidAlive } from '../../supervisor/process-registry.js';\nimport { checkWindowsGitBash } from '../utils/windows-git-bash-preflight.js';\n\ntype CheckStatus = 'ok' | 'warn' | 'fail';\n\ninterface CheckResult {\n  name: string;\n  status: CheckStatus;\n  detail: string;\n  /** When false, a 'fail' does not affect the overall exit code. */\n  required: boolean;\n}\n\nfunction probeVersion(bin: 'bun' | 'uv'): string | null {\n  try {\n    return bin === 'bun' ? getBunVersion() : getUvVersion();\n  } catch (error) {\n    const err = error instanceof Error ? error : new Error(String(error));\n    console.warn(`[doctor] Failed to probe \\`${bin} --version\\`:`, err);\n    return null;\n  }\n}\n\nasync function probeWorkerHealth(workerHost: string, workerPort: string): Promise<{ status: CheckStatus; detail: string }> {\n  const workerUrl = `http://${workerHost}:${workerPort}`;\n  const res = await fetch(`${workerUrl}/api/health`, {\n    signal: AbortSignal.timeout(3000),\n  });\n  if (res.ok) {\n    return { status: 'ok', detail: `healthy at ${workerUrl}` };\n  }\n  return { status: 'warn', detail: `reachable but unhealthy (HTTP ${res.status}) at ${workerUrl}` };\n}\n\nasync function probeChromaCensus(): Promise<CheckResult> {\n  const name = 'Chroma processes';\n  if (IS_WINDOWS) {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/npx-cli/commands/doctor.ts#L17-L53","documentation":"doctor's probeVersion() wraps calls to getBunVersion()/getUvVersion() and logs this warning if either throws, returning null so the doctor report shows the dependency as undetected instead of crashing. It means the version probe itself failed, not necessarily that bun/uv is missing.","triggerScenarios":"getBunVersion or getUvVersion throws while executing or parsing `<bin> --version` — binary exists but is broken, output redirect fails, permission error, or unexpected binary output.","commonSituations":"Bun/uv partially uninstalled (broken symlink on PATH); custom PATH in a non-interactive shell lacking the install dir; corrupted binary; shell shim intercepting the command.","solutions":["Run `bun --version` / `uv --version` manually in the same shell to reproduce the failure.","Reinstall the affected tool (bun and uv installers are auto-run by claude-mem if missing).","Check that the install directory is on PATH for non-interactive shells (e.g. ~/.bashrc, ~/.zshenv).","Repair or remove broken symlinks/shims pointing at the binary.","Re-run `npx claude-mem doctor` after fixing to confirm."],"exampleFix":"// before\nconsole.warn(`[doctor] Failed to probe \\`${bin} --version\\`:`, err);\n// after (verify manually)\n// $ bun --version      -> reproduces the underlying error\n// $ curl -fsSL https://bun.sh/install | bash   # reinstall, then re-run doctor","handlingStrategy":"try-catch","validationCode":"import { execFileSync } from 'child_process';\nfunction canProbe(bin: string): boolean {\n  try { execFileSync(bin, ['--version'], { stdio: 'ignore' }); return true; } catch { return false; }\n}\n// probeVersion(canProbe('bun') ? 'bun' : 'uv') — skip probes for broken binaries","typeGuard":"function isProbeError(e: unknown): e is Error & { code?: string } {\n  return e instanceof Error;\n}","tryCatchPattern":"try {\n  return bin === 'bun' ? getBunVersion() : getUvVersion();\n} catch (error) {\n  const err = error instanceof Error ? error : new Error(String(error));\n  console.warn(`[doctor] Failed to probe \\`${bin} --version\\`:`, err);\n  return null;\n}","preventionTips":["Keep bun and uv install dirs on PATH for non-interactive shells (~/.zshenv, not just ~/.zshrc).","Run `bun --version` / `uv --version` manually when doctor reports probe failures.","Remove stale shims/symlinks after manual tool upgrades.","Re-run doctor after any toolchain change."],"tags":["doctor","version-probe","bun","uv","cli"],"backgroundTag":"command-not-found","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}