{"record":{"id":"83c86b64092be16e","repo":"ruvnet/ruflo","slug":"meta-proxy-is-already-running-pid-pid-stop-i","errorCode":null,"errorMessage":"meta-proxy is already running (pid ${pid}). Stop it first with: ruflo proxy stop","messagePattern":"meta-proxy is already running \\(pid (.+?)\\)\\. Stop it first with: ruflo proxy stop","errorType":"exception","errorClass":"ProxyAlreadyRunningError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/proxy/lifecycle.ts","lineNumber":177,"sourceCode":"    fs.unlinkSync(proxyLockFilePath());\n  } catch {\n    /* ignore */\n  }\n}\n\n/**\n * Foreground start (ADR-307 default) — blocks the caller until the process\n * exits or is interrupted. `stdio: 'inherit'` passes the proxy's own output\n * straight through to the terminal; signals (Ctrl+C) propagate naturally to\n * the child, no manual forwarding needed.\n */\nexport async function startForeground(supervised = false): Promise<never> {\n  const bin = requireBinary();\n  const status = getProxyStatus();\n  // In service mode startBackground has already written this supervisor's\n  // PID. Treating it as a competing proxy makes the supervisor immediately\n  // exit before it can spawn meta-proxy.\n  if (!supervised && status.running && status.pid) throw new ProxyAlreadyRunningError(status.pid);\n  if (status.stalePidFile) clearStalePidFile();\n\n  const child = spawn(bin, [], { stdio: 'inherit', windowsHide: false });\n  if (!supervised && child.pid) writePidFile(child.pid);\n\n  const cleanup = () => clearStalePidFile();\n  process.on('exit', cleanup);\n  if (supervised) {\n    const forwardSignal = (signal: NodeJS.Signals) => {\n      if (!child.killed) child.kill(signal);\n    };\n    process.once('SIGTERM', () => forwardSignal('SIGTERM'));\n    process.once('SIGINT', () => forwardSignal('SIGINT'));\n  }\n\n  await new Promise<void>((resolve) => {\n    child.on('exit', () => {\n      cleanup();","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/proxy/lifecycle.ts#L159-L195","documentation":"Error \"meta-proxy is already running (pid ${pid}). Stop it first with: ruflo proxy stop\" thrown in ruvnet/ruflo.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/proxy/lifecycle.ts:177 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"}