-
Notifications
You must be signed in to change notification settings - Fork 3
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
Error Edge-case #47
Comments
Actually, I have one of our projects that is currently in this exact error state right now. Terraform attempts to call PyTerraBackTyl via a LOCK request to Looking at the git backend's committed code, it's not locked. Looking on-server in Running Restarting the service is confirmed to fix the issue. As soon as it's restarted I can run terraform and it correctly determines it to be unlocked. |
Hey Josh, I've got a guess on what's happening here and I believe this is related to Issue #36. What is Next time you run into this issue, navigate or curl The work-arounds are to do scheduled restarts of the service, or to set side notes: I've got a mild cold atm and I'm notorious for misreading things when I'm not 100%, so let me know if I've wildly misunderstood the issue here. |
We're using |
Hm. Very strange. Do you happen to know if you're getting a lock state of INIT, or lock state of LOCKED? What version of terraform are you using? My company refuses to budge from 0.11.x, so if you're using 0.12, we might be running into an unexpected compatibility issue. Also, just a quick note to mention that I just did a PR to correct a 'c' to a 'C' on line 61 of pyterrabacktyl.py |
I haven't been able to get the expected lock state yet, I'm waiting for the next time it happens to see what gets output in the debug logging. We're currently running 0.12.8, though we've also had this issue on 0.12.5 I believe. |
While we wait for the bad state to show up again, could you double check the following for me? Given the symptoms, I don't expect any will be the case, but I thought of couple scenarios that might cause one or more of the below.
|
Sorry for the late response, I was out of the office and away from my computer for almost 2 weeks. To respond to your questions:
|
We're running into this issue again. It looks like sometime yesterday a build didn't quite finish properly (not a PyTerraBackTyl issue). So within the actual git repo for the branch (we'll call it The local git repo at Interestingly, when I attempt to manually unlock the file (via curl command), debugging code shows:
So i'm not sure why PyTerraBackTyl thought that the repo was INIT, since by all accounts it was locked. The curl call to UNLOCK did unlock it, and it's functional again. |
So after spending quite a bit of thought on this, I think some additional logging might shed some more insight on this problem. I'll try to make some additions to the code sometime this week.
|
Hi Josh, FYI, I was unable to get the |
Closing due to age |
Background: We are currently running PyTerraBackTyl with the git backend, using Atlantis as a front end.
There appears to be an edge-case where we are hitting your error message here:
PyTerraBackTyl/pyterrabacktyl.py
Lines 55 to 58 in 025a73c
My testing shows that usually what happens in that PyTerraBackTyl has the specific project
LOCKED
in its own internal memory, but the git repo that PyTerra saves state into has the project unlocked. I'm not sure yet what causes this mismatch, but a service restart is usually enough to correct the issue (hence why my thinking it's saved in memory incorrectly).It also seems that when PyTerra is trying to write the git commit message, it can fail on the
defaultdict
portion of this line:PyTerraBackTyl/backends/git_backend.py
Line 87 in 025a73c
It gives a KeyError against
Who
, with ourGIT_COMMIT_MESSAGE_FORMAT
set to"{Who}, {Operation} - {ID}"
. I'm not sure if this is something that's also saved in memory and is perhaps also getting messed up, or if it's entirely unrelated to the LOCKED/UNLOCKED issue.I will submit shortly a PR shortly that makes the error referenced first in this issue a bit more descriptive.
The text was updated successfully, but these errors were encountered: