{"record":{"id":"394a674c5de5f83d","repo":"risingwavelabs/risingwave","slug":"must-be-or-394a67","errorCode":null,"errorMessage":"`{}` must be {}, or {}","messagePattern":"`(.+?)` must be (.+?), or (.+?)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/starrocks.rs","lineNumber":161,"sourceCode":"crate::impl_sink_unknown_fields!(StarrocksConfig);\n\nimpl EnforceSecret for StarrocksConfig {\n    fn enforce_one(prop: &str) -> crate::error::ConnectorResult<()> {\n        StarrocksCommon::enforce_one(prop)\n    }\n}\n\nfn default_commit_checkpoint_interval() -> u64 {\n    DEFAULT_COMMIT_CHECKPOINT_INTERVAL_WITH_SINK_DECOUPLE\n}\n\nimpl StarrocksConfig {\n    pub fn from_btreemap(properties: BTreeMap<String, String>) -> Result<Self> {\n        let config =\n            serde_json::from_value::<StarrocksConfig>(serde_json::to_value(properties).unwrap())\n                .map_err(|e| SinkError::Config(anyhow!(e)))?;\n        if config.r#type != SINK_TYPE_APPEND_ONLY && config.r#type != SINK_TYPE_UPSERT {\n            return Err(SinkError::Config(anyhow!(\n                \"`{}` must be {}, or {}\",\n                SINK_TYPE_OPTION,\n                SINK_TYPE_APPEND_ONLY,\n                SINK_TYPE_UPSERT\n            )));\n        }\n        if config.commit_checkpoint_interval == 0 {\n            return Err(SinkError::Config(anyhow!(\n                \"`commit_checkpoint_interval` must be greater than 0\"\n            )));\n        }\n        if let Some(0) = config.max_batch_size_bytes {\n            return Err(SinkError::Config(anyhow!(\n                \"`starrocks.max_batch_size_bytes` must be greater than 0\"\n            )));\n        }\n        Ok(config)\n    }","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/starrocks.rs#L143-L179","documentation":"After deserializing, `from_btreemap` checks that the `type` option equals `append-only` or `upsert`. Any other value raises this `SinkError::Config`, telling the user which values are accepted (`{}` placeholders expand to the option name 'type', 'append-only', 'upsert'). StarRocks sink semantics differ fundamentally between the two modes, so no other value is meaningful.","triggerScenarios":"Creating a StarRocks sink with `type='insert'`, `type='append'`, `type='AppendOnly'` (wrong case), or any string other than the two accepted constants `SINK_TYPE_APPEND_ONLY` / `SINK_TYPE_UPSERT`.","commonSituations":"Copy-pasting connector examples from other sinks (e.g. Kafka's 'append'); case-sensitivity mistakes; assuming 'upsert' is spelled 'Upsert' or 'debezium'.","solutions":["Set `type='append-only'` or `type='upsert'` (exact lowercase strings) in the WITH options.","Use 'upsert' if the target StarRocks table has a key model and you need updates/deletes; 'append-only' for pure inserts.","Check other connector examples you copied — the `type` vocabulary is sink-specific in RisingWave."],"exampleFix":"-- before\nCREATE SINK s FROM mv WITH (connector='starrocks', type='append', ...);\n-- after\nCREATE SINK s FROM mv WITH (connector='starrocks', type='append-only', ...);","handlingStrategy":"validation","validationCode":"// Rust: check the type option before constructing the sink\nfn valid_sink_type(props: &BTreeMap<String, String>) -> bool {\n    matches!(props.get(\"type\").map(String::as_str), Some(\"append-only\") | Some(\"upsert\"))\n}","typeGuard":"fn is_valid_sink_type(v: &str) -> bool { v == \"append-only\" || v == \"upsert\" }","tryCatchPattern":"match StarrocksConfig::from_btreemap(props) {\n    Err(e) if e.to_string().contains(\"must be append-only, or upsert\") => {\n        eprintln!(\"set type='append-only' or type='upsert'\");\n    }\n    other => other,\n}","preventionTips":["Use the exact lowercase strings 'append-only' or 'upsert'","Don't reuse `type` values from other connectors","Validate user input in dashboards/tools that build CREATE SINK statements"],"tags":["starrocks","sink","config","enum"],"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-14T16:17:12.679Z"}