t8y2/dbx · error · ValueError
unknown workload kind: {workload['kind']}
Error message
unknown workload kind: {workload['kind']} What it means
execute_workload only understands workload kinds "rpc" and "paged"; anything else raises ValueError with the unknown kind. It is a strict enum-style validation on the workload dict produced by configured_workloads.
Source
Thrown at agents/drivers/argo-go/bench/agent_compare.py:491
for _ in range(operations):
started = time.perf_counter()
execute_workload(process, workload, session_id)
samples.append(elapsed_ms(started))
return samples
def execute_workload(
process: AgentProcess,
workload: dict,
agent_session_id: str = "",
) -> object:
params = dict(workload.get("params", {}))
if agent_session_id:
params["agentSessionId"] = agent_session_id
if workload["kind"] == "rpc":
return process.call(workload["method"], params)
if workload["kind"] != "paged":
raise ValueError(f"unknown workload kind: {workload['kind']}")
first = process.call(
"execute_query_page",
{
"sql": workload["sql"],
"maxRows": workload["max_rows"],
"pageSize": workload["page_size"],
**({"agentSessionId": agent_session_id} if agent_session_id else {}),
},
)
rows = len(first.get("rows", []))
session_id = first.get("session_id")
has_more = first.get("has_more", False)
try:
while has_more:
page = process.call(
"fetch_query_page",
{
"sessionId": session_id,View on GitHub (pinned to c0390bff16)
Solutions
- Change the workload's `kind` in the config to "rpc" or "paged"
- Fix casing/typo — the comparison is exact and case-sensitive
- If a new kind is needed, add an explicit branch in execute_workload implementing it
- Add validation in configured_workloads so bad kinds are rejected with a list of valid kinds
Example fix
// before
{"kind": "page", "sql": "SELECT ..."}
// after
{"kind": "paged", "sql": "SELECT ...", "max_rows": 1000, "page_size": 100} Defensive patterns
Strategy: validation
Validate before calling
VALID_KINDS = {"rpc", "paged"}
for w in workloads:
if w.get("kind") not in VALID_KINDS:
raise ValueError(f"{w.get('kind')!r} not in {sorted(VALID_KINDS)}") Type guard
def is_valid_workload(w: dict) -> bool:
return w.get("kind") in ("rpc", "paged") Try / catch
try:
rows = execute_workload(process, workload, agent_session_id)
except ValueError as e:
if str(e).startswith("unknown workload kind"):
print(f"skipping workload: {e}")
else:
raise Prevention
- Only use "rpc" or "paged" as workload kinds in configs
- Mind exact lowercase spelling — no "Paged" or "page"
- When adding a new kind, update execute_workload's dispatcher, not just the config
- Validate workload JSON at load time with a schema check
When it happens
Trigger: A workload dict whose `kind` is neither "rpc" nor "paged" reaches execute_workload — via benchmark_workload, benchmark_concurrency, or concurrency_worker — typically from a hand-edited workload config or a new kind added in config without a handler in execute_workload.
Common situations: Typo like "page" or "Paged" (case-sensitive check); user added a new workload kind (e.g. "stream") in config but only edited the config, not the dispatcher; older workload JSON format migrated incorrectly.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Agent runtime thread limits must be positive
- Unsupported H2 driver profile: " + profile
- Unsupported peek startPosition: ${value}
- MongoDB explain verbosity must be queryPlanner, executionSta
- JDBC URL is required.
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/8825434eb297eee5.
Report an issue: GitHub.