Terraform / atlantis creates locks for no apparent reason

2.7k Views Asked by At

I have set up atlantis and configured multiple projects.

I am not using workspaces (therefore, for each project only the default workspace should be applicable).

However, when creating a GitHub Pull Request that includes changes to multiple projects, I get the following error(s)

dir: terragrunt/path1/to/something workspace: default

The default workspace is currently locked by another command that is running for this pull request.
Wait until the previous command is complete and try again.
dir: terragrunt/path1/to/anotherthing workspace: default

dir: terragrunt/path2/to/anotherthing workspace: default

The default workspace is currently locked by another command that is running for this pull request.
Wait until the previous command is complete and try again.

This is despite the fact that docs state:

Only the directory in the repo and Terraform workspace are locked, not the whole repo.

Any idea why is this happening?

1

There are 1 best solutions below

0
On

I saw something similar after setting

parallel_plan: true
parallel_apply: true

in my atlantis.yaml.

Removing these fixed the issue for me, and I assume setting them to false would achieve the same thing.

I am not 100% clear WHY this is happening yet, but it appears to have something to do with the way Atlantis locks and terraform workspaces interact, as the default workspace is called default and it appears that Atlantis locks, might be related to the workspace name.

It looks like you have already reported the issue here and that the maintainers responded that there is a merged but currently (2022-04-29) unreleased fix.

Hope this helps others who happen to stumble upon this...