High severitydbt
Power BI Refresh Error:
dbt Adapter Connection Pool Exhausted
What does this error mean?
The dbt adapter's connection pool ran out of available connections to the warehouse. New model threads cannot acquire a connection and fail with a pool exhaustion or timeout error.
Common causes
- 1The dbt job's `threads` setting exceeds the number of warehouse connections available to the service account
- 2The warehouse has a per-user or per-role concurrent connection limit lower than the dbt thread count
- 3Connection leak: previous dbt runs left connections open and the pool is partially occupied by idle connections
- 4dbt is running multiple jobs concurrently (e.g., dbt test and dbt run simultaneously) and the combined thread count exceeds the pool size
How to fix it
- 1Reduce the `threads` setting in the dbt profile or dbt Cloud environment: start at 4 and increase cautiously based on warehouse capacity.
- 2Check the warehouse's session limit for the service account role: `SHOW PARAMETERS LIKE 'SESSIONS_PER_USER' IN ACCOUNT` (Snowflake) or equivalent.
- 3Add a `connection_timeout` to the profile to force connection requests to fail fast rather than hang indefinitely.
- 4For concurrent dbt jobs: stagger their schedules or reduce thread counts so the total connections across all concurrent jobs stays within the warehouse limit.
- 5Upgrade the connection pool handling in the adapter if using an older version — recent adapters have improved pool cleanup on run completion.