while running Terraform validate getting below error:-
fork/exec .terraform/providers/registry.terraform.io/hashicorp/azurerm/3.14.0/windows_amd64/terraform-provider-azurerm_v3.14.0_x5.exe: Access is denied.
When running Terraform Plan getting below error:-
│ Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider
│ registry.terraform.io/hashicorp/azurerm: failed to instantiate provider "registry.terraform.io/hashicorp/azurerm" to obtain schema: fork/exec
│ .terraform/providers/registry.terraform.io/hashicorp/azurerm/3.14.0/windows_amd64/terraform-provider-azurerm_v3.14.0_x5.exe: Access is denied...
Note:
- I have tried with deleting lock file and .terraform and rerun terraform init same error getting.
- Given all(full permission) access to user on required folder.
- Checked with older version and newer version of azurerm provided but getting same error still.
please check and let me know possible solution.enter image description here
2
Answers
1- Remove .terraform from your local data.
2- commit the changes to remove those from the git as well.
3- include .terraform on your git ignore, terraform will download those on runtime.
4- run terraform init to make your local env work again.
5- profit
At least for me, those steps fixed the same problem I was having with the azurerm provider.
I was getting access denied error after running terraform init and terraform init -reconfigure multiple times but was still getting access denied error.
You also need to check the bucket names in the provider section. I had this issue as i copied the code from other projects.