Why does Terraform report "Failed to query available provider packages" with Spacelift provider?

Last updated: May 16, 2025

If you encounter the error "Failed to query available provider packages" when using the Spacelift provider, this typically indicates that Terraform is attempting to source the provider from the wrong location (defaulting to hashicorp/spacelift instead of spacelift-io/spacelift). This can happen when no source is specified.

Correct Provider Configuration

Ensure your Terraform configuration correctly specifies the required provider source:

terraform {
  required_providers {
    spacelift = {
      source  = "spacelift-io/spacelift"
      version = ">= 0.1.3"
    }
  }
}

Troubleshooting Provider Source Issues

If you still encounter the error despite having the correct provider configuration, another module in your configuration might be attempting to use the provider without properly specifying the source. To identify which module is causing the issue:

  1. Run terraform providers command locally or as a Spacelift task

  2. Review the output to identify which modules are attempting to use the Spacelift provider

  3. Ensure all modules that use the Spacelift provider have the correct required_providers block

The correct provider source is available at: registry.terraform.io/providers/spacelift-io/spacelift