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