{"record":{"id":"cb3818b589354b0e","repo":"ruvnet/ruflo","slug":"meta-proxy-port-owner-pid-owner-pid-is-not-a-re","errorCode":null,"errorMessage":"Meta-Proxy port owner pid ${owner.pid} is not a recognized Ruflo/MetaHarness binary; refusing to signal it.","messagePattern":"Meta-Proxy port owner pid (.+?) is not a recognized Ruflo/MetaHarness binary; refusing to signal it\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/proxy/activation.ts","lineNumber":113,"sourceCode":"      try {\n        const age = Date.now() - fs.statSync(lock).mtimeMs;\n        const owner = Number.parseInt(fs.readFileSync(path.join(lock, 'owner'), 'utf8').trim(), 10);\n        if (age > 120_000 && (!Number.isSafeInteger(owner) || owner <= 0 || !processExists(owner))) {\n          fs.rmSync(lock, { recursive: true, force: true });\n          continue;\n        }\n      } catch { /* another installer may still be writing its owner */ }\n      await wait(50);\n    }\n  }\n  throw new Error('Another Ruflo/MetaHarness installer still owns the Meta-Proxy install lease.');\n}\n\nasync function stopEffective(wait: Wait): Promise<EffectiveProxy | null> {\n  const owner = await probeEffectiveProxy();\n  if (!owner) return null;\n  if (!isSupportedOwner(owner.executable, process.platform)) {\n    throw new Error(`Meta-Proxy port owner pid ${owner.pid} is not a recognized Ruflo/MetaHarness binary; refusing to signal it.`);\n  }\n  process.kill(owner.pid, 'SIGTERM');\n  for (let attempt = 0; attempt < 40; attempt++) {\n    await wait(50);\n    const current = await probeEffectiveProxy();\n    if (!current || current.pid !== owner.pid) return owner;\n  }\n  throw new Error(`Stale Meta-Proxy pid ${owner.pid} did not stop.`);\n}\n\nfunction launch(binary: string): number {\n  fs.mkdirSync(path.dirname(proxyLogFilePath()), { recursive: true, mode: 0o700 });\n  const log = fs.openSync(proxyLogFilePath(), 'a', 0o600);\n  try {\n    const child = spawn(binary, [], { detached: true, stdio: ['ignore', log, log], windowsHide: true });\n    if (!child.pid) throw new Error('Meta-Proxy did not return a process id.');\n    child.unref();\n    fs.writeFileSync(proxyPidFilePath(), `${child.pid}\\n`, { mode: 0o600 });","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/ruvnet/ruflo/blob/29f048fc3b556f857cf2b126d2a84c19d2daa0d0/v3/@claude-flow/cli/src/proxy/activation.ts#L95-L131","documentation":"Before upgrading, installAndActivateProxy() stops the daemon that currently owns the proxy port. stopEffective() first identifies the port owner's executable and only signals it if the executable matches a known Ruflo/MetaHarness meta-proxy path (proxyBinaryPath, ~/.metaharness/..., ~/.cargo/bin/meta-proxy). If the pid owning the port is any other binary, the library refuses to SIGTERM it to avoid killing an unrelated process.","triggerScenarios":"Calling installAndActivateProxy() while the configured port (default 11435) is occupied by a process that is not one of the recognized meta-proxy binaries — e.g. a different service bound to the same port, a self-compiled meta-proxy in a non-standard path, or a renamed copy.","commonSituations":"Another dev tool (or a manually started meta-proxy from a nonstandard location) already listens on 11435; users moved/renamed the binary; custom install locations not in the allowed list; a container port mapping colliding with the host port.","solutions":["Identify what owns the port (lsof -i :11435 or ss -ltnp) and stop that unrelated service yourself","Move/reinstall meta-proxy to one of the recognized paths (proxyBinaryPath, ~/.metaharness/bin, ~/.metaharness/meta-proxy/bin, or ~/.cargo/bin) and restart it so isSupportedOwner() matches","Change the Meta-Proxy port in the proxy config to a free port and retry the install","If you control the source, extend the allowed executable list in isSupportedOwner() to include your custom install path"],"exampleFix":"// before: custom location\n/home/me/tools/meta-proxy        # not recognized, error\n// after: recognized location\nmv /home/me/tools/meta-proxy ~/.cargo/bin/meta-proxy","handlingStrategy":"validation","validationCode":"// Probe what owns the port before installing; only proceed if it's ours or free.\nimport { createConnection } from 'node:net';\nconst portFree = await new Promise<boolean>(res => {\n  const s = createConnection(11435, '127.0.0.1');\n  s.on('connect', () => { s.destroy(); res(false); });\n  s.on('error', () => res(true));\n});\nif (!portFree) console.log('Port 11435 busy — confirm it is a recognized meta-proxy before installing');","typeGuard":"null","tryCatchPattern":"try {\n  await installAndActivateProxy(version);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('not a recognized Ruflo/MetaHarness binary')) {\n    // surface which pid/path owns the port and stop the foreign service first\n    console.error(e.message, '— run: lsof -i :11435');\n  } else throw e;\n}","preventionTips":["Keep meta-proxy in one of the recognized paths (~/.metaharness/bin, ~/.metaharness/meta-proxy/bin, ~/.cargo/bin) and launch it only via the CLI","Reserve port 11435 for meta-proxy; move other dev services to different ports","Don't rename or symlink the binary to custom names in custom directories","Document any supervisor units so restarts don't substitute foreign binaries on the port"],"tags":["process","safety","port-conflict","proxy"],"backgroundTag":"unrecognized-port-owner","analyzedSha":"29f048fc3b556f857cf2b126d2a84c19d2daa0d0","analyzedAt":"2026-09-01T11:37:30.251Z","contentChangedAt":"2026-09-01T11:37:30.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}