https://garden.io logo
#🌱|help-and-getting-started
Stuck after changing terraform backend
# 🌱|help-and-getting-started
r

rough-kilobyte-44808

01/23/2023, 5:37 PM
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

quaint-dress-831

01/24/2023, 5:46 PM
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

rough-kilobyte-44808

01/24/2023, 5:53 PM
i can run terraform commands and get no messages at all. works fine
q

quaint-dress-831

01/24/2023, 6:37 PM
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

rough-kilobyte-44808

01/24/2023, 7:28 PM
thanks!
q

quaint-dress-831

01/25/2023, 1:42 PM
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

rough-kilobyte-44808

01/26/2023, 8:52 PM
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

quaint-dress-831

01/26/2023, 9:00 PM
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

bright-policeman-43626

02/10/2023, 4:22 PM
Nice work documenting that issue @quaint-dress-831! ❤️
10 Views