dbt clone failed: state artifact mismatch
Fixes dbt clone state comparison failures for analytics engineers and repair agents. Use when dbt clone fails on state artifact mismatch. Not for clone permission errors or missing source schemas.
TL;DR
dbt clone compares your current manifest against the --state manifest, and they disagree about what is the same. Regenerate the state artifacts from the same commit and target, point --state at that directory, and re-run. Mixing artifacts from different branches or targets is the usual cause.
Error
dbt clone failed: state artifact mismatchSteps
Check what --state points at and when its manifest.json was generated (look at generated_at inside the file). Expected: You see whether the state manifest is stale, from another branch, or built for a different target.
Regenerate state cleanly: check out the reference commit, run dbt compile (or parse) with the same target, and copy the resulting target/ aside as your state directory. Expected: A fresh state manifest from the right commit and target.
Re-run dbt clone --state path/to/fresh/state. Expected: State comparison succeeds and clone proceeds.
If it still mismatches, diff the two manifests' node counts; a model added or removed between state generation and now explains it. Expected: You find the added or removed node and regenerate state after the change.
When to use
- dbt clone fails with state artifact mismatch
- state artifacts were copied from a different branch or target
- CI generates state in one job and clones in another with different checkouts
When not to use
- clone fails with a permission error on the source schema (that is grants, not state)
- the source schema or tables do not exist (nothing to clone)
- you are not using deferral or cloning at all
Tool compatibility
- dbt-core 1.1+; dbt clone --state is the deferral workflow
- manifest.json generated_at tells you when state was built
- CI: persist the state directory as an artifact between jobs
Variant phrasings
state artifact mismatch in slim CI
Slim CI lives on this mechanism: --select state:modified --state prod_artifacts. The prod artifacts must come from the production job's target/, same dbt version.
mismatch after dbt upgrade
Manifest schema versions differ across dbt versions. Regenerate state with the same dbt version you clone with.
Why it happens
State comparison is a manifest-to-manifest diff. If the two manifests were built from different code, different targets, or different dbt versions, the diff is meaningless and dbt refuses rather than cloning the wrong things. Fresh, matched artifacts are the fix.
Edge cases
- dbt Cloud deferral handles state internally; this error is mostly a CLI/CI concern.
- Deferral to another environment also needs the right target in the state manifest, not just the right commit.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstoAbdl4nnqDeQXPf0so3Rg