{"record":{"id":"edab9e4c5944432b","repo":"risingwavelabs/risingwave","slug":"can-t-get-label-from-response","errorCode":null,"errorMessage":"Can't get label from response","messagePattern":"Can't get label from response","errorType":"exception","errorClass":"SinkError::DorisStarrocksConnect","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/starrocks.rs","lineNumber":917,"sourceCode":"\nimpl StarrocksTxnClient {\n    pub fn new(request_builder: StarrocksTxnRequestBuilder) -> Self {\n        Self { request_builder }\n    }\n\n    fn check_response_and_extract_label(&self, res: Bytes) -> Result<String> {\n        let res: StarrocksInsertResultResponse = serde_json::from_slice(&res)\n            .map_err(|err| SinkError::DorisStarrocksConnect(anyhow!(err)))?;\n        if !STARROCKS_SUCCESS_STATUS.contains(&res.status.as_str()) {\n            return Err(SinkError::DorisStarrocksConnect(anyhow::anyhow!(\n                \"transaction error: {}, {}, {:?}\",\n                res.status,\n                res.message,\n                res.error_url,\n            )));\n        }\n        res.label.ok_or_else(|| {\n            SinkError::DorisStarrocksConnect(anyhow::anyhow!(\"Can't get label from response\"))\n        })\n    }\n\n    pub async fn begin(&self, label: String) -> Result<String> {\n        let res = self\n            .request_builder\n            .build_begin_request_sender(label)?\n            .send()\n            .await?;\n        self.check_response_and_extract_label(res)\n    }\n\n    pub async fn prepare(&self, label: String) -> Result<String> {\n        let res = self\n            .request_builder\n            .build_prepare_request_sender(label)?\n            .send()\n            .await?;","sourceCodeStart":899,"sourceCodeEnd":935,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/starrocks.rs#L899-L935","documentation":"After a successful-status Starrocks transaction response is parsed, the optional 'label' field is absent, so the sink cannot return the transaction label. This indicates a malformed or unexpected success response from Starrocks.","triggerScenarios":"Starrocks FE responds with a success status but omits the 'label' field in the JSON body of begin/commit responses.","commonSituations":"Starrocks version with different response format; proxy/load-balancer stripping or altering the response body; FE misconfiguration.","solutions":["Log the raw response body to confirm what Starrocks actually returned","Upgrade or pin a Starrocks version whose insert/transaction API returns the label field","Check for proxies or gateways between RisingWave and Starrocks that may rewrite responses","Retry the transaction; if persistent, capture a curl of the same endpoint to compare"],"exampleFix":"// before\nres.label.ok_or_else(|| SinkError::DorisStarrocksConnect(anyhow::anyhow!(\"Can't get label from response\")))\n// after\n// include raw body for debugging\nres.label.ok_or_else(|| SinkError::DorisStarrocksConnect(anyhow::anyhow!(\"Can't get label from response: {}\", String::from_utf8_lossy(&raw))))","handlingStrategy":"try-catch","validationCode":"if (!body || !('label' in body)) throw new Error('response missing label')","typeGuard":"const hasLabel = (r) => typeof r?.label === 'string' && r.label.length > 0;","tryCatchPattern":"catch (SinkError::DorisStarrocksConnect(e)) { dump raw response; alert on format drift }","preventionTips":["Pin compatible Starrocks versions","Bypass/verify proxies that may rewrite FE responses","Log raw response bodies on parse anomalies"],"tags":["starrocks","sink","response-parsing"],"backgroundTag":"unexpected-response-shape","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"}