{"record":{"id":"de8f8437ac4ca5d4","repo":"paperclipai/paperclip","slug":"oauth-redirect-limit","errorCode":"oauth_redirect_limit","errorMessage":"Remote OAuth endpoint redirected too many times","messagePattern":"Remote OAuth endpoint redirected too many times","errorType":"http","errorClass":"HttpError","httpStatus":502,"severity":"error","filePath":"server/src/services/tool-access.ts","lineNumber":1413,"sourceCode":"    tools: template.tools.map((tool) => ({\n      name: tool.name,\n      title: tool.title ?? null,\n      description: tool.description ?? null,\n      inputSchema: tool.inputSchema ?? { type: \"object\", properties: {} },\n      annotations: tool.annotations ?? {},\n    })),\n  };\n}\n\nfunction toStdioCommandTemplate(row: typeof toolStdioCommandTemplates.$inferSelect): ToolStdioCommandTemplate {\n  return {\n    id: row.id,\n    companyId: row.companyId,\n    templateId: row.templateKey,\n    name: row.name,\n    title: row.name,\n    description: row.description,\n    status: row.status,\n    source: \"admin\",\n    command: row.command,\n    args: row.args ?? [],\n    envKeys: row.envKeys ?? [],\n    tools: (row.tools ?? [])\n      .map((tool) => normalizeToolDescriptor(tool))\n      .filter((tool): tool is McpToolDescriptor => Boolean(tool))\n      .map((tool) => ({\n        name: tool.name,\n        title: tool.title ?? null,\n        description: tool.description ?? null,\n        inputSchema: tool.inputSchema ?? { type: \"object\", properties: {} },\n        annotations: tool.annotations ?? {},\n      })),\n    createdByAgentId: row.createdByAgentId,\n    createdByUserId: row.createdByUserId,\n    disabledAt: row.disabledAt,\n    createdAt: row.createdAt,","sourceCodeStart":1395,"sourceCodeEnd":1431,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-access.ts#L1395-L1431","documentation":"Loop bound in fetchRemoteHttpUrl: the chain exceeded MAX_REMOTE_HTTP_REDIRECTS without landing on a final response. Catches redirect loops and open-redirect abuse on remote OAuth/token endpoints; the looping remote endpoint is at fault.","triggerScenarios":"Thrown at server/src/services/tool-access.ts:1407 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Redirect loop contacting the OAuth endpoint. Check the provider metadata URLs and any intermediate proxies for redirect cycles."],"exampleFix":null,"handlingStrategy":"validation","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"}