{"record":{"id":"360c752113ae8c30","repo":"risingwavelabs/risingwave","slug":"feature-source-is-not-enabled-at-compile-time-360c75","errorCode":null,"errorMessage":"Feature `source-{}` is not enabled at compile time. Please enable it in `Cargo.toml` and rebuild.","messagePattern":"Feature `source-(.+?)` is not enabled at compile time\\. Please enable it in `Cargo\\.toml` and rebuild\\.","errorType":"exception","errorClass":"StreamExecutorError","httpStatus":null,"severity":"error","filePath":"src/stream/src/executor/source/batch_source/mod.rs","lineNumber":81,"sourceCode":"            #[cfg(feature = \"source-\" $source_name)]\n            pub use $mod_name::*;\n\n            #[cfg(not(feature = \"source-\" $source_name))]\n            #[doc = \"Dummy implementation for executor when the feature `source-\" $source_name \"` is not enabled.\"]\n            mod [<$mod_name _stub>] {\n                #![allow(unused_imports)]\n                use std::sync::Arc;\n\n                use risingwave_common::id::TableId;\n                use risingwave_storage::StateStore;\n                use tokio::sync::mpsc::UnboundedReceiver;\n\n                use crate::executor::prelude::*;\n                use crate::executor::source::StreamSourceCore;\n                use crate::task::LocalBarrierManager;\n\n                fn err_feature_not_enabled() -> StreamExecutorError {\n                    StreamExecutorError::from(anyhow::anyhow!(\n                        \"Feature `source-{}` is not enabled at compile time. \\\n                        Please enable it in `Cargo.toml` and rebuild.\",\n                        $source_name\n                    ))\n                }\n\n                #[doc = \"A dummy executor that returns an error, as the feature `source-\" $source_name \"` is currently not enabled.\"]\n                pub struct $executor_name<S: StateStore> {\n                    _marker: std::marker::PhantomData<S>,\n                }\n\n                impl<S: StateStore> $executor_name<S> {\n                    #[allow(clippy::too_many_arguments)]\n                    pub fn new( $( $param_name : $param_type ),* ) -> Self {\n                        // Suppress unused variable warnings\n                        $( let _ = $param_name; )*\n                        Self {\n                            _marker: std::marker::PhantomData,","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/source/batch_source/mod.rs#L63-L99","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Rebuild the binary with the required feature: `cargo build --features <feature-name>` (or the risedev profile that enables it).","Verify which features the running binary was compiled with and redeploy an image variant that includes the connector.","If the feature is unavailable, use a connector that is enabled in the deployed build."],"exampleFix":"// before\ncargo build -p risingwave_cmd_all\n// after\ncargo build -p risingwave_cmd_all --features \"source-kafka source-s3\"","handlingStrategy":"validation","validationCode":"# shell: confirm the binary was built with the connector feature\ncargo metadata --format-version 1 | jq '.packages[] | select(.name==\"risingwave_stream\") | .features' | grep source-kafka","typeGuard":null,"tryCatchPattern":"// application level: match on CREATE SOURCE failure\nif err.contains(\"is not enabled at compile time\") {\n    plan = rebuildWithFeature(featureName);\n}","preventionTips":["Use the official Docker image variants that include all connectors, or enable features explicitly in CI builds","Document required cargo features per connector in deployment manifests","Smoke-test CREATE SOURCE for every connector used after each deploy"],"tags":["feature-flag","compile-time","connector"],"backgroundTag":"feature-not-enabled","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}