High severitydbt
Power BI Refresh Error:
Runtime Error
What does this error mean?
Dbt failed during execution due to a macro or hook raising an explicit exception, or from dbt internals hitting an unexpected state — this is distinct from compilation errors (which fail before SQL is generated) and database errors (which fail at the warehouse). The stack trace in the run log identifies the exact macro or hook that raised the failure.
Common causes
- 1A macro uses the `exceptions.raise_compiler_error()` or `exceptions.warn()` function to signal an invalid state
- 2An on-run-start or on-run-end hook fails during execution
- 3A dbt package version conflict causes unexpected macro behavior at runtime
- 4Environment variables referenced in dbt_project.yml or profiles.yml are not set in the Cloud job environment
- 5A post-hook SQL statement fails, even though the model itself ran successfully
How to fix it
- 1Read the full stack trace in the dbt Cloud run logs — runtime errors always include a traceback pointing to the macro or hook that raised the error.
- 2If the error originates in a macro, check whether the macro has explicit validation logic (raise_compiler_error) and what condition triggered it.
- 3Check on-run-start and on-run-end hooks in dbt_project.yml — these run before/after all models and a failure here blocks or partially breaks the run.
- 4Verify all required environment variables are set in the dbt Cloud job environment settings.
- 5Run the affected macro logic manually in your warehouse to isolate whether it is a Jinja logic error or a warehouse execution error.
Frequently asked questions
Official documentation: https://docs.getdbt.com/guides/debug-errors