MetricSign
EN|NLRequest Access
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

  1. 1Verify the macro name: `grep -r 'macro <name>' macros/` to confirm it exists and is spelled correctly
  2. 2Check the macro's expected arguments and pass them as JSON: `dbt run-operation <macro> --args '{"key": "value"}'`
  3. 3Run with `--debug` to see the full macro compilation and database execution output
  4. 4Ensure `dbt deps` has been run and all required packages are installed before run-operation
  5. 5If the macro runs a DDL/DML statement, test the SQL directly in the warehouse to isolate the database error

Frequently asked questions

How do I pass multiple arguments to dbt run-operation?

Use the `--args` flag with a JSON string: `dbt run-operation my_macro --args '{"table": "my_table", "schema": "my_schema"}'`. All keys must match the macro's parameter names exactly.