risingwavelabs/risingwave · error · anyhow::Error

`catalog.jdbc.user` must not be set when `hosted_catalog` is

Error message

`catalog.jdbc.user` must not be set when `hosted_catalog` is set

What it means

Same hosted-catalog validation block in `IcebergConnection::validate_connection`: JDBC catalog credentials must not be supplied when `hosted_catalog = true`, because hosted mode never connects to a user-specified JDBC catalog.

Source

Thrown at src/connector/src/connector_common/connection.rs:283

        if env_var_is_true(DISABLE_DEFAULT_CREDENTIAL)
            && matches!(common.enable_config_load, Some(true))
        {
            bail!("`enable_config_load` can't be enabled in this environment");
        }

        if common.hosted_catalog.unwrap_or(false) {
            // If `hosted_catalog` is set, we don't need to test the catalog, but just ensure no catalog fields are set.
            if common.catalog_type.is_some() {
                bail!("`catalog.type` must not be set when `hosted_catalog` is set");
            }
            if common.catalog_uri.is_some() {
                bail!("`catalog.uri` must not be set when `hosted_catalog` is set");
            }
            if common.catalog_name.is_some() {
                bail!("`catalog.name` must not be set when `hosted_catalog` is set");
            }
            if self.jdbc_user.is_some() {
                bail!("`catalog.jdbc.user` must not be set when `hosted_catalog` is set");
            }
            if self.jdbc_password.is_some() {
                bail!("`catalog.jdbc.password` must not be set when `hosted_catalog` is set");
            }
            return Ok(());
        }

        if common.catalog_type.is_none() {
            bail!("`catalog.type` must be set");
        }

        // Test catalog
        let iceberg_common = common.clone();

        let mut java_map = HashMap::new();
        if let Some(jdbc_user) = &self.jdbc_user {
            java_map.insert("jdbc.user".to_owned(), jdbc_user.to_owned());
        }

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Remove `catalog.jdbc.user` from the connection options when `hosted_catalog = true`.
  2. Alternatively disable `hosted_catalog` and use a fully specified JDBC catalog including user/password.

Example fix

// before
WITH (connector='iceberg', hosted_catalog=true, catalog.jdbc.user='iceberg')
// after
WITH (connector='iceberg', hosted_catalog=true)
Defensive patterns

Strategy: validation

Validate before calling

if hosted_catalog && jdbc_user.is_some() { return Err("catalog.jdbc.user must be unset when hosted_catalog=true"); }

Try / catch

match validate_connection(&conn).await {
    Err(e) if e.to_string().contains("`catalog.jdbc.user` must not be set") => warn_user_and_abort(),
    other => other,
}

Prevention

When it happens

Trigger: Calling validate_connection where `hosted_catalog` is true AND `catalog.jdbc.user` is set.

Common situations: Keeping JDBC catalog credentials from a previous self-managed JDBC-catalog connection while enabling `hosted_catalog`; secrets templating that always injects `catalog.jdbc.user`.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/8db6e7cae693c3a5. Report an issue: GitHub.