{"record":{"id":"0c2f57880395bfdf","repo":"BerriAI/litellm","slug":"unknown-operation-status-status","errorCode":null,"errorMessage":"Unknown operation status: {status}","messagePattern":"Unknown operation status: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/azure_ai/ocr/document_intelligence/transformation.py","lineNumber":489,"sourceCode":"\n        Raises:\n            ValueError: If operation failed or status is unknown\n        \"\"\"\n        try:\n            result: Final = response.json()\n            status: Final = result.get(\"status\")\n\n            verbose_logger.debug(\"Azure DI operation status: %s\", status)\n\n            if status == \"succeeded\":\n                return \"succeeded\"\n            elif status == \"failed\":\n                error_msg: Final = result.get(\"error\", {}).get(\"message\", \"Unknown error\")\n                raise ValueError(f\"Azure Document Intelligence analysis failed: {error_msg}\")\n            elif status in [\"running\", \"notStarted\"]:\n                return \"running\"\n            else:\n                raise ValueError(f\"Unknown operation status: {status}\")\n\n        except Exception as e:\n            if \"succeeded\" in str(e) or \"failed\" in str(e):\n                raise\n            # If we can't parse JSON, something went wrong\n            raise ValueError(f\"Failed to parse Azure DI operation response: {e}\")\n\n    def _poll_operation_sync(\n        self,\n        operation_url: str,\n        headers: dict[str, str],\n        timeout_secs: int,\n    ) -> httpx.Response:\n        \"\"\"\n        Poll Azure Document Intelligence operation until completion (sync).\n\n        Azure DI POST returns 202 with Operation-Location header.\n        We need to poll that URL until status is \"succeeded\" or \"failed\".","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/azure_ai/ocr/document_intelligence/transformation.py#L471-L507","documentation":"Raised when the polled Azure DI operation response contains a `status` value outside the known set {succeeded, failed, running, notStarted}. This generally means Azure changed/added a status (e.g. a new 'canceled'/'skipped' value) or the response shape changed, and LiteLLM's parser cannot classify it. It is a defensive parse failure, not a user-input error.","triggerScenarios":"Azure introducing a new operation status in its DI API; a proxy or mock server returning a modified status field; the response body containing something like 'canceled' or 'cancelled' that the branch chain doesn't handle.","commonSituations":"Azure API version drift after LiteLLM's parser was written; testing against recorded/mocked responses with divergent status values; regional variants of the service.","solutions":["Upgrade LiteLLM to the latest version — new statuses are usually mapped once reported.","If reproducible, capture the raw status value from the error message and report it in a LiteLLM issue.","Retry the operation; transient odd statuses (rare) may not recur on resubmission."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = litellm.aocr_document(model=m, document=doc)\nexcept ValueError as e:\n    if \"Unknown operation status\" in str(e):\n        log.error(\"unrecognized DI status — possible API drift: %s\", e)\n        # retry once; report status value upstream\n    raise","preventionTips":["Keep LiteLLM updated to track Azure DI status vocabulary.","Include the raw status from the message when reporting issues."],"tags":["azure","document-intelligence","ocr","polling","api-drift"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}