Senmi Rai
03/06/2026, 6:51 PMkapa.ai
03/06/2026, 6:51 PMon-run-end hook errors and their solutions:
-------------------------
Common Elementary Hook Errors
1. 'None' has no attribute 'get' (Compilation Error)
This can occur randomly when running dbt docs generate with Airflow. As a workaround, you can disable the Elementary hook uploads via vars: [Slack thread]
vars:
disable_run_results: true
disable_tests_results: true
disable_dbt_invocation_autoupload: true
Or disable Elementary entirely for specific targets:
models:
elementary:
+schema: "elementary"
+enabled: "{{ target.name in ['prod'] }}"
-------------------------
2. Inconsistent number of values in VALUES clause (Column Mismatch)
This happens when an Elementary package update adds a column but the model hasn't been rebuilt. Fix it by running: [Slack thread]
dbt run -s elementary
-------------------------
3. Concurrent Job Conflicts (Error code 1023 / DML rate limits)
When multiple dbt jobs finish simultaneously, their Elementary hooks can conflict. Solutions: [Slack thread]
⢠Space out job timings so they don't write simultaneously.
⢠Decouple Elementary writes by disabling auto-updates and running them separately:
models:
elementary:
+schema: elementary
edr:
+enabled: "{{ var('enable_elementary_models', false) }}"
Then run Elementary models explicitly:
dbt run --select elementary --vars '{enable_elementary_models: true}'
-------------------------
4. cannot insert multiple commands into a prepared statement
This can be caused by large batch inserts or concurrency issues. Try chunking inserts: [Slack thread]
vars:
insert_rows_method: chunk
dbt_artifacts_chunk_size: 5000
Or disable the columns autoupload as a hotfix:
vars:
disable_dbt_columns_autoupload: true
-------------------------
5. Hook Not Running After dbt test
The Elementary on-run-end hook should run after both dbt run and dbt test. If it doesn't run after dbt test, ensure the Elementary tables exist in your target schema by running: [Slack thread]
dbt run --select elementary --target <your_target>
-------------------------
Debugging Tips
To get more visibility into what the hook is doing, enable debug logs: [Slack thread]
dbt run --vars '{debug_logs: true}'
Then review your dbt.log file for details on where the failure occurs. š 0 button š 0 button ā¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.Senmi Rai
03/06/2026, 6:58 PMkapa.ai
03/06/2026, 6:59 PMon-run-end hooks both attempt to write to the same Elementary tables (e.g., dbt_models), causing one transaction to be aborted. [BQ concurrency]
Recommended Solutions
Option 1: Disable Artifact Autoupload (Most Common Fix)
Add this to your `dbt_project.yml`:
vars:
disable_dbt_artifacts_autoupload: true
Then run artifacts separately in a controlled, non-concurrent job:
dbt run --select elementary.edr.dbt_artifacts
This removes the conflicting writes from the on-run-end hook while still allowing test results and invocation data to be uploaded. [BQ concurrent updates]
> Note: disable_dbt_artifacts_autoupload only disables artifact uploads (#3 of the hook). Test results and invocation data are controlled by separate variables (disable_run_results, disable_tests_results, disable_dbt_invocation_autoupload). Invocation uploads are insert-only and are generally safe from this conflict. [BQ concurrent updates]
-------------------------
Option 2: Fully Decouple Elementary Writes
Disable Elementary models from running during normal `dbt run`:
models:
your_project:
+materialized: table
elementary:
+schema: elementary
edr:
+enabled: "{{ var('enable_elementary_models', false) }}"
Then update Elementary tables in a dedicated, serial job:
dbt run --select elementary --vars '{enable_elementary_models: true}'
This ensures only one process ever writes to Elementary tables at a time. [parallel jobs guidance]
-------------------------
Option 3: Serialize via Airflow Pools
If you use Airflow, use a pool with a single slot for tasks that trigger Elementary hooks, ensuring only one dbt job writes to Elementary at a time. [BQ concurrency]
-------------------------
Option 4: Remove Hooks from Long-Running Models
If specific long-running models are tying up transactions on Elementary tables, you can remove the post-hooks from those models ā especially if they don't need to be tracked in Elementary. [Slack thread]
-------------------------
The Elementary team's official troubleshooting guide also covers this: docs.elementary-data.com/oss/general/troubleshooting#error-when-trying-to-run-parallel-dbt-jobs. š 0 button š 0 button ā¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.Senmi Rai
03/06/2026, 7:35 PMkapa.ai
03/06/2026, 7:35 PMon-run-end hook automatically writes project metadata (like your models, tests, sources) to tables such as dbt_models. If two dbt runs finish at the same time, both hooks try to update the same table simultaneously ā and one of them fails. [BQ concurrent updates]
The fix
Step 1: Turn off the automatic metadata upload by adding this to your `dbt_project.yml`:
vars:
disable_dbt_artifacts_autoupload: true
This stops the hook from writing project metadata after every run, so there's no more conflict.
Step 2: Update the metadata manually (or on a schedule) by running:
dbt run --select elementary.edr.dbt_artifacts
You only need to run this when your project actually changes (e.g., after merging a PR with new models or tests). [on-run-end hooks]
What you don't lose
This only disables the metadata upload. Your test results and run results will still be collected automatically after every run ā so your Elementary monitoring stays intact. [on-run-end hooks] š 0 button š 0 button ā¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.Senmi Rai
03/06/2026, 7:39 PMkapa.ai
03/06/2026, 7:40 PMdisable_dbt_artifacts_autoupload: true without ever running Step 2, here's what happens:
⢠The concurrency conflict is resolved ā the hook no longer writes project metadata on every run, so the transaction conflict goes away. ā
⢠Test results and run results still upload ā your Elementary monitoring continues to work normally. ā
⢠Your project metadata becomes stale ā tables like dbt_models, dbt_tests, and dbt_sources will no longer be updated. This means Elementary's report and alerts may show outdated information about your project structure (e.g., old model names, removed tests still appearing). ā ļø [on-run-end hooks]
So it's fine as a quick fix to stop the errors, but you should still run Step 2 at least once (and again whenever your project changes) to keep the metadata current. [reduce on-run-end time] š 0 button š 0 button ā¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.Senmi Rai
03/06/2026, 7:41 PMkapa.ai
03/06/2026, 7:41 PMdbt_project.yml under the vars key:
vars:
disable_model_alerts: true
disable_test_alerts: true
disable_warn_alerts: true
After adding these, re-run the Elementary models to apply the changes: [disable alerts]
dbt run -s elementary
> Important: Make sure the vars are placed directly under the top-level vars key, not nested under any model or package section. [correct placement]
If you want to re-enable alerts later, simply set those vars back to false and re-run dbt run -s elementary. š 0 button š 0 button ā¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.