Terraform-provider-azurerm: * provider.azurerm: plugin exited before we could connect

Created on 28 Nov 2018  ·  4Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.11.10

  • provider.azurerm v1.19.0

Affected Resource(s)

Terraform Configuration Files

provider "azurerm" {
   subscription_id = "..."
   client_id       = "..." 
   client_secret   = "..."
   tenant_id       = "..."
}
resource "azurerm_resource_group" "myterraformgroup" {
    name     = "myResourceGroup"
    location = "eastus"

    tags {
        environment = "Terraform Demo"
    }
}

Debug Output

https://gist.github.com/LarsLarsLars/d2799cb2761c8a9452c66cd3912b552f

Panic Output

Expected Behavior

terraform plan should generate a preview of the changes to apply

Actual Behavior

Error: Error asking for user input: 1 error(s) occurred:

  • provider.azurerm: plugin exited before we could connect

Steps to Reproduce

  1. terraform init
  2. terraform plan

Important Factoids

  1. logging in with the same credentials with az login --service-principal -u -p --tenant works well
  2. terraform init completes with no errors
  3. the service account has a contributor role on the subscription
  4. the service account has Windows Azure Service Management API and Windows Azure Active Directory permissions

References

  • #0000
question

All 4 comments

hi @LarsLarsLars

Thanks for opening this issue :)

Terraform (Core) and it's Providers run in separate processes that communicate via RPC - as such both processes require permission to bind ports. Taking a look into the error you're seeing:

2018-11-28T14:22:30.399-0500 [ERROR] plugin.terraform-provider-azurerm_v1.19.0_x4.exe: plugin init error: timestamp=2018-11-28T14:22:30.374-0500 error="Couldn't bind plugin TCP listener"

It appears that whilst Terraform can open/bind a port - the AzureRM plugin can't, as such Terraform's unable to interact with the AzureRM plugin which is why you're seeing this error.

Out of interest are you running in a locked-down environment where binaries need to be approved prior to running? If so, the AzureRM provider will also need to be added to this list.

Thanks!

Thanks for your fast answer Tom!

Allowing the AzureRM plugin ( ...\plugins\windows_amd64\terraform-provider-azurerm_v1.19.0_x4.exe) in the firewall solved it.

Glad to hear this is now working for you @LarsLarsLars :)

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!

Was this page helpful?
0 / 5 - 0 ratings