risingwavelabs/risingwave · error · StreamExecutorError

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

RisingWave compiles connector support behind cargo feature flags. When a source type's feature (e.g. source-kafka, source-s3) was not enabled at compile time, the generated stub for that source returns this error instead of building a real executor, telling the developer to enable the feature and rebuild.

Source

Thrown at src/stream/src/executor/source/batch_source/mod.rs:81

            #[cfg(feature = "source-" $source_name)]
            pub use $mod_name::*;

            #[cfg(not(feature = "source-" $source_name))]
            #[doc = "Dummy implementation for executor when the feature `source-" $source_name "` is not enabled."]
            mod [<$mod_name _stub>] {
                #![allow(unused_imports)]
                use std::sync::Arc;

                use risingwave_common::id::TableId;
                use risingwave_storage::StateStore;
                use tokio::sync::mpsc::UnboundedReceiver;

                use crate::executor::prelude::*;
                use crate::executor::source::StreamSourceCore;
                use crate::task::LocalBarrierManager;

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

                #[doc = "A dummy executor that returns an error, as the feature `source-" $source_name "` is currently not enabled."]
                pub struct $executor_name<S: StateStore> {
                    _marker: std::marker::PhantomData<S>,
                }

                impl<S: StateStore> $executor_name<S> {
                    #[allow(clippy::too_many_arguments)]
                    pub fn new( $( $param_name : $param_type ),* ) -> Self {
                        // Suppress unused variable warnings
                        $( let _ = $param_name; )*
                        Self {
                            _marker: std::marker::PhantomData,

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Rebuild the binary with the required feature: `cargo build --features <feature-name>` (or the risedev profile that enables it).
  2. Verify which features the running binary was compiled with and redeploy an image variant that includes the connector.
  3. If the feature is unavailable, use a connector that is enabled in the deployed build.

Example fix

// before
cargo build -p risingwave_cmd_all
// after
cargo build -p risingwave_cmd_all --features "source-kafka source-s3"
Defensive patterns

Strategy: validation

Validate before calling

# shell: confirm the binary was built with the connector feature
cargo metadata --format-version 1 | jq '.packages[] | select(.name=="risingwave_stream") | .features' | grep source-kafka

Try / catch

// application level: match on CREATE SOURCE failure
if err.contains("is not enabled at compile time") {
    plan = rebuildWithFeature(featureName);
}

Prevention

When it happens

Trigger: Creating a materialized source/table with a connector whose cargo feature is disabled in the binary that was built; the macro-generated err_feature_not_enabled() is invoked at executor creation time.

Common situations: Running a minimal/release build without `--features` needed for the connector (e.g. Kafka, Iceberg, Nexmark), using a slim Docker image variant, or a fleet where the binary was compiled without the connector the SQL references.

Related errors


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