{"record":{"id":"b2b629647a1b7a63","repo":"risingwavelabs/risingwave","slug":"missing-username-in-cdc-properties","errorCode":null,"errorMessage":"missing `username` in CDC properties","messagePattern":"missing `username` in CDC properties","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":290,"sourceCode":"        }\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);\n        config.database(database);\n        config.authentication(tiberius::AuthMethod::sql_server(username, password));\n        config.trust_cert();\n\n        let mut client = SqlServerClient::new_with_config(config).await?;\n        let row = client","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L272-L308","documentation":"Raised by `query_sql_server_lsns` when `username` is missing from the CDC properties. SQL Server authentication (via `tiberius::AuthMethod::sql_server`) requires a username and password to open the monitoring connection.","triggerScenarios":"Calling `monitor_sql_server_lsns` on a SqlServerEnumerator whose `properties` map lacks a `username` entry.","commonSituations":"User configures Windows/Integrated auth assumptions but the code path requires sql_server auth credentials; credentials omitted for brevity in a dev config; secrets manager fails to inject the username.","solutions":["Add `username` to the CDC source properties","Verify secret injection/templating populated the username key","Recreate the table with the full credential set (username and password)","Confirm the SQL Server login exists and is enabled for CDC access"],"exampleFix":"// before\nWITH (connector = 'cdc', hostname = 'h', port = '1433')\n// after\nWITH (connector = 'cdc', hostname = 'h', port = '1433', username = 'cdc_user', password = '***')","handlingStrategy":"validation","validationCode":"if !properties.contains_key(\"username\") {\n    return Err(\"CDC source requires `username` for SQL Server auth\".into());\n}\nif !properties.contains_key(\"password\") {\n    return Err(\"CDC source requires `password` for SQL Server auth\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inject credentials via a secrets manager and assert non-empty after resolution","Validate username/password together since sql_server auth requires both"],"tags":["cdc","sql-server","config","credentials"],"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"}