{"record":{"id":"90a0f1e7484773b8","repo":"BerriAI/litellm","slug":"azure-document-intelligence-returned-202-but-no-op","errorCode":null,"errorMessage":"Azure Document Intelligence returned 202 but no Operation-Location header found","messagePattern":"Azure Document Intelligence returned 202 but no Operation-Location header found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/ocr/document_intelligence/transformation.py","lineNumber":584,"sourceCode":"            self._check_timeout(start_time=start_time, timeout_secs=timeout_secs)\n\n            # Poll the operation status\n            response = await client.get(url=operation_url, headers=headers)\n\n            # Check operation status\n            status = self._check_operation_status(response=response)\n\n            if status == \"succeeded\":\n                return response\n            elif status == \"running\":\n                # Wait before polling again\n                retry_after = self._get_retry_after(response=response)\n                await asyncio.sleep(retry_after)\n\n    def _get_polling_target(self, raw_response: httpx.Response) -> tuple[str, dict[str, str]]:\n        operation_url: Final = raw_response.headers.get(\"Operation-Location\")\n        if not operation_url:\n            raise ValueError(\"Azure Document Intelligence returned 202 but no Operation-Location header found\")\n\n        # Reject cross-origin polling URLs — the auth headers\n        # below would otherwise leak to whatever URL the upstream\n        # (or an attacker-controlled upstream) returns. VERIA-51.\n        try:\n            assert_same_origin(operation_url, str(raw_response.request.url))\n        except SSRFError as ssrf_err:\n            raise ValueError(f\"Azure Document Intelligence: rejected polling URL ({ssrf_err})\")\n\n        poll_headers = {\"Ocp-Apim-Subscription-Key\": raw_response.request.headers.get(\"Ocp-Apim-Subscription-Key\", \"\")}\n        return operation_url, poll_headers\n\n    def _transform_completed_response(self, model: str, raw_response: httpx.Response) -> OCRResponse:\n        \"\"\"\n        Transform a completed Azure Document Intelligence analyze operation\n        into the Mistral OCR response shape, preserving Azure-native\n        `analyzeResult` fields (`content`, `tables`, `keyValuePairs`) as\n        top-level response fields.","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py#L566-L602","documentation":"Error \"Azure Document Intelligence returned 202 but no Operation-Location header found\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure_ai/ocr/document_intelligence/transformation.py:584 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the 202 response headers; the endpoint must return an Operation-Location header. Verify the endpoint and api_version."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}