Stuck after changing terraform backend
# 🌱|help-and-getting-started
r
I am somehow completely stuck and cannot run any garden commands after switching to an azure backend for my terraform config. I got the message about "Backend configuration block has changed" which said to migrate state, so I did, and state was migrated. But now I get that message for every garden command I run, period. I have blown away the .garden dir, the .terraform dir, everything, and no matter what I do I get that message. It's also worth mentioning that even before this happened, I got the message about terraform state being out of sync on every command, every single time, period, even when the command just previous was a terraform apply... I need help bad, as I am completely shut down right now!
Maybe worth mentioning: my terraform config is in a subdir, not the project root, if this matters...
q
Hey @rough-kilobyte-44808 and welcome to the community. If you can run Terraform commands directly against the project dir in which your Terraform configuration is present and you're getting these messages (just to confirm, this is what you're doing to test?) then the issue won't be related to Garden
r
i can run terraform commands and get no messages at all. works fine
q
Apologies for misunderstanding, it's the end of the work day for me now, I'll write you tomorrow morning when I'm up 🙂
r
thanks!
q
Ok, let's try something out. Assuming you're using Garden's latest supported version of Terraform can you run
garden tools terraform.terraform-1-2-9 init
? If you're using another version you can find the correct version string to invoke with
garden tools
If you do it this way it will run the exact Terraform that Garden itself uses under the hood and should hopefully resolve the issue.
r
I will try this! Of course today my docker desktop kubernetes got itself so borked it cannot run, uninstall, reset, etc. I will try this as soon as I get back in business. Thank you!
q
Happy to help! 😊
@rough-kilobyte-44808 I encountered the same error as you when attempting to swap backends. I was finally able to fix the issue by blowing away the
.terraform
directories at both the root and the subdir holding the Terraform configuration and also deleting the
terraform.tfstate.d
folder within my configuration subdir
b
Nice work documenting that issue @quaint-dress-831! ❤️
20 Views