risingwavelabs/risingwave · error
missing `port` in CDC properties
Error message
missing `port` in CDC properties
What it means
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.
Source
Thrown at src/connector/src/source/cdc/enumerator/mod.rs:284
)))
}
None => {
tracing::warn!("no replication slot found with name: {}", slot_name);
Ok(None)
}
}
}
/// Query min/max LSNs from SQL Server CDC.
async fn query_sql_server_lsns(&self) -> ConnectorResult<Option<(String, String)>> {
let hostname = self
.properties
.get("hostname")
.ok_or_else(|| anyhow!("missing `hostname` in CDC properties"))?;
let port = self
.properties
.get("port")
.ok_or_else(|| anyhow!("missing `port` in CDC properties"))?
.parse::<u16>()
.context("failed to parse `port` as a u16")?;
let username = self
.properties
.get("username")
.ok_or_else(|| anyhow!("missing `username` in CDC properties"))?;
let password = self
.properties
.get("password")
.ok_or_else(|| anyhow!("missing `password` in CDC properties"))?;
let database = self
.properties
.get("database.name")
.ok_or_else(|| anyhow!("missing `database.name` in CDC properties"))?;
let mut config = Config::new();
config.host(hostname);
config.port(port);View on GitHub (pinned to 6469eb736d)
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
Example fix
// before WITH (connector = 'cdc', hostname = 'h', database.name = 'db') // after WITH (connector = 'cdc', hostname = 'h', port = '1433', database.name = 'db')
Defensive patterns
Strategy: validation
Validate before calling
match properties.get("port") {
Some(p) => p.parse::<u16>().map_err(|_| "`port` must be a valid u16")?,
None => return Err("CDC source is missing required property: port".into()),
} Prevention
- 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
When it happens
Trigger: Calling `monitor_sql_server_lsns` on a SqlServerEnumerator whose `properties` map has `hostname` but no `port` entry.
Common situations: 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.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- missing `hostname` in CDC properties
- missing `database.name` in CDC properties
- missing `username` in CDC properties
- missing `password` in CDC properties
- missing required property 'hostname' for MySQL CDC source
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/74dbad227d6b145e.
Report an issue: GitHub.