{"record":{"id":"761663e164e4b740","repo":"risingwavelabs/risingwave","slug":"insert-error","errorCode":null,"errorMessage":"Insert error: {}, {}, {:?}","messagePattern":"Insert error: (.+?), (.+?), (.+?)","errorType":"exception","errorClass":"SinkError::DorisStarrocksConnect","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/starrocks.rs","lineNumber":885,"sourceCode":"    insert: InserterInner,\n}\nimpl StarrocksClient {\n    pub fn new(insert: InserterInner) -> Self {\n        Self { insert }\n    }\n\n    pub async fn write(&mut self, data: Bytes) -> Result<()> {\n        self.insert.write(data).await?;\n        Ok(())\n    }\n\n    pub async fn finish(self) -> Result<StarrocksInsertResultResponse> {\n        let raw = self.insert.finish().await?;\n        let res: StarrocksInsertResultResponse = serde_json::from_slice(&raw)\n            .map_err(|err| SinkError::DorisStarrocksConnect(anyhow!(err)))?;\n\n        if !STARROCKS_SUCCESS_STATUS.contains(&res.status.as_str()) {\n            return Err(SinkError::DorisStarrocksConnect(anyhow::anyhow!(\n                \"Insert error: {}, {}, {:?}\",\n                res.status,\n                res.message,\n                res.error_url,\n            )));\n        };\n        Ok(res)\n    }\n}\n\npub struct StarrocksTxnClient {\n    request_builder: StarrocksTxnRequestBuilder,\n}\n\nimpl StarrocksTxnClient {\n    pub fn new(request_builder: StarrocksTxnRequestBuilder) -> Self {\n        Self { request_builder }\n    }","sourceCodeStart":867,"sourceCodeEnd":903,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/starrocks.rs#L867-L903","documentation":"The stream-load response was valid JSON but its `status` is not in `STARROCKS_SUCCESS_STATUS` (e.g. not \"Success\"/\"Publish Timeout\"), so the insert failed on the StarRocks side and the status, message, and error_url are surfaced in the error.","triggerScenarios":"Batch stream-load insert rejected: schema mismatch (column count/types), data type conversion failure, wrong label/duplicate, BE overload, or any load-time error reported by StarRocks with a non-success status.","commonSituations":"RisingWave schema drifted from the StarRocks table (added/dropped/reordered columns); inserting a value that can't be cast to the StarRocks column type; NULL into a non-nullable column. The `error_url` in the message points to detailed per-row error logs on the StarRocks BE.","solutions":["Fetch the error_url from the message in a browser/curl to see the exact row-level load errors","Align the RisingWave sink schema with the StarRocks table columns (names, order, types)","Fix incompatible data values (e.g. oversized strings, NULLs in NOT NULL columns, bad date formats)","Check StarRocks BE logs and cluster health if errors are resource-related"],"exampleFix":"// before (StarRocks)\nCREATE TABLE t (id INT, ts DATETIME NOT NULL) PRIMARY KEY(id)...;\n// after: make source supply ts or make column nullable\nCREATE TABLE t (id INT, ts DATETIME NULL) PRIMARY KEY(id)...;","handlingStrategy":"try-catch","validationCode":"// Confirm schema compatibility before sinking:\nSELECT column_name, column_type, is_nullable FROM information_schema.columns\nWHERE table_schema='db' AND table_name='t';","typeGuard":null,"tryCatchPattern":"match err {\n  SinkError::DorisStarrocksConnect(e) if format!(\"{}\", e).starts_with(\"Insert error\") => {\n    // parse error_url from message and inspect detailed row errors\n  }\n  other => handle(other),\n}","preventionTips":["Keep RisingWave sink schema and StarRocks table schema in sync","Always inspect the error_url in the message for row-level details","Avoid NULLs for NOT NULL columns; validate data formats (dates, numbers)"],"tags":["starrocks","stream-load","insert","data"],"backgroundTag":"http-error-response","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"}