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

azurerm_container_group will panic with *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing #5304

Closed
TsuyoshiUshio opened this issue Jan 3, 2020 · 2 comments · Fixed by #5415

Comments

@TsuyoshiUshio
Copy link
Contributor

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

1.39

Affected Resource(s)

  • azurerm_container_group

Terraform Configuration Files

resource "azurerm_container_group" "master" {
  name                = "epijmeter-master"
  location            = "${azurerm_resource_group.jmeter_rg.location}"
  resource_group_name = "${azurerm_resource_group.jmeter_rg.name}"

  ip_address_type = "private"
  os_type         = "Linux"

  network_profile_id = "${azurerm_network_profile.example.id}"

  restart_policy = "Never"

  container {
    name   = "jmeter"
    image  = "${var.jmeter_docker_image}"
    cpu    = "4.0"
    memory = "16.0"

    ports {
      port     = 1099
      protocol = "TCP"
    }

    volume {
      name                 = "jmeter"
      mount_path           = "/jmeter"
      read_only            = false
      storage_account_name = "${azurerm_storage_account.example.name}"
      storage_account_key  = "${azurerm_storage_account.example.primary_access_key}"
      share_name           = "${azurerm_storage_share.example.name}"
    }

    commands = [
      "/bin/sh",
      "-c",
      "cd /jmeter; jmeter -n -Jserver.rmi.ssl.disable=true -t DocumentApiMod_addNew.jmx -l test.jtl -e -o report -R ${join(",", "${azurerm_container_group.slaves.*.ip_address}")}",
    ]
  }
  depends_on = [azurerm_storage_account.example, azurerm_storage_share.example]
}

Debug Output

2020/01/03 21:30:45 [ERROR] <root>: eval: *terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing 
2020/01/03 21:30:45 [ERROR] <root>: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing 
2020/01/03 21:30:45 [TRACE] [walkRefresh] Exiting eval tree: azurerm_container_group.master 
2020/01/03 21:30:45 [TRACE] vertex "azurerm_container_group.master": visit complete 
2020/01/03 21:30:45 [TRACE] vertex "azurerm_container_group.master": dynamic subgraph encountered errors 

Panic Output

crash.log

Expected Behavior

execute terraform apply twice, it works fine.

Actual Behavior

execute terraform apply twice, it will panic.

Steps to Reproduce

  1. terraform apply -auto-approve -var 'client_id=$(ARM_CLIENT_ID)' -var 'subscription_id=$(ARM_SUBSCRIPTION_ID)' -var 'client_secret=$(ARM_CLIENT_SECRET)' -var 'tenant_id=$(ARM_TENANT_ID)' -var 'jmeter_docker_image=$(image_name)'

  2. execute the same terraform apply as 1. -> panic

Important Factoids

no

References

The root cause might be this line. According to the log, the response doesn't include IPAddress on property.

https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/internal/services/containers/resource_arm_container_group.go#L581

  • #0000
@rfink
Copy link

rfink commented Jan 21, 2020

So I'm having a pretty similar issue. Running plan -or- apply after container group is created.

Error: rpc error: code = Unavailable desc = transport is closing

Error: rpc error: code = Unavailable desc = transport is closing

Error: rpc error: code = Unavailable desc = transport is closing

Error: panic: runtime error: invalid memory address or nil pointer dereference
2020-01-21T18:06:28.669-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.41.0_x4.exe: [signal 0xc0000005 code=0x0 addr=0x0 pc=0x30a8176]
2020-01-21T18:06:28.669-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.41.0_x4.exe:
2020-01-21T18:06:28.669-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.41.0_x4.exe: goroutine 1155 [running]:
2020-01-21T18:06:28.669-0500 [DEBUG] plugin.terraform-provider-azurerm_v1.41.0_x4.exe: github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/containers.resourceArmContainerGroupRead(0xc0005096c0, 0x397a000, 0xc000b86200, 0x0, 0x0)

Nothing changed between the successful create and the next plan.

Terraform = 0.12.19
AzureRM = 1.41.0

@ghost
Copy link

ghost commented Mar 28, 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 Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants