apache/beam · error · ValueError

Endpoint has no models deployed to it.

Error message

Endpoint %s has no models deployed to it.

What it means

_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.

Solutions

  1. Deploy a model to the endpoint (aiplatform.Model.deploy) before running the pipeline
  2. Verify the endpoint id is the one with the deployed model in the correct region
  3. If deployment is in progress, wait for it to finish and retry

Example fix

// before
handler = VertexAIModelHandlerGPU(endpoint_id='empty-endpoint-id', ...)
// after  # deploy first
model.deploy(endpoint=endpoint, machine_type='n1-standard-4')
handler = VertexAIModelHandlerGPU(endpoint_id='empty-endpoint-id', ...)
Defensive patterns

Strategy: validation

Validate before calling

from google.cloud import aiplatform
endpoint = aiplatform.Endpoint(endpoint_name=endpoint_id)
if len(endpoint.list_models()) == 0:
    raise RuntimeError(f'Endpoint {endpoint_id} has no deployed models; deploy before running the pipeline')

Try / catch

try:
    handler = VertexAIModelHandlerGPU(endpoint_id=ep, ...)
except ValueError as e:
    if 'no models deployed' in str(e):
        deploy_model_to_endpoint(ep)
    raise

Prevention

When it happens

Trigger: Creating VertexAIModelHandlerGPU or calling create_client against an endpoint_id that exists but has zero deployed models (undeployed or all versions removed).

Common situations: 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.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/769eaa61612fa97f. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/apache_beam/ml/inference/vertex_ai_inference.py:200

      ValueError: if endpoint is inactive or has no models deployed to it.
    """
    if is_private:
      endpoint: aiplatform.Endpoint = aiplatform.PrivateEndpoint(
          endpoint_name=endpoint_id, location=location)
      LOGGER.debug("Treating endpoint %s as private", endpoint_id)
    else:
      endpoint = aiplatform.Endpoint(
          endpoint_name=endpoint_id, location=location)
      LOGGER.debug("Treating endpoint %s as public", endpoint_id)

    try:
      mod_list = endpoint.list_models()
    except Exception as e:
      raise ValueError(
          "Failed to contact endpoint %s, got exception: %s", endpoint_id, e)

    if len(mod_list) == 0:
      raise ValueError("Endpoint %s has no models deployed to it.", endpoint_id)

    return endpoint

  def create_client(self) -> aiplatform.Endpoint:
    """Loads the Endpoint object used to build and send prediction request to
    Vertex AI.
    """
    # Check to make sure the endpoint is still active since pipeline
    # construction time
    ep = self._retrieve_endpoint(
        self.endpoint_name, self.location, self.is_private)
    return ep

  def request(
      self,
      batch: Sequence[Any],
      model: aiplatform.Endpoint,
      inference_args: Optional[dict[str, Any]] = None

View on GitHub (pinned to 12126d8942)