{"record":{"id":"8d1b9ae49920a773","repo":"risingwavelabs/risingwave","slug":"missing-required-property-hostname-for-mysql-cdc","errorCode":null,"errorMessage":"missing required property 'hostname' for MySQL CDC source","messagePattern":"missing required property 'hostname' for MySQL CDC source","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/cdc/enumerator/mod.rs","lineNumber":417,"sourceCode":"    async fn monitor_cdc(&mut self) -> ConnectorResult<()>;\n}\n\n#[async_trait]\nimpl<T: CdcSourceTypeTrait> CdcMonitor for DebeziumSplitEnumerator<T> {\n    default async fn monitor_cdc(&mut self) -> ConnectorResult<()> {\n        Ok(())\n    }\n}\n\nimpl DebeziumSplitEnumerator<Mysql> {\n    async fn monitor_mysql_binlog_files(&mut self) -> ConnectorResult<()> {\n        // Get hostname and port for metrics labels\n        let hostname = self\n            .properties\n            .get(\"hostname\")\n            .map(|s| s.as_str())\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"missing required property 'hostname' for MySQL CDC source\")\n            })?;\n        let port = self\n            .properties\n            .get(\"port\")\n            .map(|s| s.as_str())\n            .ok_or_else(|| {\n                anyhow::anyhow!(\"missing required property 'port' for MySQL CDC source\")\n            })?;\n\n        // Query binlog files and update metrics\n        let binlog_files = self.query_binlog_files().await.with_context(|| {\n            format!(\n                \"failed to query binlog files for MySQL CDC source {} ({}:{})\",\n                self.source_id, hostname, port\n            )\n        })?;\n        if let Some((oldest_file, oldest_size)) = binlog_files.first()\n            && let Some(seq) = extract_binlog_file_seq(oldest_file)","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/cdc/enumerator/mod.rs#L399-L435","documentation":"`monitor_mysql_binlog_files` reads the `hostname` property from the CDC properties map to label metrics (host/port); if absent, it throws this anyhow error. Unlike the SQL Server path this is for MySQL CDC monitoring of binlog files, and the property is treated as required even though it is used for labeling.","triggerScenarios":"Calling `monitor_mysql_binlog_files` (via `monitor_cdc`) on a MySqlEnumerator whose `properties` map lacks `hostname`.","commonSituations":"MySQL CDC table created without `hostname` in the `with` clause; properties built from env vars where the host var is unset; key typo like `host` instead of `hostname`.","solutions":["Add `hostname` to the MySQL CDC source properties when creating the table","Check for key-name typos (`host` vs `hostname`) — the code expects exactly `hostname`","Verify upstream option parsing passes hostname through to the enumerator","Recreate the table with a complete `with` clause including hostname and port"],"exampleFix":"// before\nCREATE TABLE t (...) WITH (\n  connector = 'mysql-cdc'\n);\n// after\nCREATE TABLE t (...) WITH (\n  connector = 'mysql-cdc',\n  hostname = '127.0.0.1',\n  port = '3306'\n);","handlingStrategy":"validation","validationCode":"let required = [\"hostname\", \"port\", \"username\", \"password\", \"database.name\", \"server.timezone\"];\nfor key in required {\n    if !properties.contains_key(key) {\n        return Err(format!(\"MySQL CDC source is missing required property: {}\", key));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exactly `hostname` (not `host`) in the with clause","Validate the full MySQL CDC property set at table creation time","Keep provisioning templates for MySQL CDC sources complete and reviewed"],"tags":["cdc","mysql","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"}