skip to Main Content

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:

  1. I have tried with deleting lock file and .terraform and rerun terraform init same error getting.
  2. Given all(full permission) access to user on required folder.
  3. 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. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search