Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using features {} with azurerm provisioner < v2.0 causes crash. #5897

Closed
ghost opened this issue Feb 25, 2020 · 6 comments
Closed

Using features {} with azurerm provisioner < v2.0 causes crash. #5897

ghost opened this issue Feb 25, 2020 · 6 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 25, 2020

This issue was originally opened by @azilber as hashicorp/terraform#24211. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.12.20
+ provider.azurerm v1.44.0
+ provider.template v2.1.2

Terraform Configuration Files

provider "azurerm" {
    version = "~> 1.44.0"
    subscription_id = var.subscription_id
   features {}
}

Crash Output

Crash Snippet 2020/02/25 22:47:07 [ERROR] module.portal0: eval: *terraform.EvalConfigProvider, err: rpc error: code = Unavailable desc = transport is closing 2020/02/25 22:47:07 [ERROR] module.portal0: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing 2020/02/25 22:47:07 [ERROR] module.portal0: eval: *terraform.EvalOpFilter, err: rpc error: code = Unavailable desc = transport is closing 2020/02/25 22:47:07 [ERROR] module.portal0: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing 2020/02/25 22:47:07 [TRACE] [walkRefresh] Exiting eval tree: module.portal0.provider.azurerm 2020/02/25 22:47:07 [TRACE] vertex "module.portal0.provider.azurerm": visit complete 2020/02/25 22:47:07 [TRACE] dag/walk: upstream of "module.portal0.data.azurerm_image.custom" errored, so skipping 2020/02/25 22:47:07 [TRACE] dag/walk: upstream of "module.portal0.data.azurerm_subnet.main" errored, so skipping 2020/02/25 22:47:07 [TRACE] dag/walk: upstream of "module.portal0.provider.azurerm (close)" errored, so skipping 2020/02/25 22:47:07 [TRACE] dag/walk: upstream of "root" errored, so skipping 2020-02-25T22:47:07.197+0800 [DEBUG] plugin: plugin exited

Expected Behavior

"An execution plan has been generated and is shown below."

Actual Behavior

Crash

Steps to Reproduce

  1. terraform init
  2. terraform plan

Additional Context

The features {} block is an azurerm v2.0 feature. I had accidently left it in the provider section. Terraform misses this, and passes it along to the azurerm provider which causes it to crash.
Terraform should be catching this and throwing an error.

@vermaaakansha
Copy link

I'm having same issue. #5965 , Can someone help in looking at this issue. thanks.

@Avani129

This comment has been minimized.

@tombuildsstuff

This comment has been minimized.

@Avani129
Copy link

Avani129 commented Apr 1, 2020

@Avani129 your issue is unrelated to this one, where it appears you've got multiple provider instances being used (intentionally or not - which is why this field is now required, to highlight this). If you're using this within a module you'll need to thread the Provider into the module - more information can be found here)

I didn't created them wantedly. But can you please explain how to reduce them to one instance.

@tombuildsstuff
Copy link
Contributor

👋 hey folks

Since the 2.x versions of the Azure Provider don't support Terraform 0.10/11 - as we have no plans to release further updates to the 1.x versions of the Azure Provider, unfortunately this isn't something we plan to patch.

That said - it should be possible to work around this in one of two ways:

  1. (to fix the immediate crash) remove the features {} block when using a 1.x version of the Azure Provider
  2. Upgrade to Terraform 0.12 and v2.x of the Azure Provider (v2.6 is the latest at the time of writing) - and add in the features {} block at which point this should work as normal

We'd recommend updating to Terraform 0.12 if possible - as mentioned above at this point in time our efforts are now focused on the latest version rather than Terraform 0.10/0.11 - however these older versions should continue working unless Azure changes the way the API works (as is the case with AKS).

Since this should be fixed by updating I'm going to close this issue for the moment - however please let us know if you're still having issues after updating and we'll take another look

Thanks!


@Avani129 Providers need to be specified in the root module and then threaded through, there's an example of how to do that here: https://www.terraform.io/docs/configuration/providers.html#selecting-alternate-providers :)

@ghost
Copy link
Author

ghost commented May 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants