{"record":{"id":"4032931e15344a8f","repo":"dbt-labs/dbt-core","slug":"failfast-error-for-from","errorCode":null,"errorMessage":"FailFast Error for {} from {}: {}","messagePattern":"FailFast Error for (.+?) from (.+?): (.+?)","errorType":"exception","errorClass":"minijinja::Error (InvalidOperation)","httpStatus":null,"severity":"error","filePath":"crates/dbt-jinja-utils/src/functions/base.rs","lineNumber":1279,"sourceCode":"                            \"Contract Error for {} from {}: {}\",\n                            node_id,\n                            file_path.display(),\n                            message\n                        ),\n                    ))\n                } else {\n                    Err(Error::new(\n                        ErrorKind::InvalidOperation,\n                        format!(\"Contract Error: {message}\"),\n                    ))\n                }\n            }\n            // (msg, node=None)\n            \"raise_fail_fast_error\" => {\n                let mut args = ArgParser::new(args, None);\n                let message = args.get::<String>(\"msg\")?;\n                if let Some((node_id, file_path)) = node_metadata_from_state(state) {\n                    Err(Error::new(\n                        ErrorKind::InvalidOperation,\n                        format!(\n                            \"FailFast Error for {} from {}: {}\",\n                            node_id,\n                            file_path.display(),\n                            message\n                        ),\n                    ))\n                } else {\n                    Err(Error::new(\n                        ErrorKind::InvalidOperation,\n                        format!(\"FailFast Error: {message}\"),\n                    ))\n                }\n            }\n            // (snapshot_time_data_type: str, updated_at_data_type: str)\n            \"warn_snapshot_timestamp_data_types\" => {\n                let mut args = ArgParser::new(args, None);","sourceCodeStart":1261,"sourceCodeEnd":1297,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-jinja-utils/src/functions/base.rs#L1261-L1297","documentation":"Raised when a Jinja macro calls `exceptions.raise_fail_fast_error(msg=...)`. This is a deliberate, user-authored abort: the macro author wants dbt to stop the run immediately (fail-fast) with the provided message. The library wraps it with the node id and file path from the Jinja state so the source of the abort is identified.","triggerScenarios":"Explicit invocation of `exceptions.raise_fail_fast_error(msg=...)` in project or package Jinja code while node metadata is present, e.g. a data-quality guard macro deciding the run should stop.","commonSituations":"Custom macros validating preconditions (row counts, freshness, config sanity) that intentionally halt the run; vendored package macros enforcing invariants that fire unexpectedly on the user's data.","solutions":["Read the `msg` in the error — it is the macro author's diagnostic; fix the underlying condition it detected.","Locate the macro raising the error using the node id/file path in the message and adjust its guard logic.","If the check should warn rather than halt, change the macro to use `exceptions.warn` or `log` instead."],"exampleFix":"-- before (macro)\n{% do exceptions.raise_fail_fast_error('row count is 0') %}\n\n-- after: guard first\n{% if row_count == 0 %}\n  {% do exceptions.raise_fail_fast_error('row count is 0') %}\n{% endif %}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Wrap the run and surface the fail-fast message to the orchestrator\nmatch dbt_build(&[\"--select\", \"my_model\"]) {\n    Err(e) if e.message.starts_with(\"FailFast Error\") => {\n        // intentional abort: alert with msg, do not retry\n        alert(&e.message);\n    }\n    Err(e) => return Err(e),\n    Ok(_) => {}\n}","preventionTips":["Read the msg field — it states the violated precondition to fix.","Audit vendored packages for raise_fail_fast_error guards and their triggers.","Do not retry fail-fast runs automatically; they indicate a deliberate halt.","Test guard macros against realistic data before production."],"tags":["dbt","jinja","fail-fast","user-raised"],"backgroundTag":"fail-fast-error-raised","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}