This message was deleted.
# atlantis-community
s
This message was deleted.
a
Plan Error
Copy code
running "/atlantis/bin/terraform1.5.4 plan -input=false -refresh -out \"/atlantis/repos/ORG/terraform/100/default/TERRAFORM/PROJECT/PATH/PROJECT-DEFAULT.tfplan\"" in "/atlantis/repos/ORG/terraform/100/default/TERRAFORM/PROJECT/PATH": signal: killed

No problems detected!
I run another
atlantis plan
Plan Error
Copy code
running "/atlantis/bin/terraform1.5.4 init -input=false -upgrade" in "/atlantis/repos/ORG/terraform/100/default/TERRAFORM/PROJECT/PATH": exit status 1

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/aws versions matching "5.10.0"...
- Installing hashicorp/aws v5.10.0...
╷
│ Error: Failed to install provider
│ 
│ Error while installing hashicorp/aws v5.10.0: open
│ /atlantis/plugin-cache/registry.terraform.io/hashicorp/aws/5.10.0/linux_amd64/terraform-provider-aws_v5.10.0_x5:
│ text file busy
╵
Currently there is one other PR open that has a plan by Atlantis. I restarted the pod (running on k8s) before the first plan
t
I've run into this using
plugin_cache_dir
in another tool and had to disable it: https://github.com/hashicorp/terraform/issues/31964#issuecomment-1271597992 Curious if other folks are able to successfully use
plugin_cache_dir
👀 1
Looks like atlantis recently added a flag to disable the plugin cache to work around this too. I really hope Hashi fixes the bug in TF. https://github.com/runatlantis/atlantis/pull/3720
🙌 2
j
Hashi says this isn't a bug and that the plugin cache was never intended to be concurrency safe. I highly doubt they will fix it. I've worked around this by doing a few things here at OM1. • Reduce the parallel pool size to 5 so only 5 inits can run at any given moment. • Add a custom command to my atlantis.yaml that runs tf providers mirror to a different directory per-init (this sort of kills the whole concept of using a cache but I want stability over speed) Here is a link to another thread where I posted a workaround that is currently working for me: https://atlantis-community.slack.com/archives/C5MGGAV0C/p1693429478890169?thread_ts=1693428770.117169&cid=C5MGGAV0C
f
I submitted a patch to hashicorp for it, they were not interested. It can also be fixed in the backend library they use to download and unzip files, but getting that changed and then getting hashicorp to use a new version of their own backend library sounds even worse. However, you can work around the annoying terraform behavior perfectly by setting the environment variable
TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE
.. In fact atlantis should probably recommend or at least mention setting that.
q
For us, before TFv1.4, since we are using custom python wrapper for Atlantis plan, we parse the error for plugin related message and retry a few time for failed plans due to plugin cache issue. This works well for us. After TFv1.4, we start to use
TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE
since the retries are no longer helping for the
Text file busy
issue in TFv1.4 and above...