Problem
During a terraform run you may see a Failed handling run
error:
[ERROR] terraform: Failed handling run: error="operation failed: failed writing remote backend config file: open /home/tfc-agent/.tfc-agent/component/terraform/runs/run-test.plan/config/projects/agents/zzz_backend_override.tf: no such file or directory"
Note: The zzz_backend_override.tf
file is managed by Terraform Cloud/Terraform Enterprise and won't be present in your configuration.
Cause
You can encounter this error if the workspace is configured with a Terraform Working Directory that doesn't exist in the directory structure of the workspace's configuration.
The Terraform Working Directory in located under Workspace > Settings > General:
Solution
Check that the directory specified as the Terraform Working Directory exists in the configuration the workspace is using. If the run was triggered by VCS, check the source repository. If the run was triggered locally, check the directory terraform was run from. If the run was triggered via the API, check the uploaded archive.