t8y2/dbx · error · ValueError

BENCH_CANDIDATES selected no candidates

Error message

BENCH_CANDIDATES selected no candidates

What it means

configured_candidates() builds the list of candidate agents to benchmark based on BENCH_CANDIDATES and raises ValueError if the selection ends up empty. The harness needs at least one agent to compare; running with zero candidates would produce meaningless results, so it fails fast.

Source

Thrown at agents/drivers/hive-go/bench/agent_compare.py:307

        artifact = required_path("GO_AGENT")
        raw_command = os.getenv("GO_AGENT_COMMAND", "")
        command = shlex.split(raw_command) if raw_command else [str(artifact)]
        candidates.append(
            Candidate("go-native", command, artifact, os.getenv("GO_RSS_COMMAND", ""))
        )
    if "jdbc" in selected:
        artifact = required_path("JDBC_AGENT_JAR")
        raw_command = os.getenv("JDBC_AGENT_COMMAND", "")
        command = (
            shlex.split(raw_command)
            if raw_command
            else [env_default("JAVA_BIN", "java"), "-jar", str(artifact)]
        )
        candidates.append(
            Candidate("jdbc-java", command, artifact, os.getenv("JDBC_RSS_COMMAND", ""))
        )
    if not candidates:
        raise ValueError("BENCH_CANDIDATES selected no candidates")
    return candidates


def connection_params() -> dict:
    return {
        "host": env_default("HIVE_HOST", "127.0.0.1"),
        "port": env_int("HIVE_PORT", 10000),
        "database": env_default("HIVE_DATABASE", "dbx_agent_bench"),
        "username": os.getenv("HIVE_USERNAME", ""),
        "password": os.getenv("HIVE_PASSWORD", ""),
        "url_params": env_default("HIVE_URL_PARAMS", "auth=noSasl"),
        "connection_string": os.getenv("HIVE_CONNECTION_STRING", ""),
        "ssl": env_bool("HIVE_SSL", False),
        "ca_cert_path": os.getenv("HIVE_CA_CERT_PATH", ""),
        "client_cert_path": os.getenv("HIVE_CLIENT_CERT_PATH", ""),
        "client_key_path": os.getenv("HIVE_CLIENT_KEY_PATH", ""),
        "connect_timeout_secs": env_int("HIVE_CONNECT_TIMEOUT", 30),
    }

View on GitHub (pinned to c0390bff16)

Solutions

  1. Set BENCH_CANDIDATES to at least one valid candidate id, e.g. export BENCH_CANDIDATES=hive-go
  2. Unset BENCH_CANDIDATES to use the harness default selection
  3. Verify spelling against the candidate ids recognized by the script
  4. Build the prerequisite artifacts so a listed candidate isn't skipped

Example fix

// before
export BENCH_CANDIDATES=""
// after
export BENCH_CANDIDATES=hive-go,jdbc-java
Defensive patterns

Strategy: validation

Validate before calling

import os
VALID = {"hive-go", "jdbc-java"}  # ids known to the harness
sel = [c for c in os.getenv("BENCH_CANDIDATES", "").split(",") if c.strip()]
if not sel:
    raise SystemExit("BENCH_CANDIDATES must list at least one candidate")
unknown = set(sel) - VALID
if unknown:
    raise SystemExit(f"unknown candidates: {unknown}")

Try / catch

try:
    candidates = configured_candidates()
except ValueError as e:
    if "selected no candidates" in str(e):
        os.environ["BENCH_CANDIDATES"] = "hive-go"
        candidates = configured_candidates()
    else:
        raise

Prevention

When it happens

Trigger: BENCH_CANDIDATES set to an empty string, whitespace, or only names that don't match any known candidate type (e.g. a typo like 'hive-go-agents'), or set to a name whose required artifact (jar/binary) isn't present so it's skipped.

Common situations: CI config exporting BENCH_CANDIDATES="" by default; renaming candidate ids in config without updating the env var; filtering out all candidates because prerequisite build artifacts (jar) are missing on the machine.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/09cf2e2064019047. Report an issue: GitHub.