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 agent candidates from BENCH_CANDIDATES selections; if no known candidate is selected or the resulting list is empty, it raises ValueError('BENCH_CANDIDATES selected no candidates'). The bench cannot run without at least one agent.
Source
Thrown at agents/drivers/cassandra-go/bench/agent_compare.py:178
"results": results,
}
json.dump(output, sys.stdout, ensure_ascii=False, indent=2)
sys.stdout.write("\n")
def configured_candidates() -> list[Candidate]:
selected = {item.strip() for item in env_default("BENCH_CANDIDATES", "go,jdbc").split(",") if item.strip()}
candidates = []
if "go" in selected:
artifact = required_path("GO_AGENT")
candidates.append(Candidate("go-native", [str(artifact)], 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("CASSANDRA_HOST", "127.0.0.1"),
"port": env_int("CASSANDRA_PORT", 9042),
"database": env_default("CASSANDRA_KEYSPACE", "dbx_native_test"),
"username": os.getenv("CASSANDRA_USERNAME", ""),
"password": os.getenv("CASSANDRA_PASSWORD", ""),
"url_params": os.getenv("CASSANDRA_URL_PARAMS", ""),
"connection_string": os.getenv("CASSANDRA_CONNECTION_STRING", ""),
"ssl": env_bool("CASSANDRA_SSL", False),
"ca_cert_path": os.getenv("CASSANDRA_CA_CERT_PATH", ""),
"client_cert_path": os.getenv("CASSANDRA_CLIENT_CERT_PATH", ""),
"client_key_path": os.getenv("CASSANDRA_CLIENT_KEY_PATH", ""),
}
View on GitHub (pinned to c0390bff16)
Solutions
- Set BENCH_CANDIDATES to a supported name, e.g. export BENCH_CANDIDATES=jdbc
- Check spelling against the supported selection tokens in configured_candidates
- Verify the variable is actually exported in your shell/CI environment
Example fix
// before BENCH_CANDIDATES= python agent_compare.py // after BENCH_CANDIDATES=jdbc python agent_compare.py
Defensive patterns
Strategy: validation
Validate before calling
raw = os.getenv("BENCH_CANDIDATES", "")
selected = {token.strip() for token in raw.split(",") if token.strip()}
if not selected:
raise SystemExit("BENCH_CANDIDATES must name at least one supported candidate (e.g. jdbc)")
print(f"candidates selected: {sorted(selected)}") Try / catch
try:
candidates = configured_candidates()
except ValueError as exc:
if "selected no candidates" in str(exc):
sys.exit("set BENCH_CANDIDATES, e.g. export BENCH_CANDIDATES=jdbc")
raise Prevention
- Export BENCH_CANDIDATES explicitly in run scripts and CI pipelines
- Echo the variable value at the top of your bench wrapper for visibility
- Keep candidate names in a documented constant list and validate with shellcheck-style linting
When it happens
Trigger: BENCH_CANDIDATES is empty/unset, contains only unrecognized tokens (not e.g. 'jdbc'), or every selected branch fails to append a candidate.
Common situations: Forgot to set BENCH_CANDIDATES in CI; typo like 'jdbc ' with different casing or an unsupported name; variable exported as blank in a pipeline.
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
- {name} must be positive
- {name} must be positive
- {name} must contain positive integers
- {name} must be a boolean
- {name} must be a boolean
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/f7343b1f843f5be6.
Report an issue: GitHub.