{"record":{"id":"4863e811b42705f6","repo":"paperclipai/paperclip","slug":"runtime-service-did-not-bind-allocated-port-inpu","errorCode":null,"errorMessage":"Runtime service did not bind allocated port ${input.port} before timeout","messagePattern":"Runtime service did not bind allocated port (.+?) before timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":4849,"sourceCode":"      return;\n    }\n\n    // A present listener proves only that some listener appeared. If listener ownership cannot\n    // be attributed to this child after a stability delay, retry instead of accepting a sibling.\n    // The presence read never binds the port, so it cannot steal the port from the child.\n    if (await hasLoopbackPortListener(input.port)) {\n      await delay(250);\n      if (input.child.exitCode !== null || input.child.signalCode !== null) {\n        throw new Error(\"service process exited after losing its allocated port\");\n      }\n      const stableOwnerPid = await readLocalServicePortOwner(input.port);\n      const childPid = input.child.pid ?? null;\n      if (stableOwnerPid && childPid && await isLocalServiceProcessOwnedBy(stableOwnerPid, childPid)) return;\n      throw new RuntimeServicePortBindCollision(input.port);\n    }\n    await delay(50);\n  }\n  throw new Error(`Runtime service did not bind allocated port ${input.port} before timeout`);\n}\n\nfunction isPaperclipDevRuntimeService(input: { serviceName?: string | null; command?: string | null }) {\n  const serviceName = (input.serviceName ?? \"\").trim().toLowerCase();\n  const command = (input.command ?? \"\").trim().toLowerCase();\n  return (\n    serviceName === \"paperclip-dev\"\n    || serviceName === \"paperclip-dev-once\"\n    || (command.includes(\"dev:once\") && command.includes(\"tailscale-auth\"))\n  );\n}\n\nfunction resolveRuntimeServiceHealthUrl(\n  url: string | null,\n  input?: { serviceName?: string | null; command?: string | null },\n) {\n  if (!url || !isPaperclipDevRuntimeService(input ?? {})) return url;\n  try {","sourceCodeStart":4831,"sourceCodeEnd":4867,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L4831-L4867","documentation":"The allocated-port bind wait loop reached its deadline without the child owning a stable listener on the port. The presence-based retry exhausted the readiness timeout, so the service start fails with this timeout error.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:4695 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the service is actually listening on the expected port (e.g. with ss/lsof) and fix its bind configuration.","Increase the bind timeout if the service starts slowly."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}