{"record":{"id":"ea573e3686655bae","repo":"paperclipai/paperclip","slug":"unable-to-allocate-a-fetch-allowed-smoke-lab-fixtu","errorCode":null,"errorMessage":"Unable to allocate a Fetch-allowed Smoke Lab fixture port","messagePattern":"Unable to allocate a Fetch-allowed Smoke Lab fixture port","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/src/services/smoke-lab.ts","lineNumber":88,"sourceCode":"    const server = createNetServer();\n    const port = await new Promise<number>((resolve, reject) => {\n      const onError = (error: Error) => {\n        server.off(\"error\", onError);\n        reject(error);\n      };\n      server.once(\"error\", onError);\n      server.listen(0, \"127.0.0.1\", () => {\n        server.off(\"error\", onError);\n        const address = server.address();\n        resolve(typeof address === \"object\" && address ? address.port : 0);\n      });\n    });\n    await new Promise<void>((resolve, reject) => {\n      server.close((error) => error ? reject(error) : resolve());\n    });\n    if (port > 0 && !FETCH_BLOCKED_PORTS.has(port)) return port;\n  }\n  throw new Error(\"Unable to allocate a Fetch-allowed Smoke Lab fixture port\");\n}\n\nconst HTTP_APP_KEY = \"paperclip.smoke-lab.http-fixture\";\nconst STDIO_APP_KEY = \"paperclip.smoke-lab.stdio-fixture\";\nconst HTTP_CONNECTION_NAME = \"Smoke Lab HTTP MCP fixture\";\nconst STDIO_CONNECTION_NAME = \"Smoke Lab stdio MCP fixture\";\nconst STDIO_TEMPLATE_KEY = \"paperclip.smoke-lab.stdio-fixture\";\nconst PROFILE_KEY = \"paperclip.smoke-lab.profile\";\nconst HTTP_SERVICE_ID = \"http-mcp-fixture\" as const;\nconst OAUTH_SERVICE_ID = \"fake-oauth\" as const;\n\nfunction smokeFixtureToken(prefix: \"code\" | \"access\" | \"refresh\", parts: Record<string, string>) {\n  const stableInput = Object.keys(parts)\n    .sort()\n    .map((key) => `${key}=${parts[key]}`)\n    .join(\"\\n\");\n  return `smoke_${prefix}_${createHash(\"sha256\").update(stableInput).digest(\"hex\").slice(0, 24)}`;\n}","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/smoke-lab.ts#L70-L106","documentation":"Resource-exhaustion guard in allocateFetchAllowedLoopbackPort: repeatedly binding an ephemeral 127.0.0.1 port and closing it failed to yield a port the Fetch guard classifies as allowed. Indicates host network stack trouble; the loopback/port allocation environment is at fault.","triggerScenarios":"Thrown at server/src/services/smoke-lab.ts:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Free up ports in the Smoke Lab fixture range or widen the allowed port range; all candidate ports are currently excluded or in use."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}