{"record":{"id":"769eaa61612fa97f","repo":"apache/beam","slug":"endpoint-s-has-no-models-deployed-to-it","errorCode":null,"errorMessage":"Endpoint %s has no models deployed to it.","messagePattern":"Endpoint (.+?) has no models deployed to it\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/inference/vertex_ai_inference.py","lineNumber":200,"sourceCode":"      ValueError: if endpoint is inactive or has no models deployed to it.\n    \"\"\"\n    if is_private:\n      endpoint: aiplatform.Endpoint = aiplatform.PrivateEndpoint(\n          endpoint_name=endpoint_id, location=location)\n      LOGGER.debug(\"Treating endpoint %s as private\", endpoint_id)\n    else:\n      endpoint = aiplatform.Endpoint(\n          endpoint_name=endpoint_id, location=location)\n      LOGGER.debug(\"Treating endpoint %s as public\", endpoint_id)\n\n    try:\n      mod_list = endpoint.list_models()\n    except Exception as e:\n      raise ValueError(\n          \"Failed to contact endpoint %s, got exception: %s\", endpoint_id, e)\n\n    if len(mod_list) == 0:\n      raise ValueError(\"Endpoint %s has no models deployed to it.\", endpoint_id)\n\n    return endpoint\n\n  def create_client(self) -> aiplatform.Endpoint:\n    \"\"\"Loads the Endpoint object used to build and send prediction request to\n    Vertex AI.\n    \"\"\"\n    # Check to make sure the endpoint is still active since pipeline\n    # construction time\n    ep = self._retrieve_endpoint(\n        self.endpoint_name, self.location, self.is_private)\n    return ep\n\n  def request(\n      self,\n      batch: Sequence[Any],\n      model: aiplatform.Endpoint,\n      inference_args: Optional[dict[str, Any]] = None","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/inference/vertex_ai_inference.py#L182-L218","documentation":"_retrieve_endpoint raises ValueError when endpoint.list_models() succeeds but returns an empty list, meaning the Vertex AI endpoint exists but has no model deployed to it, so predictions cannot be served.","triggerScenarios":"Creating VertexAIModelHandlerGPU or calling create_client against an endpoint_id that exists but has zero deployed models (undeployed or all versions removed).","commonSituations":"Referring to a freshly created endpoint whose model deploy job failed or is still in progress; endpoint cleaned up by lifecycle automation; wrong endpoint id pointing at an empty endpoint.","solutions":["Deploy a model to the endpoint (aiplatform.Model.deploy) before running the pipeline","Verify the endpoint id is the one with the deployed model in the correct region","If deployment is in progress, wait for it to finish and retry"],"exampleFix":"// before\nhandler = VertexAIModelHandlerGPU(endpoint_id='empty-endpoint-id', ...)\n// after  # deploy first\nmodel.deploy(endpoint=endpoint, machine_type='n1-standard-4')\nhandler = VertexAIModelHandlerGPU(endpoint_id='empty-endpoint-id', ...)","handlingStrategy":"validation","validationCode":"from google.cloud import aiplatform\nendpoint = aiplatform.Endpoint(endpoint_name=endpoint_id)\nif len(endpoint.list_models()) == 0:\n    raise RuntimeError(f'Endpoint {endpoint_id} has no deployed models; deploy before running the pipeline')","typeGuard":null,"tryCatchPattern":"try:\n    handler = VertexAIModelHandlerGPU(endpoint_id=ep, ...)\nexcept ValueError as e:\n    if 'no models deployed' in str(e):\n        deploy_model_to_endpoint(ep)\n    raise","preventionTips":["Confirm the endpoint shows a deployed model in the GCP console","Ensure the model deployment step completes before starting inference pipelines","Watch for lifecycle automation that undeploys idle models"],"tags":["apache-beam","vertex-ai","gcp","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}