{"record":{"id":"90fc98a8d74721a8","repo":"paperclipai/paperclip","slug":"gateway-auth-throttled","errorCode":"gateway_auth_throttled","errorMessage":"MCP gateway authentication was throttled","messagePattern":"MCP gateway authentication was throttled","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":429,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":3712,"sourceCode":"    try {\n      await request(\"initialize\", {\n        protocolVersion: \"2024-11-05\",\n        capabilities: {},\n        clientInfo: { name: \"paperclip-tool-gateway\", version: \"0.3.1\" },\n      });\n      child.stdin.write(`${JSON.stringify({ jsonrpc: \"2.0\", method: \"notifications/initialized\", params: {} })}\\n`);\n      return await request(\n        input.protocolMethod ?? \"tools/call\",\n        input.protocolParams ?? {\n          name: input.entry?.toolName,\n          arguments: input.parameters ?? {},\n        },\n      );\n    } finally {\n      clearTimeout(timer);\n      child.stdin.end();\n      child.kill(\"SIGTERM\");\n      await exitPromise.catch(() => undefined);\n    }\n  }\n\n  async function fullyAssignedMcpConnections(session: ToolGatewaySession) {\n    if (!session.gatewayProfileId) return [];\n    return db\n      .select({ connection: toolConnections })\n      .from(toolProfileEntries)\n      .innerJoin(toolConnections, eq(toolProfileEntries.connectionId, toolConnections.id))\n      .where(and(\n        eq(toolProfileEntries.companyId, session.companyId),\n        eq(toolProfileEntries.profileId, session.gatewayProfileId),\n        eq(toolProfileEntries.selectorType, \"connection\"),\n        eq(toolProfileEntries.effect, \"include\"),\n        eq(toolConnections.companyId, session.companyId),\n        eq(toolConnections.enabled, true),\n        eq(toolConnections.status, \"active\"),\n        inArray(toolConnections.transport, [\"mcp_remote\", \"local_stdio\"]),","sourceCodeStart":3694,"sourceCodeEnd":3730,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L3694-L3730","documentation":"Repeated named-gateway authentication failures tripped the authFailures limiter: within the sliding window the token/gateway failure counter reached protocolLimits.authFailures.max, so further attempts are refused with a throttle response carrying retryAfterMs. The audit entry records the original failedReasonCode plus limiter details; legitimate clients must wait out the window and then use a valid token.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:3571 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Authentication attempts were throttled. Stop retrying briefly, verify the token is correct, and retry after the throttle window."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}