Medium severitypermission
Power BI Refresh Error:
DatabaseError
What does this error mean?
dbt failed to persist test failure rows to the audit schema because the database role lacks permission to create or write to the dbt_test__audit schema used by store_failures.
Common causes
- 1The dbt run role does not have CREATE SCHEMA privilege in the target database
- 2The audit schema name was customised via schema config but the role only has rights to the default schema
- 3Row-level security or warehouse-level access controls block writes to the audit schema
- 4The store_failures_as config was set to 'table' but the role can only create views
How to fix it
- 1Step 1: Identify the audit schema name — by default it is {target_schema}_dbt_test__audit.
- 2Step 2: Grant CREATE SCHEMA to the dbt role: GRANT CREATE SCHEMA ON DATABASE your_db TO ROLE dbt_role.
- 3Step 3: If the schema already exists but is owned by another role: GRANT USAGE, CREATE TABLE ON SCHEMA audit_schema TO ROLE dbt_role.
- 4Step 4: If you cannot grant schema creation rights, set store_failures_as: 'ephemeral' to skip persisting results, or disable store_failures for tests in restricted environments.