apache/beam · error · ValueError

One of location, url, host, or path must be provided for…

Error message

One of location, url, host, or path must be provided for Qdrant

What it means

QdrantVectorStoreConfig.__post_init__ validates that at least one connection target is set: location, url, host, or path. Without one, the Qdrant client cannot determine which server or local storage to connect to, so the dataclass refuses construction.

Solutions

  1. Set one connection field, e.g. QdrantVectorStoreConfig(url='https://xyz.cloud.qdrant.io:6333')
  2. Use the for_cloud(url=..., api_key=...) classmethod for Qdrant Cloud clusters
  3. Set host/port for a self-hosted instance, or path='/tmp/qdrant' for local embedded storage
  4. Verify the pipeline options / config dict actually supply a connection value before constructing the config

Example fix

// before
config = QdrantVectorStoreConfig()
// after
config = QdrantVectorStoreConfig(url="https://my-cluster.qdrant.io:6333", api_key=api_key)
Defensive patterns

Strategy: validation

Validate before calling

def assert_qdrant_target(config):
    assert config.location or config.url or config.host or config.path, \
        "Qdrant config needs location, url, host, or path"

Type guard

def has_qdrant_target(cfg) -> bool:
    return bool(cfg.location or cfg.url or cfg.host or cfg.path)

Prevention

When it happens

Trigger: Instantiating QdrantVectorStoreConfig() (or QdrantWriteParameters-style config wrapping it) with all of location, url, host, and path left as None — e.g. building the config dynamically from empty/missing settings dict values.

Common situations: Config values read from pipeline options or environment variables that were never set; copying a config example but deleting the connection fields; constructing the dataclass programmatically with defaults only.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at sdks/python/apache_beam/ml/rag/ingestion/qdrant.py:94

    **kwargs: Additional arguments passed directly into client initialization
  """

  location: Optional[str] = None
  url: Optional[str] = None
  port: Optional[int] = 6333
  grpc_port: int = 6334
  prefer_grpc: bool = False
  https: Optional[bool] = None
  api_key: Optional[str] = None
  prefix: Optional[str] = None
  timeout: Optional[int] = None
  host: Optional[str] = None
  path: Optional[str] = None
  kwargs: dict[str, Any] = field(default_factory=dict)

  def __post_init__(self):
    if not (self.location or self.url or self.host or self.path):
      raise ValueError(
          "One of location, url, host, or path must be provided for Qdrant")

  @classmethod
  def for_cloud(
      cls,
      url: str,
      api_key: str,
      *,
      prefer_grpc: bool = False,
      timeout: Optional[int] = None,
      **kwargs: Any,
  ) -> "QdrantConnectionParameters":
    """Connect to Qdrant Cloud. Requires the cluster URL and an API key."""
    return cls(
        url=url,
        api_key=api_key,
        https=True,
        prefer_grpc=prefer_grpc,

View on GitHub (pinned to 12126d8942)