Just started receiving this error message when running the command terraform apply
from my local dev machine:
Operation failed: failed writing remote backend config file: open /home/tfc-agent/.tfc-agent/component/terraform/runs/run-28qRcAgwjYzYA6xX/config/infra/zzz_backend_override.tf: permission denied
I have been able to run the command successfully before in the same project, I have upgraded Terraform via Chocolatey from version 1.6.2 to version 1.6.3. The folder structure or the settings in Terraform cloud for the project have not changed either. Terraform Cloud is my backend. Any suggestions?
Update: All terraform projects are giving the same error. I have uninstalled Terrafrom via Chocolatey and restarted the computer. I then proceeded to install it again and it installed version 1.6.4. Error still occurs if when I run ‘terraform plan’. I tried contacting Terraform support but since I’m on the free plan they sent me here. Is there a way to fix this issue?
Still stuck with this issue, C:\Users\tfc-agent
folder doesn’t exist on my windows box, so it is not a local permission issue. I’ve tried creating a new token and using that instead when firing off plans or applies, didn’t help. Before I get the error Terraform outputs the following: “Terraform v1.6.4
on linux_amd64”
I don’t have it set to run locally in a docker so it leads me to think something is wrong with the Terraform Cloud VM that I’m using. Recently changed my email address on my account but don’t see how that would change anything.
I’ve tried running the plan or apply locally and just using Terraform cloud for the remote state file. That works just fine, only have an issue when I try to use the CLI to run terraform plan or apply when “Execution mode” in Terraform cloud is set to “Remote” and not “Local”. This error occurs on multiple workspaces.
I use Terraform cloud to hold all of my workspace variables as well for the different environments. So getting this fixed is critical, and rewriting everything to accommodate local variable files, would take a lot of work.
If I pull the terraform files out of the subdirectory (“infra”) and change the Terraform Working Directory under settings → General then I am able to run the plans and applies. Would prefer having the files in a subdirectory to better organize the code.
Any suggestions on how to correct this?