IBM Support

Plugin reinitialization error after upgrade to Terraform 0.13

Troubleshooting


Problem

After upgrading your Terraform configuration to version 0.13, terraform apply commands fail with an error indicating a plugin reinitialization is required. The provider path in the error message may vary.

Initializing plugins and modules...
Error: Could not load plugin

Plugin reinitialization required. Please run "terraform init".

Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.

Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints, run "terraform providers".

Failed to instantiate provider "registry.terraform.io/-/aws" to obtain schema:
unknown provider "registry.terraform.io/-/aws"

Cause

Provider source addresses that begin with registry.terraform.io/-/ are legacy addresses from Terraform 0.12 and earlier where the provider's namespace was unknown. In Terraform 0.13 and later, providers require a full namespace (e.g., hashicorp/aws).

While Terraform 0.13 can automatically update addresses for official providers found in the public Terraform Registry, it cannot do so for in-house or other providers not in its lookup table. The terraform state replace-provider command is required to manually update the provider source addresses recorded in the Terraform state file to match the new, namespaced format.

Solution

This solution uses the terraform state replace-provider subcommand to update the provider addresses in your state file.

Prerequisites

If your state file is stored in a remote backend, such as HCP Terraform or Terraform Enterprise, you must configure the backend in your local environment before running the following commands. You do not need the full Terraform configuration for the workspace, only the backend configuration.

Configure a remote back end

If you are using a local state file, you can skip this step.

Procedure

  1. Initialize the Terraform configuration directory to configure the backend and download plugins.

    $ terraform init
  2. Run the terraform state replace-provider command to map the legacy provider address to the new, namespaced address. This example uses the AWS provider.

    $ terraform state replace-provider registry.terraform.io/-/aws registry.terraform.io/hashicorp/aws

    Terraform prompts for confirmation. You must type yes to apply the change.

Outcome

After the command completes successfully, a new state version is created. You can verify this by navigating to your workspace in the Terraform Enterprise or HCP Terraform UI and checking the States tab for a new version created moments ago.

Additional Information

  • For more details on upgrading, please review the official guide on Upgrading to Terraform v0.13.
  • To learn more about using the CLI with HCP Terraform or Terraform Enterprise, refer to the tutorials on HashiCorp Learn.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSGH5YK","label":"IBM Terraform Self-Managed"},"ARM Category":[{"code":"a8mgJ0000000DyEQAU","label":"Terraform-\u003ECLI Configuration"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0;1.0.1;1.0.2;1.0.3;1.1.0;1.1.1;1.1.2;1.1.3;1.1.4;1.2.0;1.2.1;1.2.2;2.0.0;2.0.1;2.0.2;2.0.3;2025.03;2025.04;2025.05;2025.06;2025.07"}]

Historical Number

360052933774

Document Information

Modified date:
24 August 2026

UID

ibm17265935