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

terraform crash #11625

Closed
guoshimin opened this issue Feb 2, 2017 · 6 comments
Closed

terraform crash #11625

guoshimin opened this issue Feb 2, 2017 · 6 comments

Comments

@guoshimin
Copy link

Terraform Version

v0.8.5

Affected Resource(s)

Various. See crash log.

Terraform Configuration Files

See crash log.

Debug Output

Panic Output

https://gist.github.com/guoshimin/1e1a35ee9c768778b9bd7e388d6a5171

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

It happens sporadically.

@guoshimin
Copy link
Author

Update: Now I can reproduce it if I save the plan and apply the plan. The plan has my client secret so I can't share it.

Crash log: https://gist.github.com/guoshimin/4c66cc57c9f40da931709d001781b6a6

@guoshimin
Copy link
Author

My terraform config:

{
   "provider": {
      "azurerm": {
         "client_id": "[REDACTED]",
         "client_secret": "[REDACTED]",
         "subscription_id": "[REDACTED]",
         "tenant_id": "[REDACTED]"
      }
   },
   "resource": {
      "azurerm_availability_set": {
         "master": {
            "location": "westus",
            "name": "master",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb": {
         "master_lb": {
            "frontend_ip_configuration": {
               "name": "master-lb-ipconfig",
               "public_ip_address_id": "${azurerm_public_ip.master.id}"
            },
            "location": "westus",
            "name": "master-lb",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_backend_address_pool": {
         "master_pool": {
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "master-pool",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_nat_rule": {
         "ssh": {
            "backend_port": 22,
            "frontend_ip_configuration_name": "master-lb-ipconfig",
            "frontend_port": 22,
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "master-ssh",
            "protocol": "Tcp",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_probe": {
         "https_probe": {
            "interval_in_seconds": 5,
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "https-probe",
            "number_of_probes": 2,
            "port": 443,
            "protocol": "Tcp",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_lb_rule": {
         "https": {
            "backend_address_pool_id": "${azurerm_lb_backend_address_pool.master_pool.id}",
            "backend_port": 443,
            "enable_floating_ip": false,
            "frontend_ip_configuration_name": "master-lb-ipconfig",
            "frontend_port": 443,
            "idle_timeout_in_minutes": 5,
            "load_distribution": "Default",
            "loadbalancer_id": "${azurerm_lb.master_lb.id}",
            "location": "westus",
            "name": "https",
            "probe_id": "${azurerm_lb_probe.https_probe.id}",
            "protocol": "Tcp",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_network_interface": {
         "master_nic": {
            "enable_ip_forwarding": true,
            "ip_configuration": [
               {
                  "load_balancer_backend_address_pools_ids": [
                     "${azurerm_lb_backend_address_pool.master_pool.id}"
                  ],
                  "load_balancer_inbound_nat_rules_ids": [
                     "${azurerm_lb_nat_rule.ssh.id}"
                  ],
                  "name": "ipconfig1",
                  "private_ip_address": "10.120.255.5",
                  "private_ip_address_allocation": "Static",
                  "subnet_id": "${azurerm_subnet.kube-subnet.id}"
               }
            ],
            "location": "westus",
            "name": "masternic",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_network_security_group": {
         "kube_nsg": {
            "location": "westus",
            "name": "kube_nsg",
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "security_rule": [
               {
                  "access": "Allow",
                  "description": "Allow SSH traffic to master",
                  "destination_address_prefix": "*",
                  "destination_port_range": "22-22",
                  "direction": "Inbound",
                  "name": "allow_ssh",
                  "priority": 101,
                  "protocol": "Tcp",
                  "source_address_prefix": "*",
                  "source_port_range": "*"
               },
               {
                  "access": "Allow",
                  "description": "Allow kube-apiserver (tls) traffic to master",
                  "destination_address_prefix": "*",
                  "destination_port_range": "443-443",
                  "direction": "Inbound",
                  "name": "allow_kube_tls",
                  "priority": 100,
                  "protocol": "Tcp",
                  "source_address_prefix": "*",
                  "source_port_range": "*"
               }
            ]
         }
      },
      "azurerm_public_ip": {
         "master": {
            "domain_name_label": "monkey",
            "location": "westus",
            "name": "master",
            "public_ip_address_allocation": "Dynamic",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_resource_group": {
         "kube": {
            "location": "westus",
            "name": "kube"
         }
      },
      "azurerm_route_table": {
         "kube-routetable": {
            "location": "westus",
            "name": "kube-routetable",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_storage_account": {
         "kube_storage": {
            "account_type": "Standard_LRS",
            "location": "westus",
            "name": "databrickskubestorage",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      },
      "azurerm_storage_container": {
         "vhds": {
            "container_access_type": "private",
            "name": "vhds",
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "storage_account_name": "${azurerm_storage_account.kube_storage.name}"
         }
      },
      "azurerm_subnet": {
         "kube-subnet": {
            "address_prefix": "10.120.0.0/16",
            "name": "kube-subnet",
            "network_security_group_id": "${azurerm_network_security_group.kube_nsg.id}",
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "route_table_id": "${azurerm_route_table.kube-routetable.id}",
            "virtual_network_name": "${azurerm_virtual_network.kube_vn.name}"
         }
      },
      "azurerm_virtual_machine": {
         "master": {
            "availability_set_id": "${azurerm_availability_set.master.id}",
            "boot_diagnostics": {
               "enabled": true,
               "storage_uri": "${azurerm_storage_account.kube_storage.primary_blob_endpoint}"
            },
            "location": "westus",
            "name": "master",
            "network_interface_ids": [
               "${azurerm_network_interface.master_nic.id}"
            ],
            "os_profile": {
               "admin_password": "",
               "admin_username": "azureuser",
               "computer_name": "kube-master",
               "custom_data": "ewogICJpZ25pdGlvbiI6IHsKICAgICJ2ZXJzaW9uIjogIjIuMC4wIiwKICAgICJjb25maWciOiB7fQogIH0sCiAgInN0b3JhZ2UiOiB7fSwKICAic3lzdGVtZCI6IHsKICAgICJ1bml0cyI6IFsKICAgICAgewogICAgICAgICJuYW1lIjogInNzaGQuc29ja2V0IiwKICAgICAgICAiZW5hYmxlIjogdHJ1ZQogICAgICB9CiAgICBdCiAgfSwKICAibmV0d29ya2QiOiB7fSwKICAicGFzc3dkIjoge30KfQo="
            },
            "os_profile_linux_config": {
               "disable_password_authentication": true,
               "ssh_keys": [
                  {
                     "key_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPu+iRIN+Uk5vls+BuTn8FtUgWopvoQ8KdicT3VBFoc0A0m+h71DsfEDYjsAGfY83YF7wWj2O+B38c3CaIs8fx0lagg1Ir+kUrgas2P28mlblfeX/ZPDPytp5euEWlHDePOwpSa4dO4tq2efWkDJMC2HPLyj5BEeTc6OOCZWMbk711tzFrVcYGEw1jhkknMFGkdHNpl+KsPImm6AoGMJFDkpPAc96fDaotgtHIHiMeMZ5smAmAet6EgCwa/WJ0+ZYds+ne+FhIP7vxmqZ6qZlj1tFrMEqvl4b68G6QDGQrzx3zTZTvLZiyOrSpPRdqz78Pnk1SZgknAd87dIVKpjF9 admin2@Spares-MacBook-Pro.local",
                     "path": "/home/azureuser/.ssh/authorized_keys"
                  }
               ]
            },
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "storage_image_reference": {
               "offer": "CoreOS",
               "publisher": "CoreOS",
               "sku": "Stable",
               "version": "1235.8.0"
            },
            "storage_os_disk": {
               "create_option": "FromImage",
               "name": "master-osdisk",
               "vhd_uri": "${azurerm_storage_account.kube_storage.primary_blob_endpoint}${azurerm_storage_container.vhds.name}/master-osdisk1.vhd"
            },
            "vm_size": "Standard_D2_v2"
         }
      },
      "azurerm_virtual_machine_scale_set": {
         "agentpool": {
            "location": "westus",
            "name": "agentpool",
            "network_profile": {
               "ip_configuration": {
                  "name": "ipconfig",
                  "subnet_id": "${azurerm_subnet.kube-subnet.id}"
               },
               "name": "agent-network-profile",
               "primary": true
            },
            "os_profile": {
               "admin_password": "",
               "admin_username": "azureuser",
               "computer_name_prefix": "k8s-agent-"
            },
            "os_profile_linux_config": {
               "disable_password_authentication": true,
               "ssh_keys": [
                  {
                     "key_data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPu+iRIN+Uk5vls+BuTn8FtUgWopvoQ8KdicT3VBFoc0A0m+h71DsfEDYjsAGfY83YF7wWj2O+B38c3CaIs8fx0lagg1Ir+kUrgas2P28mlblfeX/ZPDPytp5euEWlHDePOwpSa4dO4tq2efWkDJMC2HPLyj5BEeTc6OOCZWMbk711tzFrVcYGEw1jhkknMFGkdHNpl+KsPImm6AoGMJFDkpPAc96fDaotgtHIHiMeMZ5smAmAet6EgCwa/WJ0+ZYds+ne+FhIP7vxmqZ6qZlj1tFrMEqvl4b68G6QDGQrzx3zTZTvLZiyOrSpPRdqz78Pnk1SZgknAd87dIVKpjF9 admin2@Spares-MacBook-Pro.local",
                     "path": "/home/azureuser/.ssh/authorized_keys"
                  }
               ]
            },
            "resource_group_name": "${azurerm_resource_group.kube.name}",
            "sku": {
               "capacity": 3,
               "name": "Standard_D2_v2",
               "tier": "standard"
            },
            "storage_profile_image_reference": {
               "offer": "CoreOS",
               "publisher": "CoreOS",
               "sku": "Stable",
               "version": "1235.8.0"
            },
            "storage_profile_os_disk": {
               "caching": "ReadWrite",
               "create_option": "FromImage",
               "name": "agent-osdisk-profile",
               "vhd_containers": [
                  "${azurerm_storage_account.kube_storage.primary_blob_endpoint}${azurerm_storage_container.vhds.name}"
               ]
            },
            "upgrade_policy_mode": "Manual"
         }
      },
      "azurerm_virtual_network": {
         "kube_vn": {
            "address_space": [
               "10.0.0.0/8"
            ],
            "location": "westus",
            "name": "kube_vn",
            "resource_group_name": "${azurerm_resource_group.kube.name}"
         }
      }
   }
}

@StephenWeatherford
Copy link
Contributor

The crash has been fixed. However, Terraform always wants to make the following change after creating the resources:

~ azurerm_virtual_machine_scale_set.agentpool
sku.1109371675.capacity: "" => "3"
sku.1109371675.name: "" => "Standard_D2_v2"
sku.1109371675.tier: "" => "standard"
sku.3296928972.capacity: "3" => "0"
sku.3296928972.name: "Standard_D2_v2" => ""

@tombuildsstuff
Copy link
Contributor

Hi @guoshimin

Thanks for reporting this issue - apologies for the delay in getting back to you here.

As @StephenWeatherford has mentioned, I've confirmed that the crash identified in this issue has been fixed via PR #13464 :)

The remaining issue listed here, where the SKU isn't idempotent, is being tracked in issue #11626. So that we don't have multiple issues tracking the same problem, I'm going to close this issue in favour of #11626

Thanks!

@guoshimin
Copy link
Author

guoshimin commented Apr 18, 2017 via email

tombuildsstuff added a commit that referenced this issue Apr 20, 2017
Fix another issue from #11625 that's causing null entries in ssh_keys
@ghost
Copy link

ghost commented Apr 13, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
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

4 participants