{"record":{"id":"fddff29200b7482e","repo":"ruvnet/ruflo","slug":"ruflo-proxy-supervisor-failed-to-spawn-no-pid-re","errorCode":null,"errorMessage":"ruflo proxy supervisor failed to spawn — no PID returned","messagePattern":"ruflo proxy supervisor failed to spawn — no PID returned","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/proxy/lifecycle.ts","lineNumber":230,"sourceCode":"\n  const lockFd = acquireStartLock();\n  try {\n    // Re-check under the lock — the dedup above raced a concurrent starter.\n    const rechecked = getProxyStatus();\n    if (rechecked.running && rechecked.pid) throw new ProxyAlreadyRunningError(rechecked.pid);\n    if (rechecked.stalePidFile) clearStalePidFile();\n\n    const logFd = fs.openSync(proxyLogFilePath(), 'a');\n    const cliEntry = process.argv[1];\n    if (!cliEntry) throw new Error('cannot locate the ruflo CLI entrypoint for supervised service mode');\n    const child = spawn(process.execPath, [cliEntry, 'proxy', 'supervise'], {\n      stdio: ['ignore', logFd, logFd],\n      detached: true,\n      windowsHide: true,\n    });\n    fs.closeSync(logFd); // the child holds its own duplicated fd; safe to close ours\n\n    if (!child.pid) throw new Error('ruflo proxy supervisor failed to spawn — no PID returned');\n    writePidFile(child.pid);\n    child.unref();\n    return { pid: child.pid };\n  } finally {\n    releaseStartLock(lockFd);\n  }\n}\n\nexport interface StopResult {\n  wasRunning: boolean;\n  pid: number | null;\n}\n\n/** SIGTERM -> 1000ms -> SIGKILL if still alive, mirroring daemon.ts's killBackgroundDaemon. */\nexport async function stopProxy(): Promise<StopResult> {\n  const status = getProxyStatus();\n  if (!status.running || !status.pid) {\n    if (status.stalePidFile) clearStalePidFile();","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/proxy/lifecycle.ts#L212-L248","documentation":"Error \"ruflo proxy supervisor failed to spawn — no PID returned\" thrown in ruvnet/ruflo.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/proxy/lifecycle.ts:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}