{"record":{"id":"cfc3c819d7644cf5","repo":"docling-project/docling","slug":"grpc-metadata-call-failed-for-model-self-model-na","errorCode":null,"errorMessage":"gRPC metadata call failed for model {self.model_name}: {exc}","messagePattern":"gRPC metadata call failed for model (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"docling/models/inference_engines/common/kserve_v2_grpc.py","lineNumber":249,"sourceCode":"        except Exception:\n            pass\n\n    def close(self) -> None:\n        self._channel.close()\n\n    def get_model_metadata(self) -> KserveV2ModelMetadataResponse:\n        request = service_pb2.ModelMetadataRequest(name=self.model_name)\n        if self.model_version:\n            request.version = self.model_version\n\n        try:\n            response = self._stub.ModelMetadata(\n                request,\n                timeout=self.timeout,\n                metadata=self._grpc_metadata,\n            )\n        except grpc.RpcError as exc:\n            raise RuntimeError(\n                f\"gRPC metadata call failed for model {self.model_name}: {exc}\"\n            ) from exc\n\n        inputs = [\n            KserveV2ModelTensorSpec(\n                name=input_tensor.name,\n                datatype=input_tensor.datatype,\n                shape=[int(dim) for dim in input_tensor.shape],\n            )\n            for input_tensor in response.inputs\n        ]\n        outputs = [\n            KserveV2ModelTensorSpec(\n                name=output_tensor.name,\n                datatype=output_tensor.datatype,\n                shape=[int(dim) for dim in output_tensor.shape],\n            )\n            for output_tensor in response.outputs","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/docling-project/docling/blob/61d76f1ff3f8428065465889f7b4577da7df704c/docling/models/inference_engines/common/kserve_v2_grpc.py#L231-L267","documentation":"Raised as RuntimeError by KserveV2GrpcClient.get_model_metadata wrapping a grpc.RpcError from the ModelMetadata RPC. The underlying RpcError (UNAVAILABLE, DEADLINE_EXCEEDED, NOT_FOUND, UNAUTHENTICATED, ...) is included in the message and chained as __cause__.","triggerScenarios":"The gRPC call to the KServe ModelMetadata endpoint fails: server down/unreachable, wrong base_url, TLS mismatch, timeout, unknown model name/version, or missing auth metadata.","commonSituations":"Wrong endpoint URL or port (HTTP port vs gRPC port); self-signed cert with use_tls misconfigured; server pod not ready; model_version set to a nonexistent version; expired auth token in metadata.","solutions":["Read the gRPC status in the message (code + details) — UNAVAILABLE means connectivity/URL, NOT_FOUND means model name/version, DEADLINE_EXCEEDED means raise timeout.","Check base_url points at the gRPC port (commonly 8033/443 for KServe, not the HTTP 8080) and use_tls matches the server.","Verify the model_name/model_version against the server's model registry and retry once the server is healthy."],"exampleFix":"# before\nclient = KserveV2GrpcClient(base_url='http://mysvc:8080', ...)  # HTTP port -> UNAVAILABLE\n\n# after\nclient = KserveV2GrpcClient(base_url='mysvc:8033', use_tls=False, ...)  # gRPC port","handlingStrategy":"retry","validationCode":"from urllib.parse import urlsplit\nu = urlsplit('//' + base_url)\nassert u.port, 'base_url must include the gRPC port'\nassert model_name, 'model_name required before metadata call'","typeGuard":null,"tryCatchPattern":"import time\nfor attempt in range(3):\n    try:\n        meta = client.get_model_metadata()\n        break\n    except RuntimeError as e:\n        if 'UNAVAILABLE' in str(e) and attempt < 2:\n            time.sleep(2 ** attempt)\n            continue\n        raise","preventionTips":["Point base_url at the gRPC port, not the HTTP port.","Health-check with get_model_metadata() at startup and retry transient UNAVAILABLE codes.","Match use_tls to the server and pass auth metadata explicitly."],"tags":["kserve","grpc","network","model-serving","runtime-error"],"backgroundTag":null,"analyzedSha":"61d76f1ff3f8428065465889f7b4577da7df704c","analyzedAt":"2026-08-14T23:53:18.727Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}