<@U088WCP3B4P> Facing this error using dbt + bigqu...
# ask-elementary-ai
a
@kapa.ai Facing this error using dbt + bigquery: Transaction is aborted due to concurrent update against table elementary.dbt_snapshots how to fix it ?
k
This is a known concurrency issue with Elementary on BigQuery. It happens when multiple dbt runs finish at the same time and each run's
on-run-end
hook tries to update the same Elementary artifacts tables (including
dbt_snapshots
) simultaneously, causing BigQuery to abort one of the transactions. [BQ concurrency] Recommended Fix: Disable Artifact Autoupload + Run Artifacts Separately Step 1 – Disable automatic artifact uploads in your `dbt_project.yml`:
Copy code
vars:
  disable_dbt_artifacts_autoupload: true
This stops the
on-run-end
hook from writing to artifacts tables (like
dbt_snapshots
,
dbt_models
,
dbt_sources
, etc.) on every dbt run, which removes the source of concurrent updates. [BQ concurrent runs] Step 2 – Run artifacts manually in a single, controlled job:
Copy code
dbt run --select elementary.edr.dbt_artifacts
Run this as a dedicated, non-parallel job (e.g., a single Airflow task or CI/CD step) whenever you deploy changes. Since this is the only process updating the artifacts tables, there are no competing transactions. [BQ concurrent runs] > Note:
disable_dbt_artifacts_autoupload
only disables artifact uploads (item #3 of the hook). Test results and invocation data uploads are controlled by separate variables and are not affected by this setting. Alternative Options • Serialize via Airflow Pools: If you use Airflow, create a pool with a single slot and assign it to any task that triggers Elementary hooks, ensuring only one dbt job writes to Elementary tables at a time. [BQ concurrency] • Fully decouple Elementary writes: Disable Elementary models from running during normal
dbt run
and update them in a single dedicated job. [Elementary hooks error] The combination of disabling autoupload and running a single dedicated artifacts job is the most commonly confirmed fix for this BigQuery concurrency error. [BQ concurrent runs] šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.