{"record":{"id":"10f4a605cfa4ab1a","repo":"risingwavelabs/risingwave","slug":"unsupported-format-only-text-and-json-ar","errorCode":null,"errorMessage":"Unsupported format `{}`, only `text` and `json` are supported for now","messagePattern":"Unsupported format `(.+?)`, only `text` and `json` are supported for now","errorType":"http","errorClass":"DashboardError","httpStatus":400,"severity":"warning","filePath":"src/meta/src/dashboard/mod.rs","lineNumber":484,"sourceCode":"            .collect();\n\n        Ok(Json(result))\n    }\n\n    #[derive(Debug, Deserialize)]\n    pub struct AwaitTreeDumpParams {\n        #[serde(default = \"await_tree_default_format\")]\n        format: String,\n    }\n\n    impl AwaitTreeDumpParams {\n        /// Parse the `format` parameter to [`ActorTracesFormat`].\n        pub fn actor_traces_format(&self) -> Result<ActorTracesFormat> {\n            Ok(match self.format.as_str() {\n                \"text\" => ActorTracesFormat::Text,\n                \"json\" => ActorTracesFormat::Json,\n                _ => {\n                    return Err(err(anyhow!(\n                        \"Unsupported format `{}`, only `text` and `json` are supported for now\",\n                        self.format\n                    )));\n                }\n            })\n        }\n    }\n\n    fn await_tree_default_format() -> String {\n        // In dashboard, await tree is usually for engineer to debug, so we use human-readable text format by default here.\n        \"text\".to_owned()\n    }\n\n    pub async fn dump_await_tree_all(\n        Query(params): Query<AwaitTreeDumpParams>,\n        Extension(srv): Extension<Service>,\n    ) -> Result<Json<StackTraceResponse>> {\n        let actor_traces_format = params.actor_traces_format()?;","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/dashboard/mod.rs#L466-L502","documentation":"The dashboard HTTP API's `actor_traces_format` query helper parses the `format` parameter into an ActorTracesFormat enum. Only the literal strings `text` and `json` are accepted; any other value causes this error. It protects the trace-reporting endpoint from unrecognized serialization formats.","triggerScenarios":"Calling GET /api/v1/actor_traces (or any handler invoking Service::actor_traces_format) with a `format` query parameter other than `text` or `json`, e.g. `format=txt`, `format=TEXT`, or `format=protobuf`.","commonSituations":"Scripts or dashboards passing capitalized or abbreviated format names; clients copying a format string from another API (e.g. `pretty` or `yaml`); typos in monitoring tooling that scrapes the RisingWave dashboard.","solutions":["Change the `format` query parameter to exactly `text` or `json` (lowercase).","Omit the `format` parameter if the handler defaults it, or check the dashboard handler docs for accepted values.","If a new format is genuinely needed, extend the match in src/meta/src/dashboard/mod.rs actor_traces_format and rebuild the meta node."],"exampleFix":"// before\ncurl 'http://localhost:5691/api/v1/actor_traces?format=pretty'\n// after\ncurl 'http://localhost:5691/api/v1/actor_traces?format=json'","handlingStrategy":"validation","validationCode":"const f = new URLSearchParams({ format: 'json' });\nif (!['text', 'json'].includes(f.get('format'))) throw new Error(\"format must be 'text' or 'json'\");\nconst url = `http://localhost:5691/api/v1/actor_traces?${f}`;","typeGuard":"function isActorTracesFormat(v) { return v === 'text' || v === 'json'; }","tryCatchPattern":"try { const res = await fetch(url); if (!res.ok) throw new Error(await res.text()); } catch (e) { /* check for 'Unsupported format' and fix the param */ }","preventionTips":["Always pass the format parameter lowercase from a fixed constant, not free-form config.","Validate user-supplied format strings against ['text','json'] before building the URL."],"tags":["http-api","invalid-parameter","rust","risingwave"],"backgroundTag":"invalid-enum-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"}