Atlantis "plan failed" comment on a pull request in CI
Atlantis runs terraform plan per configured project and posts the result as a PR comment. A "Plan Failed" comment means the underlying plan (init, provider, or HCL error) failed. The captured Terraform output in the comment holds the real cause.
What this error means
Atlantis comments "Plan Failed" (or "ran Plan for dir ... : failed") on the pull request. The status check is red and the plan output block shows a Terraform error.
Ran Plan for dir: `prod` workspace: `default`
Plan Failed: running "terraform plan" in "prod": exit status 1
Error: Failed to get existing workspaces: ...Common causes
The Terraform plan itself failed
Atlantis is a wrapper; the failure is a normal Terraform error (backend auth, provider, invalid HCL) surfaced through the comment.
A misconfigured project or workflow
A wrong directory, workspace, or custom workflow in atlantis.yaml makes the plan run in the wrong place and fail.
How to fix it
Read the captured plan output
- Expand the plan output block in the Atlantis comment.
- Find the first
Error:line and fix it as you would any Terraform plan error. - Comment
atlantis planto re-run for that project.
# re-run the plan for the failing project after fixing config
atlantis plan -d prodCorrect the project config
If the plan ran in the wrong dir/workspace, fix the projects entry in atlantis.yaml so the plan targets the right code.
How to prevent it
- Keep
atlantis.yamlproject dirs and workspaces accurate. - Fix Terraform errors surfaced in the comment, not the wrapper.
- Use autoplan on the right file paths so only relevant projects plan.