`Error: Failed to install providers` for New Relic provider

I am using a parent (aka root) and child module that utilize New Relic provider, and I’ve used it successfully before without the below error. However, now when I revisit it to to work with it, I do get this error and suggestion upon terraform init:

z@Mac-Users-Apple-Computer terraform % terraform init
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Using previously-installed newrelic/newrelic v2.21.1
- Finding latest version of hashicorp/newrelic...

Error: Failed to install providers

Could not find required providers, but found possible alternatives:

  hashicorp/newrelic -> terraform-providers/newrelic

If these suggestions look correct, upgrade your configuration with the
following commands:
    terraform 0.13upgrade modules/terraform-nr-alerting
    terraform 0.13upgrade modules/terraform-nr-dashboarding

The above two commands do not appear to be the right move, since the doc for New Relic indicates the new relic provider source is newrelic/newrelic, if I understand correctly.

Just wondering why this is happening now when it didn’t before, and also what I should do to correctly remediate it, if it isn’t the above two commands.

Hi @aaa,

Terraform is suggesting terraform-providers/newrelic here as the safe option because it matches what Terraform v0.12 would’ve installed.

However, since you know that newrelic/newrelic is a valid new home for that provider, you could run the two upgrade commands suggested and then review what it changed and update it to be newrelic/newrelic before you commit the result. (Those terraform 0.13upgrade ... will just add required_providers blocks to your modules locally, so you’ll get an opportunity to review what it did before committing anything.)

1 Like

@apparentlymart thank you! Just letting you know I plan to take a crack at this, I just have a lot on of things I’ve been working on in general. I look forward to tweaking things around and seeing what happens.