{"record":{"id":"9478ff91178afa4f","repo":"risingwavelabs/risingwave","slug":"feature-is-not-enabled-at-compile-time-pleas","errorCode":null,"errorMessage":"Feature `{}` is not enabled at compile time. Please enable it in `Cargo.toml` and rebuild.","messagePattern":"Feature `(.+?)` is not enabled at compile time\\. Please enable it in `Cargo\\.toml` and rebuild\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/frontend/src/handler/create_source/external_schema.rs","lineNumber":50,"sourceCode":"/// Define a feature-gated function from a module.\n///\n/// This macro conditionally includes a module and re-exports a function from it.\n/// When the feature is disabled, it generates a stub function that returns an error.\nmacro_rules! feature_gated_function {\n    (\n        mod $mod_name:ident,\n        $feature_name:literal,\n        async fn $func_name:ident ( $( $param_name:ident : $param_type:ty ),* $(,)? ) -> $ret_type:ty\n    ) => {\n        #[cfg(feature = $feature_name)]\n        pub mod $mod_name;\n        #[cfg(feature = $feature_name)]\n        use $mod_name::$func_name;\n\n        #[cfg(not(feature = $feature_name))]\n        #[allow(unused_variables)]\n        pub async fn $func_name( $( $param_name : $param_type ),* ) -> $ret_type {\n            Err(anyhow::anyhow!(\n                \"Feature `{}` is not enabled at compile time. \\\n                Please enable it in `Cargo.toml` and rebuild.\",\n                $feature_name\n            ))\n        }\n    };\n}\n\nfeature_gated_function!(\n    mod adbc_snowflake,\n    \"source-adbc_snowflake\",\n    async fn extract_adbc_snowflake_columns(\n        with_properties: &WithOptionsSecResolved,\n    ) -> anyhow::Result<Vec<ColumnCatalog>>\n);\n\n/// Resolves the schema of the source from external schema file.\n/// See <https://docs.risingwave.com/sql/commands/sql-create-source> for more information.","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/handler/create_source/external_schema.rs#L32-L68","documentation":"Generated by the `decl_enable_feature!` macro in external_schema.rs:50: when the Cargo feature (e.g. `iceberg-catalog-rest`/`adbc`-related features for external schema support) is not enabled at compile time, a stub function is compiled in that always returns this anyhow error instead of the real implementation. It tells the user the binary was built without the feature needed to serve the external-schema lookup.","triggerScenarios":"Calling `CREATE SOURCE`/`CREATE TABLE ... WITH (connector='snowflake'|'iceberg')` (or any registered external-schema function) against a RisingWave binary compiled without the corresponding feature flag in `Cargo.toml`.","commonSituations":"Using a community build or a minimal Docker image where optional external-catalog features are compiled out; building locally without `--features`; CI profiles that trim features for size.","solutions":["Rebuild RisingWave with the required feature enabled: add it to the crate's `features` and rebuild (e.g. `cargo build --features <feature>` or use the standard `./risedev build` profile).","Switch to an official RisingWave release image that ships all external-source features enabled.","Check which feature the failing function maps to in `decl_enable_feature!` usages in external_schema.rs and enable exactly that one.","As a stopgap, use a connector path that does not require the feature (e.g. different catalog type or connector)."],"exampleFix":"// before (Cargo.toml)\n[dependencies]\nrisingwave_frontend = { path = \"../frontend\" }\n// after\ncargo build -p risingwave_cmd_all --features frontend/iceberg-catalog-rest  # or use ./risedev build","handlingStrategy":"fallback","validationCode":"// detect stubbed features at startup by probing the connector\nasync function featureAvailable(client, connector) {\n  try { await client.execute(`CREATE SOURCE _probe WITH (connector='${connector}')`); return true; }\n  catch (e) { return !String(e).includes('not enabled at compile time'); }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await createSource(connector, props);\n} catch (e) {\n  if (String(e).includes('not enabled at compile time')) {\n    // fallback: use official full-featured image or rebuild with the feature\n  } else { throw e; }\n}","preventionTips":["Use official RisingWave images that ship all external-source features.","Document required cargo features per deployment profile in your build pipeline.","Probe optional connectors in a smoke test before promoting a custom build to production."],"tags":["compile-time-feature","feature-flag","source","build"],"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-23T08:17:48.524Z"}