{"record":{"id":"26d2be9259eb63c1","repo":"risingwavelabs/risingwave","slug":"missing-hostname-in-cdc-properties","errorCode":null,"errorMessage":"missing `hostname` in CDC properties","messagePattern":"missing `hostname` in CDC properties","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":280,"sourceCode":"                Ok(Some((\n                    confirmed_flush_lsn.map(Into::into),\n                    upstream_max_lsn.into(),\n                    slot_name.clone(),\n                )))\n            }\n            None => {\n                tracing::warn!(\"no replication slot found with name: {}\", slot_name);\n                Ok(None)\n            }\n        }\n    }\n\n    /// Query min/max LSNs from SQL Server CDC.\n    async fn query_sql_server_lsns(&self) -> ConnectorResult<Option<(String, String)>> {\n        let hostname = self\n            .properties\n            .get(\"hostname\")\n            .ok_or_else(|| anyhow!(\"missing `hostname` in CDC properties\"))?;\n        let port = self\n            .properties\n            .get(\"port\")\n            .ok_or_else(|| anyhow!(\"missing `port` in CDC properties\"))?\n            .parse::<u16>()\n            .context(\"failed to parse `port` as a u16\")?;\n        let username = self\n            .properties\n            .get(\"username\")\n            .ok_or_else(|| anyhow!(\"missing `username` in CDC properties\"))?;\n        let password = self\n            .properties\n            .get(\"password\")\n            .ok_or_else(|| anyhow!(\"missing `password` in CDC properties\"))?;\n        let database = self\n            .properties\n            .get(\"database.name\")\n            .ok_or_else(|| anyhow!(\"missing `database.name` in CDC properties\"))?;","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L262-L298","documentation":"This error is raised by `query_sql_server_lsns` when the CDC source properties map does not contain a `hostname` key. The function needs the SQL Server host to build a tiberius `Config` for querying CDC LSN metadata; without it the connection cannot even be constructed. It surfaces as a `ConnectorResult` error propagated up through `monitor_sql_server_lsns`.","triggerScenarios":"Calling `monitor_sql_server_lsns` (e.g. via the CDC monitoring loop) on a SqlServerEnumerator whose `properties` map lacks the `hostname` entry — typically when the upstream table was created without a hostname in its CDC `with` properties.","commonSituations":"User creates a SQL Server CDC table omitting `hostname` in the `sqlserver.properties`; a provisioning script drops the property; properties are reconstructed from env vars where HOSTNAME is unset.","solutions":["Add `hostname` to the CDC source properties when creating the table (e.g. `sqlserver.properties.hostname = '...'`)","Verify the properties map passed to the enumerator is populated from the connector options, not an empty map","Check upstream pipeline config serialization so hostname is not stripped","Recreate the CDC table with a complete `with` clause including hostname"],"exampleFix":"// before\nCREATE TABLE t (...) WITH (\n  connector = 'cdc',\n  database.name = 'db'\n);\n// after\nCREATE TABLE t (...) WITH (\n  connector = 'cdc',\n  hostname = 'sqlserver.host',\n  database.name = 'db'\n);","handlingStrategy":"validation","validationCode":"let required = [\"hostname\", \"port\", \"username\", \"password\", \"database.name\"];\nfor key in required {\n    if !properties.contains_key(key) {\n        return Err(format!(\"CDC source is missing required property: {}\", key));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate the full required-key set (hostname, port, username, password, database.name) at table creation time","Centralize CDC property parsing in one place with early validation","Include all required properties in provisioning templates"],"tags":["cdc","sql-server","config","missing-property"],"backgroundTag":"missing-required-config-field","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"}