databendlabs/databend · error
Invalid config.rpc
Error message
Invalid config.rpc: {} What it means
In metabench's run_benchmark_once, the cmd argument is dispatched over a fixed list of benchmark commands; any unrecognized cmd (driven by an invalid config.rpc value) hits unreachable!("Invalid config.rpc: {}"), crashing the benchmark binary. It guards the assumption that the config only ever names supported benchmark commands.
Solutions
- Check the config.rpc/cmd value against the commands handled in run_benchmark_once and fix the typo.
- Add the missing dispatch arm if it is a new benchmark command.
- Convert the unreachable! into a graceful error that lists valid options.
Example fix
// before
_ => unreachable!("Invalid config.rpc: {}", rpc),
// after
_ => panic!("Invalid config.rpc: {} (supported: upsert, get, list, semaphore, ...)", rpc), Defensive patterns
Strategy: validation
Validate before calling
let supported = ["upsert", "get", "list", "semaphore", "copy"];
if !supported.contains(&rpc.as_str()) {
panic!("Invalid config.rpc: {} (expected one of {:?})", rpc, supported);
} Try / catch
_ => Err(anyhow::anyhow!(
"Invalid config.rpc: {} (valid: upsert, get, list, semaphore)", rpc
)), Prevention
- Validate config.rpc against the supported command list before starting the benchmark.
- Keep the dispatcher and example config in sync; update both when adding commands.
- Copy configs only between metabench versions that share the command set.
- Print the list of valid commands in the error message for quick fixes.
When it happens
Trigger: Setting rpc/cmd in the metabench config to a value outside the supported set (e.g. a typo like 'upserts' instead of 'upsert', or a command removed from the dispatcher) and running the benchmark.
Common situations: Hand-edited benchmark configs; configs reused across metabench versions where a command was renamed or removed; adding a new benchmark to the config before implementing its dispatch arm.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11).
Data as JSON: /api/errors/0bca4fc58904cb66.
Report an issue: GitHub.
Appendix: source
Thrown at src/meta/binaries/metabench/main.rs:410
benchmark_upsert(client, prefix, client_num, i).await
} else if cmd == "table" {
benchmark_table(client, prefix, client_num, i).await
} else if cmd == "create_tables" {
benchmark_create_tables(client, prefix, client_num, i, param).await
} else if cmd == "batch_create_tables" {
benchmark_batch_create_tables(client, prefix, client_num, i, param).await
} else if cmd == "get_table" {
benchmark_get_table(client, prefix, client_num, i).await
} else if cmd == "get_table_rand" {
benchmark_get_table_rand(client, client_num, i, param).await
} else if cmd == "table_copy_file" {
benchmark_table_copy_file(client, prefix, client_num, i, param).await
} else if cmd == "semaphore" {
benchmark_semaphore(client, prefix, client_num, i, param).await
} else if cmd == "list" {
benchmark_list(client, prefix, client_num, i, param).await
} else {
unreachable!("Invalid config.rpc: {}", rpc);
}
}
async fn benchmark_upsert(client: &MetaStore, prefix: u64, client_num: u64, i: u64) -> bool {
let node_key = || format!("{}-{}-{}", prefix, client_num, i);
let seq = MatchSeq::Any;
let value = Operation::Update(node_key().as_bytes().to_vec());
let res = client
.upsert_kv(UpsertKV::new(node_key(), seq, value, None))
.await;
print_res(i, "upsert_kv", &res);
res.is_ok()
}
async fn benchmark_table(client: &MetaStore, prefix: u64, client_num: u64, i: u64) -> bool {View on GitHub (pinned to 288d84d76e)