dbt packages.yml failed with dbt-utils version conflict error
Fixes dbt package version conflicts by pinning dbt-utils and other packages to versions compatible with your dbt-core, clearing the lock file, and reinstalling. Use when dbt deps fails on version conflicts. Not for git authentication failures, which are a different problem.
TL;DR
Two packages (often dbt-utils and another) require incompatible versions of something, or dbt-utils requires a different dbt-core than you have. Pin every package to mutually compatible revisions, delete package-lock.yml, and run dbt deps fresh.
Error
dbt packages.yml failed with dbt-utils version conflict errorSteps
- Open
packages.ymland list each package's version or revision. Expected: you see the full requested set. - Check dbt-utils' release notes for the dbt-core versions it supports, and do the same for your other packages. Expected: you identify the incompatible pair.
- Pin compatible versions explicitly, for example:
packages:
- package: dbt-labs/dbt_utils
version: [">=1.0.0", "<2.0.0"]Expected: every package has a pin compatible with your dbt-core.
- Delete
package-lock.yml(it may be pinning the conflict) and any staledbt_packages/directory. Expected: no cached resolution remains. - Run
dbt deps. Expected: all packages install without conflicts.
When to use
dbt depsfails with a version conflict mentioning dbt-utils or another package.- You just upgraded dbt-core and deps broke.
When not to use
dbt depsfails on git authentication (fix credentials, not versions).- A package installs but its macros misbehave (a compatibility bug, not a resolution conflict).
Tool compatibility
- dbt Core 1.0 and later, dbt Hub and git packages.
Variant phrasings
dbt deps: could not resolve package versions
The resolver failed; pinning narrows the search space enough to succeed.
Package requires dbt-core >= X but you have Y
Upgrade dbt-core or downgrade the package; one side has to move.
Why it happens
dbt resolves package versions against your installed dbt-core and against each other. Unpinned packages float to latest, which eventually requires a newer core than you run, or two packages demand incompatible ranges.
Edge cases
- Git packages pinned to branches move over time; pin to tags or SHAs for reproducibility.
dbt deps --upgradere-resolves everything; use it deliberately, not casually.- Private registry mirrors can serve stale versions; check the mirror when pins look right but fail.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstxMFPiEd-WtU8EnfFyEMqw