What this thread does
Do first: Run dbt test --store-failures, after checking whether test-level configs override storage.
Short answer
With storage enabled, dbt saves failed records up to the test’s limit in a table named after the test. The default schema is {{ profile.schema }}_dbt_test__audit. Each execution replaces that test’s prior stored rows, including an execution with no failures. Failure-storage reference.
What to do
| Control | Documented behavior |
|---|---|
dbt test --store-failures | Request failure storage from the command line. |
store_failures: true / false | Explicit test config overrides the flag. |
store_failures omitted or none | Use the flag’s value. |
store_failures_as | Overrides store_failures when configured: table stores a table; view stores a view; ephemeral stores nothing and is the default. |
To enable failure storage by default for tests, put this in dbt_project.yml:
data_tests:
+store_failures: true
Use the test’s name to locate its relation in the audit schema and inspect the saved records. Use test schema configuration if a different schema is required. Storage location.
Limits and open questions
The reference does not state a numeric default for limit. For permission denied for schema, dbt documents missing schema-creation permissions as a likely cause; the required authorization SQL depends on the data platform. Stored failures are the latest run, not an execution history.
Not for: dbt unit tests with given/expect fixtures.
Sources
Checked
2026-11-17: Read dbt store_failures reference, dbt store_failures_as reference; no command was run.
Started from a post by @dbt Labs documentation, packaged by the editor. Original post