Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Databases and Redis · Troubleshooting walkthrough

dbt state:modified cannot find manifest.json on a GitHub Actions runner

Short answer

Got a state selector method, but no comparison manifest means dbt found no manifest.json under the --state path. On GitHub Actions each run starts on a clean runner, so the production manifest must be downloaded first. dbt-core 1.12 also joins a relative --state path to the project root, and reusing target as state is flagged. Download the artifact into its own folder and pass that path.

  • Applies to dbt-core 1.12.7 (Python 3.10+), dbt 1.11 and later (DBT_ENGINE_STATE), actions/download-artifact v8, actions/upload-artifact v7
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Got a state selector method, but no comparison manifest means dbt looked for the previous run's manifest.json under the --state path and found nothing. On GitHub Actions the cause is nearly always environmental: a hosted runner starts with only your checkout, so the production artifacts you expected to compare against are not there.

Three things can be wrong, in this order of likelihood: the manifest never reached the runner, the state path points one folder off, or the state folder is the same as the target folder the current run writes into.

The text you see

  • Got a state selector method, but no comparison manifest
  • The state and target directories are the same: 'target'. This could lead to missing changes due to overwritten state including non-idempotent retries.

Stage 1

Confirm what dbt can see

Before the dbt command, list the state folder in the workflow. If the file is not listed, nothing about dbt is misconfigured yet.

A diagnostic step before dbt runs

- name: Show state folder
  run: ls -la prod-state/ || echo "prod-state is missing"

Stage 2

Bring the production manifest to the runner

A target folder from your laptop, or from an earlier workflow run, is not on a new runner. The production job should upload target/manifest.json as an artifact. The CI job then downloads it into its own folder. actions/download-artifact sees only artifacts of the current run unless you give it a token and a run ID, as its README describes, so a CI job that wants production's artifact must name the production run.

Download into its own folder from another run

- uses: actions/download-artifact@v8
  with:
    name: prod-manifest
    path: prod-state
    github-token: ${{ secrets.GITHUB_TOKEN }}
    run-id: ${{ env.PROD_RUN_ID }}

The token needs permission to read Actions artifacts, and the version tags above should match the ones you pin.

Stage 3

Point --state at the right place

The dbt documentation takes --state as a file path, or, from dbt 1.11, the DBT_ENGINE_STATE variable, with the flag winning if both are set. The state artifacts must have schema versions compatible with the dbt that is running. In dbt-core's source, a relative state path is joined to the project root, so when the dbt project lives in a subfolder, a path that is right from the workspace root is one level off. An absolute path avoids the question.

An absolute state path

dbt build --select state:modified+ --defer --state "$GITHUB_WORKSPACE/prod-state"

Stage 4

Do not reuse the target folder

If --state equals the target path, the current invocation writes its own manifest into the folder it is comparing against. On a fresh runner it starts empty, and on a reused one the old file can be replaced mid-run. Keep comparison artifacts in a separate folder such as prod-state and leave target for the current run.

Stage 5

If a different error follows

Once the file is found, a schema version error means the manifest came from another dbt version. Regenerate it in production with the version CI uses, and pin the version in both places.

Stage 6

state:modified selects only changed models in CI

  • The diagnostic step lists manifest.json in the state folder.
  • The dbt log reports the selected modified nodes and does not raise the comparison error.

If you only keep one thing

  • A clean runner has no production manifest unless you download it.
  • Use an absolute state path, in its own folder, apart from target.
  • Keep production and CI on the same dbt version.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want a second pair of eyes on it?

Send me the error and what changed before it started. I reply within 24 hours.