FlowiseAI/Flowise · error · Error
Azure Rerank API call failed: ${error.message}
Error message
Azure Rerank API call failed: ${error.message} What it means
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).
Source
Thrown at packages/components/nodes/retrievers/AzureRerankRetriever/AzureRerank.ts:54
const data = {
model: this.model,
top_n: this.k,
max_chunks_per_doc: this.maxChunksPerDoc,
query: query,
return_documents: false,
documents: documents.map((doc) => doc.pageContent)
}
try {
let returnedDocs = await secureAxiosRequest({ method: 'POST', url: this.azureApiUrl, data, ...config })
const finalResults: Document<Record<string, any>>[] = []
returnedDocs.data.results.forEach((result: any) => {
const doc = documents[result.index]
doc.metadata.relevance_score = result.relevance_score
finalResults.push(doc)
})
return finalResults.splice(0, this.k)
} catch (error) {
throw new Error(`Azure Rerank API call failed: ${error.message}`)
}
}
}
View on GitHub (pinned to abe4a8601a)
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.
Example fix
// before
throw new Error(`Azure Rerank API call failed: ${error.message}`)
// after - surface status code for actionable retries
const status = error.response?.status
throw new Error(`Azure Rerank API call failed (${status}): ${error.response?.data?.error?.message ?? error.message}`) Defensive patterns
Strategy: retry
Validate before calling
function isLikelyTransient(status?: number): boolean {
return status === 429 || (typeof status === 'number' && status >= 500)
}
// before calling, validate credential shape
if (!azureApiKey || !azureEndpoint) {
throw new Error('Azure Foundry key and endpoint are both required.')
} Type guard
function isAzureHttpError(e: unknown): e is { response: { status: number; data: any } } {
return !!e && typeof e === 'object' && 'response' in (e as any)
} Try / catch
let attempt = 0
while (true) {
try {
return await reranker.rerank(docs, query)
} catch (e) {
const status = (e as any)?.response?.status
if (isLikelyTransient(status) && attempt++ < 4) {
await new Promise(r => setTimeout(r, 2 ** attempt * 250))
continue
}
throw e
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Azure Foundry API Key is missing in credentials.
- Azure Foundry Endpoint is missing in credentials.
- ${errorMessage}
- HTTP error! status: ${response.status}
- Failed to fetch ${url}: ${error}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/1434973ac55bf1a2.
Report an issue: GitHub.