{"record":{"id":"f43dfa6afca80b4d","repo":"continuedev/continue","slug":"error-in-bedrockreranker-rerank-error-message","errorCode":null,"errorMessage":"Error in BedrockReranker.rerank: ${error.message}","messagePattern":"Error in BedrockReranker\\.rerank: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/llm/llms/Bedrock.ts","lineNumber":741,"sourceCode":"        const responseBody = JSON.parse(decoded);\n        // Sort results by index to maintain original order\n        return responseBody.results\n          .sort((a: any, b: any) => a.index - b.index)\n          .map((result: any) => result.relevance_score);\n      } catch (e) {\n        throw new Error(\n          `Error parsing JSON from Bedrock response body:\\n${decoded}, ${JSON.stringify(e)}`,\n        );\n      }\n    } catch (error: unknown) {\n      if (error instanceof Error) {\n        if (\"code\" in error) {\n          // AWS SDK specific errors\n          throw new Error(\n            `AWS Bedrock rerank error (${(error as any).code}): ${error.message}`,\n          );\n        }\n        throw new Error(`Error in BedrockReranker.rerank: ${error.message}`);\n      }\n      throw new Error(\n        \"Error in BedrockReranker.rerank: Unknown error occurred\",\n      );\n    }\n  }\n}\n\nexport default Bedrock;\n","sourceCodeStart":723,"sourceCodeEnd":751,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/llm/llms/Bedrock.ts#L723-L751","documentation":"Generic wrapper thrown by BedrockReranker.rerank when the rerank call fails with a standard Error that is not an AWS SDK coded error. The original error message is preserved with the 'Error in BedrockReranker.rerank' prefix. Typical causes are network-level failures or unexpected exceptions raised while calling the Bedrock runtime client.","triggerScenarios":"Network outage/DNS failure while calling bedrockruntime.send(InvokeModelCommand), misconfigured region causing endpoint resolution failure, missing AWS credentials producing a non-SDK error, or a bug in the request serialization.","commonSituations":"Running in an environment without outbound network access to bedrock-runtime.<region>.amazonaws.com, unset AWS_REGION, corporate proxy interference, or Node fetch/undici incompatibilities with the SDK v3 client.","solutions":["Read the embedded message to identify the underlying cause (fetch failed, ENOTFOUND, credentials not found, etc.)","Verify AWS region and connectivity: curl https://bedrock-runtime.<region>.amazonaws.com","If credentials are missing, export AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_REGION or configure a shared credentials file","Upgrade @aws-sdk/client-bedrock-runtime if the message indicates serialization/protocol issues"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await reranker.rerank(query, chunks);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Error in BedrockReranker.rerank:')) {\n    logger.error('Bedrock rerank failure:', e.message);\n  }\n  throw e;\n}","preventionTips":["Set AWS_REGION explicitly in the environment","Health-check network egress to bedrock-runtime.<region>.amazonaws.com before indexing","Keep @aws-sdk/client-bedrock-runtime updated"],"tags":["aws","bedrock","rerank","network","sdk"],"backgroundTag":"aws-sdk-error","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}