risingwavelabs/risingwave · error · ConnectorError

Unknown connection: {connection_name}

Error message

Unknown connection: {connection_name}

What it means

check_connection_allow_alter_on_fly_fields could not map connection_name to a registered connection type, so no allow_alter_on_fly allowlist exists for it. The connection name is unrecognized (misspelled or unsupported).

Source

Thrown at src/connector/src/allow_alter_on_fly_fields.rs:495

    for field in fields {
        if !allowed_fields.contains(field) {
            return Err(ConnectorError::from(anyhow::anyhow!(
                "Field '{field}' is not allowed to be altered on the fly for connector: {connector_name}"
            )));
        }
    }
    Ok(())
}

pub fn check_connection_allow_alter_on_fly_fields(
    connection_name: &str,
    fields: &[String],
) -> crate::error::ConnectorResult<()> {
    use crate::source::connection_name_to_prop_type_name;

    // Convert connection name to the type name key
    let Some(type_name) = connection_name_to_prop_type_name(connection_name) else {
        return Err(ConnectorError::from(anyhow::anyhow!(
            "Unknown connection: {connection_name}"
        )));
    };
    let Some(allowed_fields) = CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.get(type_name) else {
        return Err(ConnectorError::from(anyhow::anyhow!(
            "No allow_alter_on_fly fields registered for connection: {connection_name}"
        )));
    };
    for field in fields {
        if !allowed_fields.contains(field) {
            return Err(ConnectorError::from(anyhow::anyhow!(
                "Field '{field}' is not allowed to be altered on the fly for connection: {connection_name}"
            )));
        }
    }
    Ok(())
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Verify the connection name against supported connection types and fix spelling
  2. Use SHOW CONNECTIONS / catalog to confirm the connection and its type
  3. Upgrade or rebuild RW if the connection type should be supported

Example fix

// before: ALTER CONNECTION 'privatelinkk' ... 
// after: ALTER CONNECTION 'privatelink' ...
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN_CONNECTIONS: &[&str] = &["privatelink","kafka","iceberg"]; // exact supported set
if !KNOWN_CONNECTIONS.contains(&connection_name) {
    return Err(format!("unknown connection type: {connection_name}"));
}

Try / catch

match res {
    Err(e) if e.to_string().starts_with("Unknown connection") => {
        // prompt user to verify connection name via SHOW CONNECTIONS
    }
    other => other?,
}

Prevention

When it happens

Trigger: Altering fields on the fly for a CONNECTION object whose name does not resolve via connection_name_to_prop_type_name (e.g. typo in the connection type, unsupported connection kind).

Common situations: Typo'd connection names in ALTER statements; using a private-link/connection type not compiled into the build; version drift removing a connection type.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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