IssueRaiser

Allow multiple Terraform instances to write to `plugin_cache_dir` concurrently

### Terraform Version ```shell 1.3.2 ``` ### Terraform Configuration Files ```terraformrc plugin_cache_dir = "$HOME/.terraform.d/plugin-cache" ``` ### Debug Output no debug ### Expected Behavior Multiple terraform processes should work fine with the same `plugin_cache_dir` ### Actual Behavior ``` Initializing provider plugins... - Reusing previous version of hashicorp/aws from the dependency lock file - Using hashicorp/aws v4.34.0 from the shared cache directory - Reusing previous version of hashicorp/aws from the dependency lock file - Using hashicorp/aws v4.34.0 from the shared cache directory - Using hashicorp/aws v4.34.0 from the shared cache directory - Using hashicorp/aws v4.34.0 from the shared cache directory - Installing datadog/datadog v3.16.0... ╷ │ Error: Failed to install provider from shared cache │ │ Error while importing hashicorp/aws v4.34.0 from the shared cache │ directory: the provider cache at .terraform/providers has a copy of │ registry.terraform.io/hashicorp/aws 4.34.0 that doesn't match any of the │ checksums recorded in the dependency lock file. ``` ### Steps to Reproduce I'm using terragrunt, which does initialization of multiple tf stacks at once. ### Additional Context Race condition between two terraform init happens when they are trying to install the same provider same version. First tf calls `installFromHTTPURL` and it downloads to a temporary file with random name, but then it calls `installFromLocalArchive` and this unpacks d

Posted by amkartashov on Oct 7, 2022, 12:36 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

onboarding (Other)

Allow multiple Terraform instances to write to `plugin_cache_dir` concurrently

amkartashovOct 7, 2022, 12:36 PM

### Terraform Version ```shell 1.3.2 ``` ### Terraform Configuration Files ```terraformrc plugin_cache_dir = "$HOME/.terraform.d/plugin-cache" ``` ### Debug Output no debug ### Expected Behavior Multiple terraform processes should work fine with the same `plugin_cache_dir` ### Actual Behavior ``` Initializing provider plugins... - Reusing previous version of hashicorp/aws from the dependency lock file - Using hashicorp/aws v4.34.0 from the shared cache directory - Reusing previous version of hashicorp/aws from the dependency lock file - Using hashicorp/aws v4.34.0 from the shared cache directory - Using hashicorp/aws v4.34.0 from the shared cache directory - Using hashicorp/aws v4.34.0 from the shared cache directory - Installing datadog/datadog v3.16.0... ╷ │ Error: Failed to install provider from shared cache │ │ Error while importing hashicorp/aws v4.34.0 from the shared cache │ directory: the provider cache at .terraform/providers has a copy of │ registry.terraform.io/hashicorp/aws 4.34.0 that doesn't match any of the │ checksums recorded in the dependency lock file. ``` ### Steps to Reproduce I'm using terragrunt, which does initialization of multiple tf stacks at once. ### Additional Context Race condition between two terraform init happens when they are trying to install the same provider same version. First tf calls `installFromHTTPURL` and it downloads to a temporary file with random name, but then it calls `installFromLocalArchive` and this unpacks d

Comments (0)

No comments yet. Start the discussion.

Comment on this issue