Closed
Description
This is unfortunately an issue with Terraform (and largely just filesystems in general). Some background:
text file busy
can occur in Linux when a process tries to write or modify an executable that's currently running. In TF's case this typically happens when multiple processes try to write and use plugins from the same cache directory.- In Coder's case we use a separate cache directory per runner. e.g. if you're running 3 runners they should all be writing their plugins to their own exclusive directories avoiding this problem.
- Despite this I'm guessing that some terraform or plugin process is not exiting on a run which causes subsequent runs to fail.
Regardless we should do our best to circumvent this when we detect this during a build. It's unknown to me how long the process lingers but it could potentially be indefinitely which would render that particular runner dead for subsequent runs, requiring the end user to rebuild a number of times before getting a successful build which is not acceptable.
e.g.
Initializing the backend...
09:45:57.672Initializing provider plugins...
09:45:57.672- Finding coder/coder versions matching "~> 0.23.0"...
09:45:57.761- Finding hashicorp/kubernetes versions matching "~> 2.30.0"...
09:45:58.031- Installing coder/coder v0.23.0...
09:45:58.330- Installing hashicorp/kubernetes v2.30.0...
09:45:59.405- Installed hashicorp/kubernetes v2.30.0 (signed by HashiCorp)
09:45:59.406Error: Failed to install provider
09:45:59.406Error while installing coder/coder v0.23.0: open
09:45:59.407/tmp/coder/provisioner-1/tf/registry.terraform.io/coder/coder/0.23.0/linux_amd64/terraform-provider-coder_v0.23.0:
09:45:59.408text file busy