Medium severityruntime
Power BI Refresh Error:
dbt run-operation Failure
What does this error mean?
A `dbt run-operation` command failed. This command executes a named macro directly and surfaces any errors from macro compilation or the underlying database operation the macro performs.
Common causes
- 1Macro referenced in run-operation does not exist in the project or loaded packages
- 2Macro arguments passed incorrectly (wrong key names or missing required args)
- 3Database operation inside the macro failed (permission denied, object not found, etc.)
- 4run-operation executed in a CI environment without the required dbt packages installed
- 5Macro uses `run_query()` or `statement()` and the SQL fails at the warehouse level
How to fix it
- 1Verify the macro name: `grep -r 'macro <name>' macros/` to confirm it exists and is spelled correctly
- 2Check the macro's expected arguments and pass them as JSON: `dbt run-operation <macro> --args '{"key": "value"}'`
- 3Run with `--debug` to see the full macro compilation and database execution output
- 4Ensure `dbt deps` has been run and all required packages are installed before run-operation
- 5If the macro runs a DDL/DML statement, test the SQL directly in the warehouse to isolate the database error