{"record":{"id":"74dbad227d6b145e","repo":"risingwavelabs/risingwave","slug":"missing-port-in-cdc-properties","errorCode":null,"errorMessage":"missing `port` in CDC properties","messagePattern":"missing `port` in CDC properties","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":284,"sourceCode":"                )))\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\"))?;\n\n        let mut config = Config::new();\n        config.host(hostname);\n        config.port(port);","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L266-L302","documentation":"Raised by `query_sql_server_lsns` when the `port` key is absent from the CDC properties map. The port is required to build the tiberius `Config` used to query SQL Server CDC min/max LSNs. If present but non-numeric, a separate 'failed to parse `port` as a u16' error is produced instead.","triggerScenarios":"Calling `monitor_sql_server_lsns` on a SqlServerEnumerator whose `properties` map has `hostname` but no `port` entry.","commonSituations":"User omits `port` in the CDC table `with` clause assuming a default is applied; a config template leaves the port blank; env-driven provisioning skips optional-looking fields.","solutions":["Add `port` to the CDC source properties (SQL Server default is 1433)","Ensure the property value is a numeric string parseable as u16","Recreate the table with a complete `with` clause including port","Check that upstream option parsing does not drop numeric-string keys"],"exampleFix":"// before\nWITH (connector = 'cdc', hostname = 'h', database.name = 'db')\n// after\nWITH (connector = 'cdc', hostname = 'h', port = '1433', database.name = 'db')","handlingStrategy":"validation","validationCode":"match properties.get(\"port\") {\n    Some(p) => p.parse::<u16>().map_err(|_| \"`port` must be a valid u16\")?,\n    None => return Err(\"CDC source is missing required property: port\".into()),\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set port explicitly (1433 for SQL Server) rather than relying on defaults","Parse the port as u16 during config validation, before any connection attempt"],"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"}