{"record":{"id":"da734611ed6a8ff5","repo":"risingwavelabs/risingwave","slug":"properties-scan-startup-mode-only-supports-earli","errorCode":null,"errorMessage":"properties `scan_startup_mode` only supports earliest and latest or leaving it empty","messagePattern":"properties `scan_startup_mode` only supports earliest and latest or leaving it empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/kafka/enumerator.rs","lineNumber":199,"sourceCode":"        if let Some(log_level) = read_kafka_log_level() {\n            config.set_log_level(log_level);\n        }\n        properties.connection.set_security_properties(&mut config);\n        properties.set_client(&mut config);\n        // The meta-side split enumerator does not export librdkafka native stats, so disable\n        // periodic statistics callbacks here even if the source properties enable them for\n        // compute-side readers.\n        config.set(\"statistics.interval.ms\", \"0\");\n        let mut scan_start_offset = match properties\n            .scan_startup_mode\n            .as_ref()\n            .map(|s| s.to_lowercase())\n            .as_deref()\n        {\n            Some(\"earliest\") => KafkaEnumeratorOffset::Earliest,\n            Some(\"latest\") => KafkaEnumeratorOffset::Latest,\n            None => KafkaEnumeratorOffset::Earliest,\n            _ => bail!(\n                \"properties `scan_startup_mode` only supports earliest and latest or leaving it empty\"\n            ),\n        };\n\n        if let Some(s) = &properties.time_offset {\n            let time_offset = s.parse::<i64>().map_err(|e| anyhow!(e))?;\n            scan_start_offset = KafkaEnumeratorOffset::Timestamp(time_offset)\n        }\n\n        let mut client: Option<Arc<KafkaConsumer>> = None;\n        SHARED_KAFKA_CONSUMER\n            .entry_by_ref(&properties.connection)\n            .and_try_compute_with::<_, _, ConnectorError>(|maybe_entry| async {\n                if let Some(entry) = maybe_entry {\n                    let entry_value = entry.into_value();\n                    if let Some(client_) = entry_value.upgrade() {\n                        // return if the client is already built\n                        tracing::info!(\"reuse existing kafka client for {}\", broker_address);","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/kafka/enumerator.rs#L181-L217","documentation":"Raised while building the librdkafka consumer config in the Kafka split enumerator when the `scan_startup_mode` property is set to anything other than `earliest` or `latest` (or left unset). The match on the startup mode has no arm for other values, so source startup fails with a config error.","triggerScenarios":"Creating a Kafka source/MV with WITH option `scan_startup_mode` set to anything other than 'earliest' or 'latest' (case-insensitive), e.g. 'beginning', 'end', 'EARLIEST ' with typo/extra whitespace is not trimmed — 'earliest '/'beginning' still fail after lowercase.","commonSituations":"Copy-pasted configs using other systems' terminology ('beginning', 'offset_reset', 'none'), typo like 'earlist', or trailing whitespace/quotes in the option value.","solutions":["Set `scan_startup_mode='earliest'` or `scan_startup_mode='latest'` in the WITH options","Remove the option entirely to use the default (earliest)","Fix typos/casing — value is lowercased automatically, but extra characters or wrong words are rejected"],"exampleFix":"// before\nWITH (connector='kafka', scan_startup_mode='beginning')\n// after\nWITH (connector='kafka', scan_startup_mode='earliest')","handlingStrategy":"validation","validationCode":"match scan_startup_mode.as_deref().map(|s| s.to_lowercase()).as_deref() {\n    Some(\"earliest\") | Some(\"latest\") | None => {},\n    v => return Err(format!(\"invalid scan_startup_mode: {:?}\")),\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use 'earliest' or 'latest' literally for scan_startup_mode","Remember the value is lowercased but not trimmed — avoid stray spaces","Remove the option to get the default (earliest)"],"tags":["kafka","config","startup-mode","validation"],"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"}