n8n-io/n8n · error · NodeOperationError
Azure AI Search API error (${statusCode}): ${errorMessage}
Error message
Azure AI Search API error (${statusCode}): ${errorMessage} What it means
The populateVectorStore catch block handles Azure SDK RestError specially: it surfaces the HTTP statusCode, the SDK error code, and a multi-line description of common causes. RestError is thrown by @azure/core-rest-pipeline when a request fails or has no response.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreAzureAISearch/VectorStoreAzureAISearch.node.ts:539
(error as any).statusCode === 403
) {
throw new NodeOperationError(
context.getNode(),
'Authorization failed - insufficient permissions for document upload.',
{
itemIndex,
description:
'The API Key does not have sufficient permissions for write operations. Ensure the key has the required access level.',
},
);
}
// Check for RestError (common Azure SDK error)
if ((error as any).name === 'RestError' || error.message?.includes('RestError')) {
const statusCode = (error as any).statusCode || 'unknown';
const errorCode = (error as any).code || 'unknown';
const errorMessage = error instanceof Error ? error.message : String(error);
throw new NodeOperationError(
context.getNode(),
`Azure AI Search API error (${statusCode}): ${errorMessage}`,
{
itemIndex,
description: `Error code: ${errorCode}\n\nCommon causes:\n- Invalid endpoint URL\n- Index doesn't exist\n- Authentication/authorization issues\n- API version mismatch\n\nCheck the console logs for detailed error information.`,
},
);
}
const errorMessage = error instanceof Error ? error.message : String(error);
throw new NodeOperationError(context.getNode(), `Error: ${errorMessage}`, {
itemIndex,
description: 'Please check your Azure AI Search connection details and index configuration',
});
}
},
}) {}
View on GitHub (pinned to 5ac6606e81)
Solutions
- Read the statusCode and error code in the message/description to classify (404=index missing, 400=bad payload, 429=throttle, 5xx=transient).
- Ensure the index exists and its vector field dimensions match the embeddings model.
- For 429, reduce batch size / add retry with backoff.
- Update the @azure/search-documents SDK if there is an API-version mismatch.
Defensive patterns
Strategy: retry
Type guard
function isRestError(e: unknown): e is { statusCode?: number; code?: string; message: string } {
return e instanceof Error && ((e as any).name === 'RestError' || /RestError/i.test(e.message));
} Try / catch
for (const [attempt, delay] of [0, 500, 2000].entries()) {
try { await vectorStore.addDocuments(docs); break; }
catch (e) {
if (isRestError(e) && (e.statusCode === 429 || (e.statusCode ?? 0) >= 500) && attempt < 2) {
await sleep(delay); continue;
}
throw e;
}
} Prevention
- Retry with backoff on 429/5xx RestErrors; do not retry 4xx (except 429).
- Validate vector dimensions and document shape before upload to avoid 400 RestErrors.
When it happens
Trigger: error.name === 'RestError' OR error.message includes 'RestError' during document upload — e.g. the REST call to Azure AI Search returned a non-2xx status (400 bad request, 404 index missing, 409 conflict, 429 throttled, 5xx).
Common situations: Index does not exist; API version mismatch between SDK and service; malformed document fields/vector dimensions; throttling (429); transient 5xx from Azure; wrong endpoint URL.
Related errors
- Authentication failed during document upload - invalid API k
- Authorization failed - insufficient permissions for document
- Parameter ${key} must be a string
- Azure AI Search endpoint is missing or invalid
- API Key is required for authentication
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/9e3136640b9b9203.
Report an issue: GitHub.