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

  1. 1Step 1: Identify the audit schema name — by default it is {target_schema}_dbt_test__audit.
  2. 2Step 2: Grant CREATE SCHEMA to the dbt role: GRANT CREATE SCHEMA ON DATABASE your_db TO ROLE dbt_role.
  3. 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.
  4. 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.

Frequently asked questions

Does store_failures affect whether the dbt run returns a failure exit code?

The store_failures write failure itself may cause dbt to return exit code 1, failing the run. If this is blocking CI/CD, address the permission issue rather than suppressing the error.

Can I store test failures in a different schema than the audit default?

Yes — use the schema config on individual tests or globally in dbt_project.yml: tests: +schema: my_custom_audit_schema. Ensure the dbt role has rights to that schema.

Other permission errors