risingwavelabs/risingwave · error · ConnectorError

Feature `source-{}` is not enabled at compile time. Please e

Error message

Feature `source-{}` is not enabled at compile time. Please enable it in `Cargo.toml` and rebuild.

What it means

Each RisingWave connector is gated behind a cargo feature named `source-<connector>`. The macro-generated stub generates functions that, when the feature is off, immediately return this error instead of linking real implementations, so callers discover at runtime that the connector was not compiled in.

Source

Thrown at src/connector/src/source/utils.rs:50

        #[cfg(not(feature = "source-" $source_name))]
        pub mod $mod_name {
            use std::collections::HashMap;

            use anyhow::anyhow;
            use async_trait::async_trait;
            use risingwave_common::types::JsonbVal;
            use serde::{Deserialize, Serialize};

            use crate::error::{ConnectorError, ConnectorResult};
            use crate::parser::ParserConfig;
            use crate::source::{
                BoxSourceChunkStream, Column, SourceContextRef, SourceEnumeratorContextRef,
                SourceProperties, SplitEnumerator, SplitId, SplitMetaData, SplitReader, UnknownFields,
            };
            pub const [<$source_name:upper _CONNECTOR>]: &'static str = $source_name;

            fn err_feature_not_enabled() -> ConnectorError {
                ConnectorError::from(anyhow!(
                    "Feature `source-{}` is not enabled at compile time. \
                    Please enable it in `Cargo.toml` and rebuild.",
                    $source_name
                ))
            }

            #[doc = "A dummy source properties that always returns an error, as the feature `source-" $source_name "` is currently not enabled."]
            #[derive(Clone, Debug, Deserialize, with_options::WithOptions)]
            pub struct [<$struct_prefix:camel Properties>] {
                #[serde(flatten)]
                pub unknown_fields: HashMap<String, String>,
            }

            impl crate::enforce_secret::EnforceSecret for [<$struct_prefix:camel Properties>] {
                const ENFORCE_SECRET_PROPERTIES: phf::Set<&'static str> = phf::phf_set! {};
            }

            impl UnknownFields for [<$struct_prefix:camel Properties>] {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Enable the feature in Cargo.toml, e.g. risingwave_connector = { features = ["source-nats"] }, and rebuild
  2. Use an official binary/profile that includes the required connector feature
  3. Verify with `cargo tree -e features` or build logs that the feature is actually active in the deployed build

Example fix

// before (Cargo.toml)
risingwave_connector = { path = "../connector" }
// after
risingwave_connector = { path = "../connector", features = ["source-nats"] }
Defensive patterns

Strategy: try-catch

Validate before calling

// at build/deploy time, assert the connector feature is present
cargo tree -e features | grep 'source-nats' || echo 'feature missing: source-nats'

Try / catch

match connector_factory(config) { Err(e) if String(e).contains("is not enabled at compile time") => { enable_feature_and_rebuild_or_use_alternate_connector(); } , r => r }

Prevention

When it happens

Trigger: Using a connector (e.g. `nats`, `google_pubsub`) whose `source-<name>` feature is not enabled in the Cargo.toml of the built binary; every generated accessor for that source returns err_feature_not_enabled().

Common situations: Running a slim/all-in-one binary built with a reduced feature set, deploying a custom build missing the feature, or a distro package that disabled optional connectors.

Related errors


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