'Terraform Azure - Error while loading schemas for plugin components: Failed to obtain provider schema:
I am getting below error after running terraform plan. I tried running below command but did not help :
terraform init - upgrade
terraform init
terraform plan
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.0"
}
}
}
# Configure the Microsoft Azure Provider
provider "azurerm" {
features {}
}
terraform plan
╷
│ 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.0.0/linux_amd64/terraform-provider-azurerm_v3.0.0_x5: exec
│ format error..
There were some recommendations to Delete the terraform directory and lock file but i am not able to find it.Not seeing the files / folder after running terraform init.
Solution 1:[1]
Once terraform init it will create terraformtfstate file, terraform.loc.hcl file and also a directory of the provider.
you can get those files under folder you have created for main.tf file..
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |


