Packer: Packer 1.6.3 crashes on Azure build (panic: interface conversion: interface {} is map[string]string, not map[string]*string)

Created on 29 Sep 2020  ยท  6Comments  ยท  Source: hashicorp/packer

Overview of the Issue

After upgrading from packer 1.6.1 to 1.6.3, my azure-arm build suddenly started to fail with the following error:

panic: interface conversion: interface {} is map[string]string, not map[string]*string

Reproduction Steps

Attempt to build an ubuntu-18.04 image in Azure with the following settings:

Packer version

$ packer version
Packer v1.6.3

Simplified Packer Buildfile

"builders": [
{
"client_id": "{{ user client_id}}",
"client_secret": "{{ user client_secret }}",
"image_offer": "UbuntuServer",
"image_publisher": "Canonical",
"image_sku": "18.04-LTS",
"location": "East US",
"managed_image_name": "{{ user vm_name }}",
"managed_image_resource_group_name": "{{ user rgname}}",
"os_type": "Linux",
"subscription_id": "{{ user subscription_id }}",
"tenant_id": "{{ user tenant_id }}",
"type": "azure-arm",
"azure_tags": [
{
"group": "{{ user group_name}}"
}
],
"virtual_network_name": "{{ user network_name}} ",
"virtual_network_resource_group_name": "{{ user netrgname }}",
"virtual_network_subnet_name": "{{ user netsnname }}",
"vm_size": "Standard_DS2_v2"
}
}

Operating system and Environment details

alpine 3.8 container, run via gitlab-ci on a Kubernetes 1.18.6 cluster

Log Fragments and crash.log files

crash.log

