{"record":{"id":"ff4d9aed3e8f277c","repo":"docling-project/docling","slug":"service-request-failed-after-retry-loop-ff4d9a","errorCode":null,"errorMessage":"Service request failed after retry loop.","messagePattern":"Service request failed after retry loop\\.","errorType":"exception","errorClass":"ServiceUnavailableError","httpStatus":null,"severity":"error","filePath":"docling/service_client/client.py","lineNumber":2287,"sourceCode":"                    method=method_name,\n                    exc=exc,\n                    attempt=attempt,\n                    max_retries=max_retries,\n                )\n                if delay is not None:\n                    time.sleep(delay)\n                    continue\n                raise ServiceUnavailableError(\n                    \"Service transport request failed.\",\n                    detail=str(exc),\n                ) from exc\n            result, delay = self._check_retry(response, attempt, max_retries)\n            if result is not None:\n                return result\n            if delay > 0:\n                time.sleep(delay)\n\n        raise ServiceUnavailableError(\"Service request failed after retry loop.\")\n\n    def _failure_message(self, result: ConversionResult) -> str:\n        if result.errors:\n            messages = \"; \".join(item.error_message for item in result.errors)\n            return (\n                f\"Conversion failed for {result.input.file} with status \"\n                f\"{result.status.value}. Errors: {messages}\"\n            )\n        return f\"Conversion failed for {result.input.file} with status {result.status.value}.\"\n","sourceCodeStart":2269,"sourceCodeEnd":2297,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/service_client/client.py#L2269-L2297","documentation":"ServiceUnavailableError raised after the HTTP retry loop completes all attempts without obtaining an accepted response — retryable 5xx statuses persisted through every iteration of _check_retry. This is the 'service kept failing' terminal state, as opposed to error 393 which is a single un-retried transport failure.","triggerScenarios":"docling-serve returning 502/503/504 (or other retryable statuses) on every attempt within the retry budget — e.g. all replicas down, upstream overload, or a crash-looping deployment.","commonSituations":"Service under heavy load or restarting after an upgrade; dependency (redis/db) of the service down causing sustained 5xx.","solutions":["Check docling-serve health and logs — sustained 5xx is a server-side problem","Scale the service or back off and retry later from the application","Tune max_retries/backoff parameters if the client exposes them for transient overload windows"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"def is_service_unavailable(exc: BaseException) -> bool:\n    return isinstance(exc, ServiceUnavailableError)","tryCatchPattern":"try:\n    result = client.convert(source)\nexcept ServiceUnavailableError as exc:\n    if 'after retry loop' in str(exc):\n        wait_for_service_recovery_then_retry()","preventionTips":["Monitor docling-serve 5xx rates; this error means every retry attempt failed","Back off exponentially at the application level to let the service recover"],"tags":["service-unavailable","retry","http-5xx","service-client"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}