Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlantis comments that workspace is locked on non-tf pull requests #221

Closed
lkysow opened this issue Aug 10, 2018 · 19 comments
Closed

Atlantis comments that workspace is locked on non-tf pull requests #221

lkysow opened this issue Aug 10, 2018 · 19 comments
Labels
bug Something isn't working waiting-on-response Waiting for a response from the user

Comments

@lkysow
Copy link
Member

lkysow commented Aug 10, 2018

Reported by a user in the Atlantis Slack.

They have a big monorepo with lots of pull requests. Sometimes non-tf pull requests will see a comment from Atlantis:

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

It's happening because before Atlantis can figure out if a pull request should be acted on, it clones it and tries to read its atlantis.yaml file. To clone it, it needs to lock the dir where it would clone it. If another pull request event comes in as this is happening, then Atlantis gives an error.

Possible solutions:

  • make an api call to find out if there's an atlantis.yaml file. If not, make an api call to find out if there are any .tf files changed. If not, then no need to clone.
  • don't send the "workspace is locked" message for pull request updates, only comments.
    • this will be bad if two commits in a row are pushed to a real terraform change since only the first will be planned and there will be no warning that the second was discarded
  • queue up "runs" for each pull request
@ajbouh
Copy link

ajbouh commented Dec 19, 2018

There are a number of commands that can operate directly against a bare git repository that allow you interrogate the state of files without needing to check them out.

Would using these commands help avoid the need to lock the workspace?

@lkysow
Copy link
Member Author

lkysow commented Dec 30, 2018

I think that would half-solve the problem. But I'd like to tackle this through the queuing up of runs since that's a better long-term solution.

@matkam
Copy link

matkam commented Sep 16, 2019

This seems like a related issue #305

@mbamber
Copy link

mbamber commented Dec 6, 2019

@lkysow - has there been any update on this? We have just started using atlantis and this is happening on a lot of our non TF PRs

@hack2learn
Copy link

We would love to see this as well as we use a mono repo.
If we could provide a base path that would be ideal and ignore anything else that does not start with the base_path within such a mono repo. Could maybe be controlled in atlantis.yaml or a server side repo config?

@marsavela
Copy link

Interested here as well. Would be great to see a solution. 😅

@Isan-Rivkin
Copy link

Isan-Rivkin commented May 14, 2020

Same problem here, what would be the current solution?
I couldn't think about anything besides restarting the Atlantis deployment.

@BoraxTheClean
Copy link

+1 We are also having this same problem in our mono repo.

@jurgen-weber-deltatre
Copy link

this is happening for us when using dependabot.

@jurgen-weber-deltatre
Copy link

can the commands just queue instead of erroring? You obviously know something is going on just queue and keep going until its all done.

@povils
Copy link

povils commented Sep 21, 2021

Any updates? it's 3 years already.
Are there any workarounds?

@m00lecule
Copy link

bump

@ashleydavies
Copy link

For posterity, it seems like the --skip-clone-no-changes flag added in #967 should solve this problem

@BoraxTheClean
Copy link

BoraxTheClean commented Jan 25, 2022

For posterity, it seems like the --skip-clone-no-changes flag added in #967 should solve this problem

This does not resolved the issue for us. We have had this flag enabled the entire time we've been experiencing this bug. I believe this is due to the fact that we use hooks to dynamically create our atlantis.yaml after clone.

@mcrivar
Copy link

mcrivar commented Feb 7, 2022

same issue here, when commit is with changes on two or more catalogs, they just block each other and are not executed.

@pantelis-karamolegkos
Copy link
Contributor

pantelis-karamolegkos commented Apr 27, 2022

Can anyone elaborate on that

non-tf pull requests

mean?

We are experiencing this issue on normal TF PRs.

Actually we use parallel and create workspaces flags and this can happen on a percentage of say 10 parallel plans that were executed.

We have a large terragrunt monorepo and atlantis.yaml is generated dynamically via terragrunt-atlantis-config but I don't think this is causing the problem.

@jamengual
Copy link
Contributor

I do not think this is the case anymore, is this still an issue with v0.19.8?

@jamengual jamengual added the waiting-on-response Waiting for a response from the user label Aug 26, 2022
@pantelis-karamolegkos
Copy link
Contributor

@jamengual is this supposed to be resolved for versions > 19.8 ?

@jamengual
Copy link
Contributor

yes

meringu pushed a commit to meringu/atlantis that referenced this issue May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting-on-response Waiting for a response from the user
Projects
None yet
Development

No branches or pull requests