opentofu / opentofu

OpenTofu lets you declaratively manage your cloud infrastructure.
https://opentofu.org
Mozilla Public License 2.0
23k stars 886 forks source link

`tofu providers schema -json` results in `Error: Failed to load plugin schemas` (linux_amd64) #2062

Open away168 opened 2 weeks ago

away168 commented 2 weeks ago

OpenTofu Version

OpenTofu v1.8.3
on linux_amd64

OpenTofu Configuration Files

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "4.4.0"
    }
  }
}

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "foo" {
  name = "foo"
  location = "westus"
}

Debug Output

running task: tofu -version tofu providers schema -json

tofu -version OpenTofu v1.8.3 on linux_amd64

  • provider registry.opentofu.org/hashicorp/azurerm v4.4.0 tofu providers schema -json ╷ │ 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: unavailable │ provider "registry.terraform.io/hashicorp/azurerm"..

See TRACE logs here

Expected Behavior

No error; and maybe also not reference the terraform registry?

Actual Behavior

> tofu providers schema -json
╷
│ 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: unavailable
│ provider "registry.terraform.io/hashicorp/azurerm"..

Steps to Reproduce

  1. tofu init
  2. tofu providers schema -json

Additional Context

This does not error when using a different architecture, darwin_arm.

Actually. Tried on another box and it worked. I think this might be a memory limit issue. or more likely OS issue - failing runs are using Alpine OS. The generated json is 2.9M.

References

away168 commented 2 weeks ago

Updated with more context that it might be a memory issue (doubtful) or maybe an Alpine Linux OS issue.