You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ terraform apply targets/dev.out
Acquiring state lock. This may take a few moments...
azurerm_virtual_machine.vm-workers[0]: Creating...
Error: rpc error: code = Unavailable desc = transport is closing
Second run:
$ terraform apply targets/dev.out
Acquiring state lock. This may take a few moments...
azurerm_virtual_machine.vm-workers[0]: Creating...
Error: rpc error: code = Unavailable desc = transport is closing
panic: interface conversion: interface {} is nil, not string
2020-01-14T21:02:38.819-0500 [DEBUG]...
The azurerm provider should have complained about being passed and empty string as the Network Interface ID and behaved as if the provider detected an empty list, like so:
terraform apply targets/dev.out
Acquiring state lock. This may take a few moments...
random_integer.unique-sa-id: Creating...
random_integer.unique-sa-id: Creation complete after 0s [id=9563]
azurerm_virtual_machine.vm-workers[0]: Creating...
Error: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="VirtualMachineMustHaveAtLeastOneNetworkInterface" Message="Virtual machine TEST-VM-1 must have at least one network interface." Details=[]
on virtual-machines.tf line 1, in resource "azurerm_virtual_machine" "vm-workers":
1: resource "azurerm_virtual_machine" "vm-workers" {
Actual Behavior
Because the network_interface_ids argument was [""], the provider produced the panic result.
Steps to Reproduce
In any code to produce an azurerm_virtual_machine resource, set network_interface_ids to the incorrect value [""] then
terraform plan (works okay and states the correct resources)
terraform apply (fails - 1st time with error, 2nd time with panic)
Correct the network IDs and the panic no longer occurs.
Important Factoids
This was bad code (I forgot to pass the correct network ID list) but it should have been caught rather than cause a panic :) .
References
#0000
The text was updated successfully, but these errors were encountered:
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 👉 hashibot-feedback@hashicorp.com. Thanks!
ghost
locked and limited conversation to collaborators
Mar 28, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Terraform (and AzureRM Provider) Version:
Terraform v0.12.19
Affected Resource(s)
azurerm_virtual_machine
Terraform Configuration Files
The line
network_interface_ids = var.vm.network-interfaces
was causing this issue -var.vm.network-interfaces
was set to[""]
in error:Debug Output
First run:
Second run:
Panic Output
An obfuscated log is available here.
Expected Behavior
The azurerm provider should have complained about being passed and empty string as the Network Interface ID and behaved as if the provider detected an empty list, like so:
Actual Behavior
Because the
network_interface_ids
argument was[""]
, the provider produced the panic result.Steps to Reproduce
In any code to produce an
azurerm_virtual_machine
resource, setnetwork_interface_ids
to the incorrect value[""]
thenterraform plan
(works okay and states the correct resources)terraform apply
(fails - 1st time with error, 2nd time with panic)Correct the network IDs and the panic no longer occurs.
Important Factoids
This was bad code (I forgot to pass the correct network ID list) but it should have been caught rather than cause a panic :) .
References
The text was updated successfully, but these errors were encountered: