{"record":{"id":"0b03636998ab3f48","repo":"risingwavelabs/risingwave","slug":"invalid-actor-traces-format","errorCode":null,"errorMessage":"Invalid actor traces format","messagePattern":"Invalid actor traces format","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ctl/src/cmd_impl/await_tree.rs","lineNumber":30,"sourceCode":"// See the License for the specific language governing permissions and\n// limitations under the License.\n\nuse risingwave_common::util::StackTraceResponseExt;\nuse risingwave_pb::common::WorkerType;\nuse risingwave_pb::id::WorkerId;\nuse risingwave_pb::monitor_service::StackTraceRequest;\nuse risingwave_pb::monitor_service::stack_trace_request::ActorTracesFormat;\nuse risingwave_rpc_client::MonitorClientPool;\nuse rw_diagnose_tools::await_tree::AnalyzeSummary;\nuse thiserror_ext::AsReport as _;\n\nuse crate::CtlContext;\n\npub async fn dump(context: &CtlContext, actor_traces_format: Option<String>) -> anyhow::Result<()> {\n    let actor_traces_format = match actor_traces_format.as_deref() {\n        Some(\"text\") => ActorTracesFormat::Text,\n        Some(\"json\") | None => ActorTracesFormat::Json,\n        _ => return Err(anyhow::anyhow!(\"Invalid actor traces format\")),\n    };\n\n    // Query the meta node for the await tree of all nodes in the cluster.\n    let meta_client = context.meta_client().await?;\n    let all = meta_client\n        .get_cluster_stack_trace(actor_traces_format)\n        .await?;\n\n    if all.actor_traces.is_empty()\n        && all.rpc_traces.is_empty()\n        && all.batch_traces.is_empty()\n        && all.compaction_task_traces.is_empty()\n        && all.inflight_barrier_traces.is_empty()\n    {\n        eprintln!(\"No actors are running, or `--async-stack-trace` not set?\");\n    }\n    println!(\"{}\", all.output());\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/ctl/src/cmd_impl/await_tree.rs#L12-L48","documentation":"The `risectl` await-tree dump command validates the --actor-traces-format flag and only accepts \"text\" or \"json\" (omitting it defaults to json). Any other string causes this anyhow error, aborting before contacting the meta node.","triggerScenarios":"Running `risectl await-tree dump --actor-traces-format <value>` with a value other than \"text\" or \"json\", e.g. \"Text\", \"pretty\", \"txt\" or an empty-but-set string.","commonSituations":"Typo or wrong casing in the CLI flag value; copying a format name from another tool; scripts passing a variable that is empty or malformed.","solutions":["Pass exactly \"text\" or \"json\" as the format value.","Omit the flag entirely to use the default (json).","Check script variables feeding the flag for empty/misspelled values."],"exampleFix":"// before\nrisectl await-tree dump --actor-traces-format pretty\n// after\nrisectl await-tree dump --actor-traces-format text","handlingStrategy":"validation","validationCode":"fn validate_traces_format(v: &Option<String>) -> bool {\n    matches!(v.as_deref(), None | Some(\"text\") | Some(\"json\"))\n}","typeGuard":null,"tryCatchPattern":"let res = risectl::cmd_impl::await_tree::dump(&ctx, fmt).await;\nif let Err(e) = res {\n    eprintln!(\"await-tree dump failed: {e}; use --actor-traces-format text|json\");\n}","preventionTips":["Only pass \"text\" or \"json\" to --actor-traces-format","Omit the flag for the json default","Guard shell variables feeding the flag against empty values"],"tags":["cli","await-tree","argument-validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}