One module is not usable after upgrading to 0.14

Hello,
I upgraded terraform to 0.14 and with multiple modules everything went smooth except for one module.

When I do init in this module I get:

Error: Invalid legacy provider address

This configuration or its associated state refers to the unqualified provider
“aws”.

You must complete the Terraform 0.13 upgrade process before upgrading to later
versions.

So I downgraded back to 0.13 and I got during terraform plan:

Error: state snapshot was created by Terraform v0.14.2, which is newer than current v0.13.5; upgrade to Terraform v0.14.2 or greater to work with this state

Error: state snapshot was created by Terraform v0.14.2, which is newer than current v0.13.5; upgrade to Terraform v0.14.2 or greater to work with this state

Error: state snapshot was created by Terraform v0.14.2, which is newer than current v0.13.5; upgrade to Terraform v0.14.2 or greater to work with this state

Error: state snapshot was created by Terraform v0.14.2, which is newer than current v0.13.5; upgrade to Terraform v0.14.2 or greater to work with this state

This is kinda schizophrenic situation…
The problem is that this module is main module for all the other modules so I am unable to make changes in our whole infrastructure.

Can somebody help?

Thanks!

You can manually fix this from 0.14 using the terraform state replace-provider command.

Thanks!
That helped me out of this hell!

I’m glad the manual update worked for you!

Just to follow up on what was going on here: given that you saw the error message about state snapshot versions multiple times, I’m guessing that this module is using data "terraform_remote_state" to retrieve outputs from the remote state of some other configurations that you already updated with Terraform v0.14, and so it’s that data source that was failing because the older version of Terraform can’t parse the v0.14 remote state.

It’s unfortunate that Terraform isn’t giving better feedback in that situation, but thankfully this situation will not be with us for much longer because as part of preparing for the Terraform v1.0 release later this year we’ve been able to relax the state checking requirements so that future versions of Terraform will handle state format versioning as a separate idea from Terraform’s own versioning, and the state format will change less often than Terraform itself so that less coordination is needed to navigate a multi-configuration upgrade like this.