2020/09/29 17:16:20 [INFO] Packer version: 1.6.3 [go1.15.2 linux amd64]
2020/09/29 17:16:20 Checking 'PACKER_CONFIG' for a config file path
2020/09/29 17:16:20 'PACKER_CONFIG' not set; checking the default config file path
2020/09/29 17:16:20 Attempting to open config file: /home/castellan/.packerconfig
2020/09/29 17:16:20 [WARN] Config file doesn't exist: /home/castellan/.packerconfig
2020/09/29 17:16:20 Setting cache directory: /builds/infrastructure-engineering/packer-rancher-node-template/packer_cache
Running in background, not using a TTY
2020/09/29 17:16:20 Creating plugin client for path: /usr/local/bin/packer
2020/09/29 17:16:20 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-azure-arm"}
2020/09/29 17:16:20 Waiting for RPC address for: /usr/local/bin/packer
2020/09/29 17:16:21 packer-builder-azure-arm plugin: [INFO] Packer version: 1.6.3 [go1.15.2 linux amd64]
2020/09/29 17:16:21 packer-builder-azure-arm plugin: Checking 'PACKER_CONFIG' for a config file path
2020/09/29 17:16:21 packer-builder-azure-arm plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/09/29 17:16:21 packer-builder-azure-arm plugin: Attempting to open config file: /home/castellan/.packerconfig
2020/09/29 17:16:21 packer-builder-azure-arm plugin: [WARN] Config file doesn't exist: /home/castellan/.packerconfig
2020/09/29 17:16:21 packer-builder-azure-arm plugin: Setting cache directory: /builds/infrastructure-engineering/packer-rancher-node-template/packer_cache
2020/09/29 17:16:21 packer-builder-azure-arm plugin: args: []string{"packer-builder-azure-arm"}
2020/09/29 17:16:21 packer-builder-azure-arm plugin: Plugin address: unix /tmp/packer-plugin770067422
2020/09/29 17:16:21 Received unix RPC address for /usr/local/bin/packer: addr is /tmp/packer-plugin770067422
2020/09/29 17:16:21 packer-builder-azure-arm plugin: Waiting for connection...
2020/09/29 17:16:21 packer-builder-azure-arm plugin: Serving a plugin connection...
2020/09/29 17:16:21 Creating plugin client for path: /usr/local/bin/packer
2020/09/29 17:16:21 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-provisioner-ansible"}
2020/09/29 17:16:21 Waiting for RPC address for: /usr/local/bin/packer
2020/09/29 17:16:21 packer-provisioner-ansible plugin: [INFO] Packer version: 1.6.3 [go1.15.2 linux amd64]
2020/09/29 17:16:21 packer-provisioner-ansible plugin: Checking 'PACKER_CONFIG' for a config file path
2020/09/29 17:16:21 packer-provisioner-ansible plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/09/29 17:16:21 packer-provisioner-ansible plugin: Attempting to open config file: /home/castellan/.packerconfig
2020/09/29 17:16:21 packer-provisioner-ansible plugin: [WARN] Config file doesn't exist: /home/castellan/.packerconfig
2020/09/29 17:16:21 packer-provisioner-ansible plugin: Setting cache directory: /builds/infrastructure-engineering/packer-rancher-node-template/packer_cache
2020/09/29 17:16:21 packer-provisioner-ansible plugin: args: []string{"packer-provisioner-ansible"}
2020/09/29 17:16:21 packer-provisioner-ansible plugin: Plugin address: unix /tmp/packer-plugin438294049
2020/09/29 17:16:21 Received unix RPC address for /usr/local/bin/packer: addr is /tmp/packer-plugin438294049
2020/09/29 17:16:21 packer-provisioner-ansible plugin: Waiting for connection...
2020/09/29 17:16:21 packer-provisioner-ansible plugin: Serving a plugin connection...
2020/09/29 17:16:21 Preparing build: azure-arm
2020/09/29 17:16:23 packer-provisioner-ansible plugin: ansible-playbook version: 2.10.1
2020/09/29 17:16:23 ui: azure-arm: output will be in this color.
2020/09/29 17:16:23 ui:
2020/09/29 17:16:23 Build debug mode: false
2020/09/29 17:16:23 Force build: true
2020/09/29 17:16:23 On error:
2020/09/29 17:16:23 Waiting on builds to complete...
2020/09/29 17:16:23 Starting build run: azure-arm
2020/09/29 17:16:23 Running builder: azure-arm
2020/09/29 17:16:23 [INFO] (telemetry) Starting builder azure-arm
2020/09/29 17:16:23 ui: ==> azure-arm: Running builder ...
2020/09/29 17:16:23 packer-builder-azure-arm plugin: :: Configuration
2020/09/29 17:16:23 packer-builder-azure-arm plugin: CaptureNamePrefix=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: CaptureContainerName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: SharedGalleryImageVersionEndOfLifeDate=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ImagePublisher=Canonical
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ImageOffer=UbuntuServer
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ImageSku=18.04-LTS
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ImageVersion=latest
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ImageUrl=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: CustomManagedImageName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: CustomManagedImageResourceGroupName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: Location=East US
2020/09/29 17:16:23 packer-builder-azure-arm plugin: VMSize=Standard_DS2_v2
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ManagedImageResourceGroupName=IE-MachineImages
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ManagedImageName=rancher_node_template
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ManagedImageStorageAccountType=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ManagedImageOSDiskSnapshotName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ManagedImageDataDiskSnapshotPrefix=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: ResourceGroupName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: StorageAccount=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: TempComputeName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: TempResourceGroupName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: BuildResourceGroupName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: BuildKeyVaultName=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: BuildKeyVaultSKU=standard
2020/09/29 17:16:23 packer-builder-azure-arm plugin: VirtualNetworkName=TU-Network-East
2020/09/29 17:16:23 packer-builder-azure-arm plugin: VirtualNetworkSubnetName=TU-AZE-IOS-DB-16
2020/09/29 17:16:23 packer-builder-azure-arm plugin: VirtualNetworkResourceGroupName=Network-East-RG
2020/09/29 17:16:23 packer-builder-azure-arm plugin: CustomDataFile=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: OSType=Linux
2020/09/29 17:16:23 packer-builder-azure-arm plugin: DiskCachingType=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: BootDiagSTGAccount=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: CustomResourcePrefix=
2020/09/29 17:16:23 packer-builder-azure-arm plugin: UserName=packer
2020/09/29 17:16:23 packer-builder-azure-arm plugin: Password=*********
2020/09/29 17:16:23 ui: ==> azure-arm: Getting tokens using client secret
2020/09/29 17:16:23 ui: ==> azure-arm: Getting tokens using client secret
2020/09/29 17:16:23 ui:  azure-arm: Creating Azure Resource Manager (ARM) client ...
2020/09/29 17:16:23 packer-builder-azure-arm plugin: Azure request method="GET" request="https://management.azure.com/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourcegroups/IE-MachineImages?api-version=2018-02-01" body=""
2020/09/29 17:16:24 packer-builder-azure-arm plugin: Azure response method="GET" request="https://management.azure.com/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourcegroups/IE-MachineImages?api-version=2018-02-01" x-ms-request-id="48e5e987-1dc6-4458-b4c1-b13db8966f9f" body="{\"id\":\"/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourceGroups/IE-MachineImages\",\"name\":\"IE-MachineImages\",\"location\":\"eastus\",\"tags\":{\"group\":\"Infrastructure Engineering\"},\"properties\":{\"provisioningState\":\"Succeeded\"}}" status="200 OK"
2020/09/29 17:16:24 packer-builder-azure-arm plugin: Azure response status="200 OK" method="GET" request="https://management.azure.com/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourcegroups/IE-MachineImages?api-version=2018-02-01" x-ms-request-id="48e5e987-1dc6-4458-b4c1-b13db8966f9f" body="{\"id\":\"/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourceGroups/IE-MachineImages\",\"name\":\"IE-MachineImages\",\"location\":\"eastus\",\"tags\":{\"group\":\"Infrastructure Engineering\"},\"properties\":{\"provisioningState\":\"Succeeded\"}}"
2020/09/29 17:16:24 packer-builder-azure-arm plugin: Azure request method="GET" request="https://management.azure.com/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourceGroups/IE-MachineImages/providers/Microsoft.Compute/images/rancher_node_template?api-version=2018-04-01" body=""
2020/09/29 17:16:24 packer-builder-azure-arm plugin: Azure response status="404 Not Found" method="GET" request="https://management.azure.com/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourceGroups/IE-MachineImages/providers/Microsoft.Compute/images/rancher_node_template?api-version=2018-04-01" x-ms-request-id="787cd3c1-97b1-4621-9bd5-9707aa6bfdc4" body="{\"error\":{\"code\":\"ResourceNotFound\",\"message\":\"The Resource 'Microsoft.Compute/images/rancher_node_template' under resource group 'IE-MachineImages' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"}}"
2020/09/29 17:16:24 packer-builder-azure-arm plugin: Azure response status="404 Not Found" method="GET" request="https://management.azure.com/subscriptions/ee76a4ac-76c6-4be1-9a70-3cfab25fec78/resourceGroups/IE-MachineImages/providers/Microsoft.Compute/images/rancher_node_template?api-version=2018-04-01" x-ms-request-id="787cd3c1-97b1-4621-9bd5-9707aa6bfdc4" body="{\"error\":{\"code\":\"ResourceNotFound\",\"message\":\"The Resource 'Microsoft.Compute/images/rancher_node_template' under resource group 'IE-MachineImages' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix\"}}"
2020/09/29 17:16:24 ui: ==> azure-arm: WARNING: Zone resiliency may not be supported in East US, checkout the docs at https://docs.microsoft.com/en-us/azure/availability-zones/
2020/09/29 17:16:24 packer-builder-azure-arm plugin: panic: interface conversion: interface {} is map[string]string, not map[string]
string
2020/09/29 17:16:24 packer-builder-azure-arm plugin:
2020/09/29 17:16:24 packer-builder-azure-arm plugin: goroutine 119 [running]:
2020/09/29 17:16:24 packer-builder-azure-arm plugin: github.com/hashicorp/packer/builder/azure/arm.(StepCreateResourceGroup).Run(0xc0001a8030, 0x520d6c0, 0xc0000d8080, 0x520e300, 0xc000b7dda0, 0xc000b7dda0)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /home/circleci/project/packer/builder/azure/arm/step_create_resource_group.go:64 +0xa36
2020/09/29 17:16:24 packer-builder-azure-arm plugin: github.com/hashicorp/packer/helper/multistep.(
BasicRunner).Run(0xc0001a8330, 0x520d6c0, 0xc0000d8080, 0x520e300, 0xc000b7dda0)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /home/circleci/project/packer/helper/multistep/basic_runner.go:67 +0x21c
2020/09/29 17:16:24 packer-builder-azure-arm plugin: github.com/hashicorp/packer/builder/azure/arm.(Builder).Run(0xc0009dc000, 0x520d6c0, 0xc0000d8080, 0x5227f20, 0xc0008fa1b0, 0x518eb00, 0xc00035bfc0, 0x0, 0x0, 0x0, ...)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /home/circleci/project/packer/builder/azure/arm/builder.go:285 +0x15a2
2020/09/29 17:16:24 packer-builder-azure-arm plugin: github.com/hashicorp/packer/packer/rpc.(
BuilderServer).Run(0xc000411300, 0x1, 0xc00049e050, 0x0, 0x0)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /home/circleci/project/packer/packer/rpc/builder.go:117 +0x1c4
2020/09/29 17:16:24 packer-builder-azure-arm plugin: reflect.Value.call(0xc0000b57a0, 0xc000e6bc70, 0x13, 0x4bd13c4, 0x4, 0xc000119f08, 0x3, 0x3, 0x4bd03ac, 0x2, ...)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /usr/local/go/src/reflect/value.go:475 +0x8c7
2020/09/29 17:16:24 packer-builder-azure-arm plugin: reflect.Value.Call(0xc0000b57a0, 0xc000e6bc70, 0x13, 0xc000b87f08, 0x3, 0x3, 0x3dff320, 0x4d19268, 0x401c700)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /usr/local/go/src/reflect/value.go:336 +0xb9
2020/09/29 17:16:24 packer-builder-azure-arm plugin: net/rpc.(service).call(0xc000411380, 0xc0001c6370, 0xc00049f218, 0xc00049f220, 0xc0000e5b80, 0xc0005c6340, 0x3d82f60, 0xc00049e01c, 0x18a, 0x3c91be0, ...)
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /usr/local/go/src/net/rpc/server.go:377 +0x189
2020/09/29 17:16:24 packer-builder-azure-arm plugin: created by net/rpc.(
Server).ServeCodec
2020/09/29 17:16:24 packer-builder-azure-arm plugin: /usr/local/go/src/net/rpc/server.go:474 +0x445
2020/09/29 17:16:24 [INFO] (telemetry) ending azure-arm
2020/09/29 17:16:24 ui error: Build 'azure-arm' errored after 732 milliseconds 947 microseconds: unexpected EOF
2020/09/29 17:16:24 ui:
==> Wait completed after 733 milliseconds 29 microseconds
2020/09/29 17:16:24 machine readable: error-count []string{"1"}
2020/09/29 17:16:24 ui error:
==> Some builds didn't complete successfully and had errors:
2020/09/29 17:16:24 machine readable: azure-arm,error []string{"unexpected EOF"}
2020/09/29 17:16:24 ui error: --> azure-arm: unexpected EOF
2020/09/29 17:16:24 ui:
==> Builds finished but no artifacts were created.
2020/09/29 17:16:24 Cancelling builder after context cancellation context canceled
2020/09/29 17:16:24 Error cancelling builder: connection is shut down
2020/09/29 17:16:24 [INFO] (telemetry) Finalizing.
2020/09/29 17:16:24 /usr/local/bin/packer: plugin process exited
2020/09/29 17:16:24 waiting for all plugin processes to complete...
2020/09/29 17:16:24 /usr/local/bin/packer: plugin process exited

bug buildeazure regression track-internal

Most helpful comment

This is the same as the bug I recently created #10012
I just submitted a PR that fixes this issue.

https://github.com/hashicorp/packer/pull/10014

All 6 comments

Seems to work fine on 1.6.2

This is the same as the bug I recently created #10012
I just submitted a PR that fixes this issue.

https://github.com/hashicorp/packer/pull/10014

Hi there thanks for bubbling this up. This issue is related to the change made in #9985. Taking a look now at your PR.

We've merged a patch for this and will do a fast-follow release to fix it soon. Sorry again for any trouble this may have caused.

1.6.4 has been released.

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.

Was this page helpful?
0 / 5 - 0 ratings