{"record":{"id":"a4e8f498435fff0d","repo":"dbt-labs/dbt-core","slug":"the-default-runtime-flavor-is-multi-thread-but","errorCode":null,"errorMessage":"The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled.","messagePattern":"The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/dbt-runtime-macros/src/entry.rs","lineNumber":227,"sourceCode":"        let worker_threads = match (flavor, self.worker_threads) {\n            (F::CurrentThread | F::Local, Some((_, worker_threads_span))) => {\n                let msg = format!(\n                    \"The `worker_threads` option requires the `multi_thread` runtime flavor. Use `#[{}(flavor = \\\"multi_thread\\\")]`\",\n                    self.macro_name(),\n                );\n                return Err(syn::Error::new(worker_threads_span, msg));\n            }\n            (F::CurrentThread | F::Local, None) => None,\n            (F::Threaded, worker_threads) if self.rt_multi_thread_available => {\n                worker_threads.map(|(val, _span)| val)\n            }\n            (F::Threaded, _) => {\n                let msg = if self.flavor.is_none() {\n                    \"The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled.\"\n                } else {\n                    \"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature.\"\n                };\n                return Err(syn::Error::new(Span::call_site(), msg));\n            }\n        };\n\n        let start_paused = match (flavor, self.start_paused) {\n            (F::Threaded, Some((_, start_paused_span))) => {\n                let msg = format!(\n                    \"The `start_paused` option requires the `current_thread` runtime flavor. Use `#[{}(flavor = \\\"current_thread\\\")]`\",\n                    self.macro_name(),\n                );\n                return Err(syn::Error::new(start_paused_span, msg));\n            }\n            (F::CurrentThread | F::Local, Some((start_paused, _))) => Some(start_paused),\n            (_, None) => None,\n        };\n\n        let unhandled_panic = match (flavor, self.unhandled_panic) {\n            (F::Threaded, Some((_, unhandled_panic_span))) => {\n                let msg = format!(","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-runtime-macros/src/entry.rs#L209-L245","documentation":"When no flavor is specified the macro assumes the default multi_thread runtime, but that requires the `rt-multi-thread` cargo feature. If the feature is disabled and flavor was never set, build() emits this compile error at the call site via Span::call_site(). The macro cannot silently downgrade to current_thread because the generated runtime semantics would differ.","triggerScenarios":"Using #[tokio::main] or #[tokio::test] (no flavor argument) in a crate whose tokio dependency lacks the `rt-multi-thread` feature — e.g. tokio = { version = \"1\", features = [\"rt\"] } or a min-features build.","commonSituations":"Minimal-features/CI matrix builds; disabling default features in Cargo.toml; a dependency turning off tokio features via feature unification in a workspace with -Z avoid-dev-deps style setups; upgrading tokio and dropping default features.","solutions":["Enable the feature: tokio = { version = \"1\", features = [\"rt-multi-thread\", \"macros\"] }","Explicitly opt into the single-thread runtime: #[tokio::main(flavor = \"current_thread\")]","Re-enable default features if they were disabled unintentionally"],"exampleFix":"// before (Cargo.toml)\ntokio = { version = \"1\", features = [\"rt\", \"macros\"] }\n\n// after\ntokio = { version = \"1\", features = [\"rt\", \"rt-multi-thread\", \"macros\"] }","handlingStrategy":"validation","validationCode":"// Check Cargo.toml before using bare #[tokio::main]\nfn needs_rt_multi_thread(features: &[&str]) -> bool {\n    !features.contains(&\"rt-multi-thread\")\n}\n// if this returns true, either add the feature or use flavor = \"current_thread\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include \"rt-multi-thread\" in tokio features for binary crates","Test no-default-features builds in CI if you ship a library","Run `cargo tree -e features -p tokio` to confirm enabled features"],"tags":["rust","tokio","cargo-features","compile-time"],"backgroundTag":"feature-not-enabled","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}