{"record":{"id":"1434973ac55bf1a2","repo":"FlowiseAI/Flowise","slug":"azure-rerank-api-call-failed-error-message","errorCode":null,"errorMessage":"Azure Rerank API call failed: ${error.message}","messagePattern":"Azure Rerank API call failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/retrievers/AzureRerankRetriever/AzureRerank.ts","lineNumber":54,"sourceCode":"        const data = {\n            model: this.model,\n            top_n: this.k,\n            max_chunks_per_doc: this.maxChunksPerDoc,\n            query: query,\n            return_documents: false,\n            documents: documents.map((doc) => doc.pageContent)\n        }\n        try {\n            let returnedDocs = await secureAxiosRequest({ method: 'POST', url: this.azureApiUrl, data, ...config })\n            const finalResults: Document<Record<string, any>>[] = []\n            returnedDocs.data.results.forEach((result: any) => {\n                const doc = documents[result.index]\n                doc.metadata.relevance_score = result.relevance_score\n                finalResults.push(doc)\n            })\n            return finalResults.splice(0, this.k)\n        } catch (error) {\n            throw new Error(`Azure Rerank API call failed: ${error.message}`)\n        }\n    }\n}\n","sourceCodeStart":36,"sourceCodeEnd":58,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/retrievers/AzureRerankRetriever/AzureRerank.ts#L36-L58","documentation":"Thrown by AzureRerank's rerank() catch block after secureAxiosRequest rejects. The original error's .message is appended; this is a generic network/HTTP-level wrapper for any failure calling the Azure Rerank endpoint (4xx, 5xx, DNS, TLS, timeout, body shape).","triggerScenarios":"Wrong/Expired Azure API key (401/403); wrong endpoint URL (404); rate limit (429); model name not deployed in the Foundry resource; network/DNS failure; request body larger than Azure's limit; TLS/proxy interception.","commonSituations":"Credential key rotated but not updated in Flowise; endpoint pasted with a trailing slash or wrong region; model deployment deleted in Azure AI Foundry; corporate proxy blocking the call; transient Azure outage.","solutions":["Inspect the wrapped error.message first - it usually contains the HTTP status and Azure error code.","Verify the Azure Foundry API key and endpoint in the credential; ensure the model is deployed and named exactly.","Check the endpoint URL region matches the resource; remove trailing slashes.","Retry on 429/5xx with exponential backoff; if persistent, check Azure Service Health.","Confirm network egress (proxy/firewall) permits the Azure host."],"exampleFix":"// before\nthrow new Error(`Azure Rerank API call failed: ${error.message}`)\n// after - surface status code for actionable retries\nconst status = error.response?.status\nthrow new Error(`Azure Rerank API call failed (${status}): ${error.response?.data?.error?.message ?? error.message}`)","handlingStrategy":"retry","validationCode":"function isLikelyTransient(status?: number): boolean {\n  return status === 429 || (typeof status === 'number' && status >= 500)\n}\n// before calling, validate credential shape\nif (!azureApiKey || !azureEndpoint) {\n  throw new Error('Azure Foundry key and endpoint are both required.')\n}","typeGuard":"function isAzureHttpError(e: unknown): e is { response: { status: number; data: any } } {\n  return !!e && typeof e === 'object' && 'response' in (e as any)\n}","tryCatchPattern":"let attempt = 0\nwhile (true) {\n  try {\n    return await reranker.rerank(docs, query)\n  } catch (e) {\n    const status = (e as any)?.response?.status\n    if (isLikelyTransient(status) && attempt++ < 4) {\n      await new Promise(r => setTimeout(r, 2 ** attempt * 250))\n      continue\n    }\n    throw e\n  }\n}","preventionTips":["Store key + endpoint together in one credential and rotate both at once.","Wrap rerank calls in exponential backoff for 429/5xx.","Log error.response.status and error.response.data for faster triage.","Verify the model deployment name matches what is deployed in Foundry."],"tags":["azure","rerank","network","http","credentials","retriever"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}