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

Resource network_interface, subnet hangs in loop on "Still creating..." #2758

Closed
epcim opened this issue Jan 24, 2019 · 3 comments
Closed

Resource network_interface, subnet hangs in loop on "Still creating..." #2758

epcim opened this issue Jan 24, 2019 · 3 comments

Comments

@epcim
Copy link

epcim commented Jan 24, 2019

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

Description

I am running terrafom code that creats VM with 3 NIC and 3 subnet resources in Azure. We challenge a strange behaviour where ~3th run ends up in a loop on "azurerm_subnet.acme_subnet_public: Still creating.". Workaround and possible issues describe below. Actuall final logs ends with:

...
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (9m49s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (9m49s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (9m59s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (9m59s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10m9s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10m9s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10m19s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10m19s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10m29s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10m29s elapsed)
...

Workaround/Finding

Our investigation showed that it sucesfully passes when compute_nic_private is created early before acme_subnet_public (second subnet) gets in creation state. The reason might be updating network resource. Therefore we introduced delay (a sleep for 30 seconds) to be run on each resource as well as proper dependencies between terraform resources.

Related question:

  • Can private interface and network modification can be done in parallel?
  • Why terraforme azure provider does not enforece correct order?

Terraform (and AzureRM Provider) Version

  • terraform 0.11.11
  • issue identified with latest stable azurerm v1.21.0 as well as with master (rev: f398858) and a version 4months old
  • azure-cli==2.0.55
 terraform -v
2019/01/24 18:56:11 [INFO] Terraform version: 0.11.11  ac4fff416318bf0915a0ab80e062a99ef3724334
2019/01/24 18:56:11 [INFO] Go runtime version: go1.11.1
2019/01/24 18:56:11 [INFO] CLI args: []string{"/go/bin/terraform", "-v"}
2019/01/24 18:56:11 [DEBUG] Attempting to open CLI config file: /root/.terraformrc
2019/01/24 18:56:11 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/01/24 18:56:11 [INFO] CLI command args: []string{"version", "-v"}
Terraform v0.11.11
2019/01/24 18:56:11 [DEBUG] checking for provider in "."
2019/01/24 18:56:11 [DEBUG] checking for provider in "/go/bin"
2019/01/24 18:56:11 [WARN] found legacy provider "terraform-provider-azurerm"
2019/01/24 18:56:11 [WARN] found legacy provider "terraform-provider-local"
2019/01/24 18:56:11 [WARN] found legacy provider "terraform-provider-null"
2019/01/24 18:56:11 [WARN] found legacy provider "terraform-provider-random"
2019/01/24 18:56:11 [WARN] found legacy provider "terraform-provider-template"
2019/01/24 18:56:11 [WARN] found legacy provider "terraform-provider-tls"
2019/01/24 18:56:11 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/01/24 18:56:11 [DEBUG] found valid plugin: "local", "0.0.0", "/go/bin/terraform-provider-local"
2019/01/24 18:56:11 [DEBUG] found valid plugin: "null", "0.0.0", "/go/bin/terraform-provider-null"
2019/01/24 18:56:11 [DEBUG] found valid plugin: "random", "0.0.0", "/go/bin/terraform-provider-random"
2019/01/24 18:56:11 [DEBUG] found valid plugin: "template", "0.0.0", "/go/bin/terraform-provider-template"
2019/01/24 18:56:11 [DEBUG] found valid plugin: "tls", "0.0.0", "/go/bin/terraform-provider-tls"
2019/01/24 18:56:11 [DEBUG] found valid plugin: "azurerm", "0.0.0", "/go/bin/terraform-provider-azurerm"
2019/01/24 18:56:12 [DEBUG] plugin: waiting for all plugin processes to complete...
+ provider.azurerm (unversioned)
+ provider.local (unversioned)
+ provider.null (unversioned)
+ provider.random (unversioned)
+ provider.template (unversioned)
+ provider.tls (unversioned)

Affected Resource(s)

  • azurerm_network_interface
  • azurerm_subnet

Terraform Configuration Files

Corresponding parts of the TF template:

Note: sleep 0.1s leads to an issue (in my case on every ~3rd deployment), with sleep set to 30 (second) the deployment succeeds.

...
resource "null_resource" "delay_dns_zone" {
  provisioner "local-exec" {
    command = "sleep 0.1"
  }

  triggers = {
    "before" = "${azurerm_virtual_network.acme_net.id}"
  }
}

resource "azurerm_dns_zone" "acme_zone" {
  name                           = "${var.dns_zone_name == "" ? join(".", list(var.deployment, "int.acme.us")) : var.dns_zone_name}"
  resource_group_name            = "${var.resource_group}"
  resolution_virtual_network_ids = ["${azurerm_virtual_network.acme_net.id}" ]
  zone_type                      = "Private"
  depends_on                     = ["null_resource.delay_dns_zone"]
}

resource "azurerm_subnet" "acme_subnet_private" {
  name                      = "subnet-${replace(replace(var.fabric_subnet_private, "/", "-"), ".", "-")}"
  virtual_network_name      = "${azurerm_virtual_network.acme_net.name}"
  resource_group_name       = "${var.resource_group}"
  address_prefix            = "${var.fabric_subnet_private}"
  network_security_group_id = "${azurerm_network_security_group.acme_security_group.id}"
  route_table_id            = "${azurerm_route_table.fabric_route_table.id}"
}

resource "null_resource" "delay_subnet_public" {
  provisioner "local-exec" {
    command = "sleep 0.1"
  }

  triggers = {
    "before" = "${azurerm_subnet.acme_subnet_private.id}"
  }
}

resource "azurerm_subnet" "acme_subnet_public" {
  name                      = "subnet-${replace(replace(var.fabric_subnet_public, "/", "-"), ".", "-")}"
  virtual_network_name      = "${azurerm_virtual_network.acme_net.name}"
  resource_group_name       = "${var.resource_group}"
  address_prefix            = "${var.fabric_subnet_public}"
  network_security_group_id = "${azurerm_network_security_group.acme_security_group.id}"
  depends_on                = ["null_resource.delay_subnet_public"]
}

resource "null_resource" "delay_subnet_management" {
  provisioner "local-exec" {
    command = "sleep 0.1"
  }

  triggers = {
    "before" = "${azurerm_subnet.acme_subnet_public.id}"
  }
}

resource "azurerm_subnet" "acme_subnet_management" {
  name                      = "subnet-${replace(replace(var.fabric_subnet_management, "/", "-"), ".", "-")}"
  virtual_network_name      = "${azurerm_virtual_network.acme_net.name}"
  resource_group_name       = "${var.resource_group}"
  address_prefix            = "${var.fabric_subnet_management}"
  network_security_group_id = "${azurerm_network_security_group.acme_security_group.id}"
  depends_on                = ["null_resource.delay_subnet_management"]
}

...
...

resource "azurerm_virtual_network_peering" "peer_egress" {
  count                        = "${var.fabric_peering_network_id == "" ? 0 : 1}"
  name                         = "peer-global"
  resource_group_name          = "${var.resource_group}"
  virtual_network_name         = "${azurerm_virtual_network.acme_net.name}"
  remote_virtual_network_id    = "${var.fabric_peering_network_id}"
  allow_virtual_network_access = true
  allow_forwarded_traffic      = false
  allow_gateway_transit        = false
  depends_on                   = ["azurerm_subnet.acme_subnet_management"]
}

resource "azurerm_virtual_network_peering" "peer_ingress" {
  count                        = "${var.fabric_peering_network_id == "" ? 0 : 1}"
  name                         = "peer-${replace(replace(var.fabric_address_pool, "/", "-"), ".", "-")}"
  resource_group_name          = "${element(split("/", var.fabric_peering_network_id), 4)}"
  virtual_network_name         = "${element(split("/", var.fabric_peering_network_id), 8)}"
  remote_virtual_network_id    = "${azurerm_virtual_network.acme_net.id}"
  allow_virtual_network_access = true
  allow_forwarded_traffic      = false
  allow_gateway_transit        = false
  use_remote_gateways          = false
  depends_on                   = ["azurerm_virtual_network_peering.peer_egress"]
}

resource "azurerm_route_table" "fabric_route_table" {
  name                          = "fabric-route-table"
  location                      = "${var.region}"
  resource_group_name           = "${var.resource_group}"
  disable_bgp_route_propagation = false

  route {
    name                   = "fabric-re"
    address_prefix         = "192.128.0.0/16"
    next_hop_type          = "VirtualAppliance"
    next_hop_in_ip_address = "${element(split(".", var.fabric_subnet_private), 0)}.${element(split(".", var.fabric_subnet_private), 1)}.${element(split(".", var.fabric_subnet_private), 2)}.50"
  }

  route {
    name                   = "fabric-ce"
    address_prefix         = "172.16.0.0/16"
    next_hop_type          = "VirtualAppliance"
    next_hop_in_ip_address = "${element(split(".", var.fabric_subnet_private), 0)}.${element(split(".", var.fabric_subnet_private), 1)}.${element(split(".", var.fabric_subnet_private), 2)}.50"
  }
}

...
...

Debug Output

...
...
O2019-01-24T14:47:04.726Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [INFO] preparing arguments for AzureRM Network Interface creation.
2019-01-24T14:47:04.726Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [DEBUG] Locking "azurerm_network_interface.machine-master-0-private"
2019-01-24T14:47:04.726Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [DEBUG] Locked "azurerm_network_interface.machine-master-0-private"
2019-01-24T14:47:04.726Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [DEBUG] Locking "azurerm_network_security_group.security-group"
  triggers.before: "" => "/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/resourceGroups/user-test-005/providers/Microsoft.Network/virtualNetworks/network/subnets/subnet-192-168-40-0-24"
module.re_network.null_resource.delay_subnet_public: Provisioning with 'local-exec'...
module.re_master_primary.azurerm_network_interface.compute_nic_private: Creating...
  applied_dns_servers.#:                                              "" => "<computed>"
  dns_servers.#:                                                      "" => "<computed>"
  enable_accelerated_networking:                                      "" => "true"
  enable_ip_forwarding:                                               "" => "true"
  internal_dns_name_label:                                            "" => "<computed>"
  internal_fqdn:                                                      "" => "<computed>"
  ip_configuration.#:                                                 "" => "1"
  ip_configuration.0.application_gateway_backend_address_pools_ids.#: "" => "<computed>"
  ip_configuration.0.application_security_group_ids.#:                "" => "<computed>"
  ip_configuration.0.load_balancer_backend_address_pools_ids.#:       "" => "<computed>"
  ip_configuration.0.load_balancer_inbound_nat_rules_ids.#:           "" => "<computed>"
  ip_configuration.0.name:                                            "" => "balancer"
  ip_configuration.0.primary:                                         "" => "<computed>"
  ip_configuration.0.private_ip_address:                              "" => "192.168.40.50"
  ip_configuration.0.private_ip_address_allocation:                   "" => "static"
  ip_configuration.0.private_ip_address_version:                      "" => "IPv4"
  ip_configuration.0.subnet_id:                                       "" => "/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/resourceGroups/user-test-005/providers/Microsoft.Network/virtualNetworks/network/subnets/subnet-192-168-40-0-24"
  location:                                                           "" => "eastus"
  mac_address:                                                        "" => "<computed>"
  name:                                                               "" => "machine-master-0-private"
  network_security_group_id:                                          "" => "/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/resourceGroups/user-test-005/providers/Microsoft.Network/networkSecurityGroups/security-group"
  private_ip_address:                                                 "" => "<computed>"
  private_ip_addresses.#:                                             "" => "<computed>"
  resource_group_name:                                                "" => "user-test-005"
  tags.%:                                                             "" => "<computed>"
  virtual_machine_id:                                                 "" => "<computed>"
module.re_network.null_resource.delay_subnet_public (local-exec): Executing: ["/bin/sh" "-c" "sleep 0.1"]
module.re_network.null_resource.delay_subnet_public: Creation complete after 0s (ID: 5585367407342397238)
2019-01-24T14:47:04.844Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [INFO] preparing arguments for Azure ARM Subnet creation.
2019-01-24T14:47:04.844Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [DEBUG] Locking "azurerm_virtual_network.network"
2019-01-24T14:47:04.844Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [DEBUG] Locked "azurerm_virtual_network.network"
2019-01-24T14:47:04.844Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:04 [DEBUG] Locking "azurerm_network_security_group.security-group"
module.re_network.azurerm_subnet.acme_subnet_public: Creating...
  address_prefix:            "" => "192.168.41.0/24"
  ip_configurations.#:       "" => "<computed>"
  name:                      "" => "subnet-192-168-41-0-24"
  network_security_group_id: "" => "/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/resourceGroups/user-test-005/providers/Microsoft.Network/networkSecurityGroups/security-group"
  resource_group_name:       "" => "user-test-005"
  virtual_network_name:      "" => "network"
2019-01-24T14:47:05.311Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:05 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/resourceGroups/user-test-005/providers/Microsoft.Network/networkSecurityGroups/security-group/securityRules/access?api-version=2018-08-01:
2019-01-24T14:47:05.311Z [DEBUG] plugin.terraform-provider-azurerm: HTTP/1.1 201 Created
2019-01-24T14:47:05.311Z [DEBUG] plugin.terraform-provider-azurerm: Content-Length: 765
2019-01-24T14:47:05.311Z [DEBUG] plugin.terraform-provider-azurerm: Azure-Asyncoperation: https://management.azure.com/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/providers/Microsoft.Network/locations/eastus/operations/83832476-91bb-4697-9d2c-eb3b93d4e930?api-version=2018-08-01
2019-01-24T14:47:05.311Z [DEBUG] plugin.terraform-provider-azurerm: Cache-Control: no-cache
2019-01-24T14:47:05.311Z [DEBUG] plugin.terraform-provider-azurerm: Content-Type: application/json; charset=utf-8
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Date: Thu, 24 Jan 2019 14:47:04 GMT
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Expires: -1
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Pragma: no-cache
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Retry-After: 10
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Server: Microsoft-HTTPAPI/2.0
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Server: Microsoft-HTTPAPI/2.0
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: Strict-Transport-Security: max-age=31536000; includeSubDomains
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: X-Content-Type-Options: nosniff
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Correlation-Request-Id: 1aa49a4b-2522-4028-88f3-3fe067fdb9d9
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Ratelimit-Remaining-Subscription-Writes: 1197
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Request-Id: 83832476-91bb-4697-9d2c-eb3b93d4e930
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Routing-Request-Id: WESTEUROPE:20190124T144705Z:1aa49a4b-2522-4028-88f3-3fe067fdb9d9
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: 
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm: {
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:   "name": "access",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:   "id": "/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/resourceGroups/user-test-005/providers/Microsoft.Network/networkSecurityGroups/security-group/securityRules/access",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:   "etag": "W/\"b2bbc923-a40b-4ea3-8c83-e0cfa116a424\"",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:   "type": "Microsoft.Network/networkSecurityGroups/securityRules",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:   "properties": {
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:     "provisioningState": "Updating",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:     "protocol": "Tcp",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:     "sourcePortRange": "*",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:     "destinationPortRange": "22",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:     "sourceAddressPrefix": "*",
2019-01-24T14:47:05.312Z [DEBUG] plugin.terraform-provider-azurerm:     "destinationAddressPrefix": "*",
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "access": "Allow",
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "priority": 100,
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "direction": "Inbound",
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "sourcePortRanges": [],
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "destinationPortRanges": [],
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "sourceAddressPrefixes": [],
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:     "destinationAddressPrefixes": []
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm:   }
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: }
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:05 [DEBUG] AzureRM Request:
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: GET /subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/providers/Microsoft.Network/locations/eastus/operations/83832476-91bb-4697-9d2c-eb3b93d4e930?api-version=2018-08-01 HTTP/1.1
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: Host: management.azure.com
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: User-Agent: Go/go1.10.8 (amd64-linux) go-autorest/v11.3.2 Azure-SDK-For-Go/v24.0.0 network/2018-08-01 Terraform/0.11.9 terraform-provider-azurerm/dev
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: Accept-Encoding: gzip
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: 
2019-01-24T14:47:05.313Z [DEBUG] plugin.terraform-provider-azurerm: 
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: 2019/01/24 14:47:05 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions/f68xxxxxxxxxxxxxxxxxxxxxxxxcb0a1/providers/Microsoft.Network/locations/eastus/operations/83832476-91bb-4697-9d2c-eb3b93d4e930?api-version=2018-08-01:
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: HTTP/1.1 200 OK
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Transfer-Encoding: chunked
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Cache-Control: no-cache
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Content-Type: application/json; charset=utf-8
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Date: Thu, 24 Jan 2019 14:47:05 GMT
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Expires: -1
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Pragma: no-cache
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Retry-After: 10
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Server: Microsoft-HTTPAPI/2.0
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Server: Microsoft-HTTPAPI/2.0
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Strict-Transport-Security: max-age=31536000; includeSubDomains
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: Vary: Accept-Encoding
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: X-Content-Type-Options: nosniff
2019-01-24T14:47:05.448Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Correlation-Request-Id: 2f309e55-4517-46f3-b292-c289cd0659b1
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Ratelimit-Remaining-Subscription-Reads: 11990
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Request-Id: 567fcf2b-9eb4-4834-aca4-6386511bada9
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: X-Ms-Routing-Request-Id: WESTEUROPE:20190124T144705Z:2f309e55-4517-46f3-b292-c289cd0659b1
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: 
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: 1e
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: {
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm:   "status": "InProgress"
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: }
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: 0
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: 
2019-01-24T14:47:05.449Z [DEBUG] plugin.terraform-provider-azurerm: 
module.re_network.azurerm_network_security_rule.security_rule_access: Still creating... (30s elapsed)
module.re_network.azurerm_network_security_rule.security_rule_ver: Still creating... (30s elapsed)
module.re_network.azurerm_network_security_rule.security_rule_http_request: Still creating... (30s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10s elapsed)
...
...

For testing consistency I am using this container:

FROM golang:1.10-alpine

ENV GOPATH=/go

ARG PROVIDER_AZURERM_VERSION="v1.21.0"
ENV PROVIDER_AZURERM_VERSION $PROVIDER_AZURERM_VERSION
ARG TERRAFORM_VERSION="0.11.11"
ENV TERRAFORM_VERSION $TERRAFORM_VERSION

ARG TF_LOG="DEBUG"
ENV TF_LOG $TF_LOG
ARG AZURE_GO_SDK_LOG_LEVEL="LogDebug"
ENV AZURE_GO_SDK_LOG_LEVEL $AZURE_GO_SDK_LOG_LEVEL
ARG AZURE_SDK_TRACING_ENABLED="true"
ENV AZURE_SDK_TRACING_ENABLED $AZURE_SDK_TRACING_ENABLED

# Install build dependencies
RUN apk add --update git wget openssh unzip curl

# Install Azure CLI
RUN apk update && \
    apk add bash py-pip && \
    apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python-dev make && \
    pip install --upgrade pip && \
    pip install azure-cli==2.0.55 && \
    apk del --purge build

# Install Azure provider
RUN mkdir -p /go/src/github.com/terraform-providers && \
    git clone --depth 1 -b $PROVIDER_AZURERM_VERSION https://github.com/terraform-providers/terraform-provider-azurerm.git /go/src/github.com/terraform-providers/terraform-provider-azurerm
 && \
    cd /go/src/github.com/terraform-providers/terraform-provider-azurerm && go build && go install && \
    rm -rf /go/src/github.com/terraform-providers/terraform-provider-azurerm

# Install Terraform
RUN wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
    unzip terraform_*.zip -d /go/bin/ && \
    rm -f terraform_*.zip

RUN go get github.com/terraform-providers/terraform-provider-random && \
    go get github.com/terraform-providers/terraform-provider-template && \
    go get github.com/terraform-providers/terraform-provider-local && \
    go get github.com/terraform-providers/terraform-provider-null && \
    go get github.com/terraform-providers/terraform-provider-tls

Usage (depends on actuall container used), but for example:

docker run --rm -ti -v $PWD:/v --entrypoint "sh" 

cd /v
export AZURE_GO_SDK_LOG_LEVEL=LogDebug AZURE_SDK_TRACING_ENABLED=true TF_LOG=DEBUG  TF_LOG_PATH=/v
terraform apply -var-file inputvars.json

Expected Behavior

  • Create requested resources, possibly without dependencie set or workarounded.
  • Timeout & exit on failures.
  • Obviously check to test resource created shall have stage to test resource is in progress or recognize that "create" request failed.

Actual Behavior

Forever hangs on:

...
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (9m49s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (9m49s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (9m59s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (9m59s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10m9s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10m9s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10m19s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10m19s elapsed)
module.re_master_primary.azurerm_network_interface.compute_nic_private: Still creating... (10m29s elapsed)
module.re_network.azurerm_subnet.acme_subnet_public: Still creating... (10m29s elapsed)
...

Steps to Reproduce

Above

References

  • #0000
@epcim
Copy link
Author

epcim commented Feb 5, 2019

We came with a workaround where we set a dependency and a "wait" on each problematic resource. an example

resource "null_resource" "delay_subnet_public" {
  provisioner "local-exec" {
    command = "sleep 30"
  }

  triggers = {
    "before" = "${azurerm_subnet.acme_subnet_private.id}"
  }
}

@tombuildsstuff
Copy link
Contributor

hey @epcim

Thanks for opening this issue - apologies for the delayed response here!

Taking a look into this I believe this issue is a duplicate of #2489 which was fixed via #3673 and shipped in v1.33.1 of the Azure Provider - would you be able to upgrade to that version of the Provider and see if this works for you?

Since I believe upgrading to the latest version of the Azure Provider should fix this issue I'm going to close this issue for the moment - however please let us know if that doesn't work for you and we'll take another look.

Thanks!

@ghost
Copy link

ghost commented Oct 2, 2019

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 Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants