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

terraform force-unlock doesn't work #45

Open
andrey-parkhomets opened this issue Jun 23, 2024 · 0 comments
Open

terraform force-unlock doesn't work #45

andrey-parkhomets opened this issue Jun 23, 2024 · 0 comments

Comments

@andrey-parkhomets
Copy link

andrey-parkhomets commented Jun 23, 2024

Looks like unlock doesn't work,

to reproduce run and interrupt with ctlr+c until lock released

terraform-backend-git --access-logs git terraform apply

repeat step and get message about existing lock

and finally try to unlock:

➜  tf ~/bin/terraform-backend-git --access-logs git  terraform force-unlock -force f835bc81-3964-1391-81a9-e6b5f098bc52
[terraform-backend-git]: Using config file: /Users/someuser/git/myfolder/tf/terraform-backend-git.hcl
[terraform-backend-git]: WARNING: HTTP basic auth is disabled, please specify TF_BACKEND_GIT_HTTP_USERNAME and TF_BACKEND_GIT_HTTP_PASSWORD
[terraform-backend-git]: WARNING: Access Logs enabled
[terraform-backend-git]: listen on 127.0.0.1:6061
[terraform-backend-git]: Unlocking state in https://github.com/my-org/tf-state?ref=main//my/state.json
[terraform-backend-git]: unexpected end of JSON input
127.0.0.1 - - [23/Jun/2024:17:37:18 +0200] "UNLOCK /?type=git&repository=https://github.com/my-org/tf-state&ref=main&state=my/state.json HTTP/1.1" 500 27
[terraform-backend-git]: Unlocking state in https://github.com/my-org/tf-state?ref=main//my/state.json
[terraform-backend-git]: unexpected end of JSON input
127.0.0.1 - - [23/Jun/2024:17:37:19 +0200] "UNLOCK /?type=git&repository=https://github.com/my-org/tf-state&ref=main&state=my/state.json HTTP/1.1" 500 27
[terraform-backend-git]: Unlocking state in https://github.com/my-org/tf-state?ref=main//my/state.json
[terraform-backend-git]: unexpected end of JSON input
127.0.0.1 - - [23/Jun/2024:17:37:21 +0200] "UNLOCK /?type=git&repository=https://github.com/my-org/tf-state&ref=main&state=my/state.json HTTP/1.1" 500 27
Failed to unlock state: Failed to unlock: UNLOCK http://localhost:6061/?type=git&repository=https://github.com/my-org/tf-state&ref=main&state=my/state.json giving up after 3 attempt(s)
Error: exit status 1

Workaround: delete appropriate branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant