{"record":{"id":"4890de550f11ef19","repo":"dbt-labs/dbt-core","slug":"the-runtime-flavor-multi-thread-requires-the-rt","errorCode":null,"errorMessage":"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature.","messagePattern":"The runtime flavor `multi_thread` requires the `rt-multi-thread` feature\\.","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 flavor = \"multi_thread\" is explicitly requested but the `rt-multi-thread` cargo feature is not compiled in, the runtime Builder type does not exist, so the macro fails compilation with this message at Span::call_site(). This is the branch of the same check as error 478, taken when the user explicitly set the flavor.","triggerScenarios":"#[tokio::main(flavor = \"multi_thread\")] (or #[tokio::test(flavor = \"multi_thread\")]) while the tokio crate dependency does not include the `rt-multi-thread` feature.","commonSituations":"Disabling default features in Cargo.toml; CI builds testing no-default-features; a workspace where feature unification leaves tokio without rt-multi-thread; docs examples copied without feature instructions.","solutions":["Add the feature: tokio = { version = \"1\", features = [\"rt-multi_thread\", \"macros\"] } — note the exact name is `rt-multi-thread`","Verify with cargo tree -e features that rt-multi-thread is enabled for tokio","Switch to flavor = \"current_thread\" if a single-threaded runtime suffices"],"exampleFix":"// before\n#[tokio::main(flavor = \"multi_thread\")]\nasync fn main() {}\n// Cargo.toml: tokio = { version = \"1\", default-features = false, features = [\"rt\", \"macros\"] }\n\n// after\n// Cargo.toml: tokio = { version = \"1\", default-features = false, features = [\"rt\", \"rt-multi-thread\", \"macros\"] }\n#[tokio::main(flavor = \"multi_thread\")]\nasync fn main() {}","handlingStrategy":"validation","validationCode":"fn assert_flavor_supported(features: &[&str], flavor: &str) -> Result<(), String> {\n    if flavor == \"multi_thread\" && !features.contains(&\"rt-multi-thread\") {\n        Err(\"flavor multi_thread requires tokio feature `rt-multi-thread`\".into())\n    } else { Ok(()) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match every flavor = \"multi_thread\" usage with the rt-multi-thread feature in Cargo.toml","Verify with cargo tree -e features that the feature reaches the tokio crate","Switch to current_thread flavor for tests that don't need worker threads"],"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"}