Failed generating provider schemas JSON

My runs in Terraform Cloud, and from the CLI, are failing with:

Failed generating provider schemas JSON

Does anyone know what this error means, or how I might fix it?

Here is my entire configuration.

backend.tf

terraform {
  backend "remote" {
    hostname     = "app.terraform.io"
    organization = "douglasnaphas"
    workspaces {
      name="mrdr"
    }
  }
  required_version = "~> 1.2.7"
}

main.tf

module "queue1" {
  source = "./modules/sqs-queue"
}

modules/sqs-queue/main.tf

resource "aws_sqs_queue" "terraform_queue" {
        fifo_queue                  = true
        content_based_deduplication = true
}

Update: my error went away when I removed the TF_WORKSPACE environment variable!

I’d love to understand the reason this would happen.

Hi Douglas Naphas,

The TF_WORKSPACE ENV variable does not make sense in the context of Terraform Cloud, since currently, the workspace would always be “default”.

In Terraform Cloud there are a few other steps that happen besides “terraform init / plan / apply” and the TF_* ENV variables seem to interfere with those commands, thus the error.

Regards,
Filip

1 Like

Hi Flip,
i am facing the same issue with below block
terraform {
cloud {
hostname = “app.terraform.io”
organization = “something”
workspaces {
name = “vpc-dev”
}
}
required_providers {
aws = {
source = “hashicorp/aws”
version = “~> 4.0”
}
}
}