{"record":{"id":"b4c7671c08cd5d69","repo":"risingwavelabs/risingwave","slug":"missing-database-name-in-cdc-properties","errorCode":null,"errorMessage":"missing `database.name` in CDC properties","messagePattern":"missing `database\\.name` in CDC properties","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":298,"sourceCode":"            .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\n            .inner_client\n            .simple_query(\n                \"SELECT \\\n                    sys.fn_cdc_get_max_lsn() AS max_lsn, \\\n                    (SELECT MIN(sys.fn_cdc_get_min_lsn(capture_instance)) FROM cdc.change_tables) AS min_lsn\"\n                    .to_owned(),\n            )\n            .await?","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L280-L316","documentation":"Raised by `query_sql_server_lsns` when `database.name` is missing from the CDC properties. The database name is set on the tiberius `Config` so the LSN query runs against the correct SQL Server database with CDC change tables.","triggerScenarios":"Calling `monitor_sql_server_lsns` on a SqlServerEnumerator whose `properties` map lacks the `database.name` key (note the dotted key name).","commonSituations":"User supplies `database` instead of `database.name` (key-name mismatch); the with clause omits the database; property flattening/escaping strips the dotted key.","solutions":["Add `database.name` (exact key, with dot) to the CDC source properties","Check for key-name typos such as `database_name` or plain `database`","Recreate the table with `database.name = '<db>'` in the with clause","Inspect the properties map actually passed to the enumerator to confirm key names"],"exampleFix":"// before\nWITH (connector = 'cdc', hostname = 'h', database = 'db')\n// after\nWITH (connector = 'cdc', hostname = 'h', database.name = 'db')","handlingStrategy":"validation","validationCode":"if !properties.contains_key(\"database.name\") {\n    return Err(\"CDC source is missing required property: database.name\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the dotted key is `database.name`, not `database` or `database_name`","List the exact required keys in the connector documentation/examples"],"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"}