MetricSign
EN|NLRequest Access
Medium severityexecution

Power BI Refresh Error:
DatabaseError

What does this error mean?

dbt failed to create or insert rows into the test results table in the warehouse when store_failures_as is configured, typically due to a table lock, schema mismatch, or exhausted disk quota.

Common causes

  • 1A prior failed dbt run left the test results table in a locked or corrupted state
  • 2The schema of the existing test results table does not match the current test definition (column added or removed)
  • 3The warehouse virtual warehouse is suspended and cannot execute the INSERT statement
  • 4Concurrent dbt test runs are writing to the same audit table simultaneously, causing lock contention

How to fix it

  1. 1Step 1: Drop and recreate the affected test results table: DROP TABLE IF EXISTS schema_dbt_test__audit.test_name.
  2. 2Step 2: Ensure the virtual warehouse used for the dbt run is active before starting the job.
  3. 3Step 3: If schema drift is the cause, run dbt test --full-refresh to force recreation of the audit tables.
  4. 4Step 4: Stagger concurrent dbt test runs or use separate audit schemas per environment to avoid lock collisions.
  5. 5Step 5: Add a retry policy to the dbt Cloud job for transient INSERT failures.

Frequently asked questions

If the audit table write fails, does dbt still report which tests failed?

Yes — dbt reports test pass/fail counts in the CLI output and in run_results.json regardless of whether the audit table write succeeds. The failure only affects row-level investigation in the warehouse.

Can I disable store_failures for a single test without changing the global setting?

Yes — add store_failures: false to the individual test configuration in your schema.yml or dbt_project.yml tests block to override the global setting for that test only.

Other execution errors