When trying to build an image with azure-arm build source I always get an error about unknown configuration key: "user_name" . The same build in the legacy json format passes without problems.
ย cat build.pkr.hcl
# A build starts sources and runs provisioning steps on those sources.
build {
sources = [
"source.azure-arm.this"
]
provisioner "shell-local" {
inline = ["echo the address is: $PACKER_HTTP_ADDR and build name is: $PACKER_BUILD_NAME"]
}
}
cat sources.pkr.hcl
source "azure-arm" "this" {
# Auth
client_id = var.client_id
client_secret = var.client_secret
tenant_id = var.tenant_id
subscription_id = var.subscription_id
# General
managed_image_resource_group_name = var.resource_group_name
managed_image_name = var.managed_image_name
location = var.location
vm_size = var.vm_size
# # Image settings
os_type = var.image["os_type"]
image_publisher = var.image["image_publisher"]
image_offer = var.image["image_offer"]
image_sku = var.image["image_sku"]
# Communicator
communicator = "winrm"
winrm_use_ssl = true
winrm_insecure = true
winrm_timeout = "5m"
winrm_username = "packer"
winrm_password = "packer"
}
cat variables.pkr.hcl
# Note if I omit the empty defaults packer crashes!!!
variable "client_id" {
type = string
default = ""
}
variable "client_secret" {
type = string
default = ""
}
variable "tenant_id" {
type = string
default = ""
}
variable "subscription_id" {
type = string
default = ""
}
variable "resource_group_name" {
type = string
default = ""
}
variable "managed_image_name" {
type = string
default = ""
}
variable "location" {
type = string
default = ""
}
variable "vm_size" {
type = string
default = ""
}
variable "image" {
type = map(string)
default = {}
}
variable "azure_tags" {
type = map(string)
default = {}
}
ย cat vars.auto.pkrvars.hcl
#--------------------------------------------
# Azure auth
#--------------------------------------------
client_id = "redacted"
client_secret = "redacted"
tenant_id = "redacted"
subscription_id = "redacted"
#--------------------------------------------
# General
#--------------------------------------------
resource_group_name = "shared_rg"
managed_image_name = "packer_image"
location = "West Europe"
vm_size = "Standard_DS2_v2"
#--------------------------------------------
# Image settings
#--------------------------------------------
image = {
"os_type" = "Windows"
"image_publisher" = "MicrosoftWindowsServer"
"image_offer" = "WindowsServer"
"image_sku" = "2019-Datacenter"
}
# Not in use atm
azure_tags = {
"test" = "OK"
}
Run on Fedora 30
2020/02/20 14:53:25 [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
2020/02/20 14:53:25 Checking 'PACKER_CONFIG' for a config file path
2020/02/20 14:53:25 'PACKER_CONFIG' not set; checking the default config file path
2020/02/20 14:53:25 Attempting to open config file: /home/swetli/.packerconfig
2020/02/20 14:53:25 [WARN] Config file doesn't exist: /home/swetli/.packerconfig
2020/02/20 14:53:25 Setting cache directory: /home/swetli/packer/azure/packer_cache
2020/02/20 14:53:25 [ERR] Checkpoint error: EOF
2020/02/20 14:53:25 Creating plugin client for path: /usr/local/bin/packer
2020/02/20 14:53:25 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-azure-arm"}
2020/02/20 14:53:25 Waiting for RPC address for: /usr/local/bin/packer
2020/02/20 14:53:25 packer-builder-azure-arm plugin: [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
2020/02/20 14:53:25 packer-builder-azure-arm plugin: Checking 'PACKER_CONFIG' for a config file path
2020/02/20 14:53:25 packer-builder-azure-arm plugin: 'PACKER_CONFIG' not set; checking the default config file path
2020/02/20 14:53:25 packer-builder-azure-arm plugin: Attempting to open config file: /home/swetli/.packerconfig
2020/02/20 14:53:25 packer-builder-azure-arm plugin: [WARN] Config file doesn't exist: /home/swetli/.packerconfig
2020/02/20 14:53:25 packer-builder-azure-arm plugin: Setting cache directory: /home/swetli/packer/azure/packer_cache
2020/02/20 14:53:25 packer-builder-azure-arm plugin: args: []string{"packer-builder-azure-arm"}
2020/02/20 14:53:25 packer-builder-azure-arm plugin: [ERR] Checkpoint error: EOF
2020/02/20 14:53:25 packer-builder-azure-arm plugin: Plugin address: unix /tmp/packer-plugin908734970
2020/02/20 14:53:25 packer-builder-azure-arm plugin: Waiting for connection...
2020/02/20 14:53:25 Received unix RPC address for /usr/local/bin/packer: addr is /tmp/packer-plugin908734970
2020/02/20 14:53:25 packer-builder-azure-arm plugin: Serving a plugin connection...
Error: 1 error occurred:
* unknown configuration key: "user_name"; raws is []interface {}{map[string]interface {}{"allowed_inbound_ip_addresses":interface {}(nil), "async_resourcegroup_delete":interface {}(nil), "azure_tags":map[string]interface {}{}, "build_key_vault_name":interface {}(nil), "build_resource_group_name":interface {}(nil), "capture_container_name":interface {}(nil), "capture_name_prefix":interface {}(nil), "client_cert_path":interface {}(nil), "client_id":"xxx, "client_jwt":interface {}(nil), "client_secret":"xxx", "cloud_environment_name":interface {}(nil), "communicator":"winrm", "custom_data_file":interface {}(nil), "custom_managed_image_name":interface {}(nil), "custom_managed_image_resource_group_name":interface {}(nil), "disk_additional_size":interface {}(nil), "disk_caching_type":interface {}(nil), "image_offer":"WindowsServer", "image_publisher":"MicrosoftWindowsServer", "image_sku":"2019-Datacenter", "image_url":interface {}(nil), "image_version":interface {}(nil), "location":"West Europe", "managed_image_data_disk_snapshot_prefix":interface {}(nil), "managed_image_name":"packer_image", "managed_image_os_disk_snapshot_name":interface {}(nil), "managed_image_resource_group_name":"chili_aks_shared_rg", "managed_image_storage_account_type":interface {}(nil), "managed_image_zone_resilient":interface {}(nil), "object_id":interface {}(nil), "os_disk_size_gb":interface {}(nil), "os_type":"Windows", "packer_build_name":interface {}(nil), "packer_builder_type":interface {}(nil), "packer_debug":interface {}(nil), "packer_force":interface {}(nil), "packer_on_error":interface {}(nil), "packer_sensitive_variables":interface {}(nil), "packer_user_variables":interface {}(nil), "password":interface {}(nil), "pause_before_connecting":interface {}(nil), "plan_info":interface {}(nil), "polling_duration_timeout":interface {}(nil), "private_virtual_network_with_public_ip":interface {}(nil), "resource_group_name":interface {}(nil), "shared_gallery_image_version_end_of_life_date":interface {}(nil), "shared_gallery_image_version_exclude_from_latest":interface {}(nil), "shared_image_gallery":interface {}(nil), "shared_image_gallery_destination":interface {}(nil), "shared_image_gallery_replica_count":interface {}(nil), "shared_image_gallery_timeout":interface {}(nil), "ssh_agent_auth":interface {}(nil), "ssh_bastion_agent_auth":interface {}(nil), "ssh_bastion_host":interface {}(nil), "ssh_bastion_password":interface {}(nil), "ssh_bastion_port":interface {}(nil), "ssh_bastion_private_key_file":interface {}(nil), "ssh_bastion_username":interface {}(nil), "ssh_clear_authorized_keys":interface {}(nil), "ssh_disable_agent_forwarding":interface {}(nil), "ssh_file_transfer_method":interface {}(nil), "ssh_handshake_attempts":interface {}(nil), "ssh_host":interface {}(nil), "ssh_keep_alive_interval":interface {}(nil), "ssh_keypair_name":interface {}(nil), "ssh_local_tunnels":interface {}(nil), "ssh_password":interface {}(nil), "ssh_port":interface {}(nil), "ssh_private_key":interface {}(nil), "ssh_private_key_file":interface {}(nil), "ssh_proxy_host":interface {}(nil), "ssh_proxy_password":interface {}(nil), "ssh_proxy_port":interface {}(nil), "ssh_proxy_username":interface {}(nil), "ssh_pty":interface {}(nil), "ssh_public_key":interface {}(nil), "ssh_read_write_timeout":interface {}(nil), "ssh_remote_tunnels":interface {}(nil), "ssh_timeout":interface {}(nil), "ssh_username":interface {}(nil), "storage_account":interface {}(nil), "subscription_id":"xxx", "temp_compute_name":interface {}(nil), "temp_resource_group_name":interface {}(nil), "temporary_key_pair_name":interface {}(nil), "tenant_id":"xxx", "user_name":"koko", "virtual_network_name":interface {}(nil), "virtual_network_resource_group_name":interface {}(nil), "virtual_network_subnet_name":interface {}(nil), "vm_size":"Standard_DS2_v2", "winrm_host":interface {}(nil), "winrm_insecure":interface {}(nil), "winrm_password":"pepe", "winrm_port":interface {}(nil), "winrm_timeout":interface {}(nil), "winrm_use_ntlm":interface {}(nil), "winrm_use_ssl":interface {}(nil), "winrm_username":"packer"}}
and ctx data is map[interface {}]interface {}(nil)
on sources.pkr.hcl line 1, in source "azure-arm" "this":
1: source "azure-arm" "this" {
2020/02/20 14:53:25 Build debug mode: false
2020/02/20 14:53:25 Force build: false
2020/02/20 14:53:25 On error:
2020/02/20 14:53:25 Waiting on builds to complete...
==> Builds finished but no artifacts were created.
2020/02/20 14:53:25 [INFO] (telemetry) Finalizing.
* unknown configuration key: "user_name"; raws is []interface {}{map[string]interface {}{"allowed_inbound_ip_addresses":interface {}(nil), "async_resourcegroup_delete":interface {}(nil), "azure_tags":map[string]interface {}{}, "build_key_vault_name":interface {}(nil), "build_resource_group_name":interface {}(nil), "capture_container_name":interface {}(nil), "capture_name_prefix":interface {}(nil), "client_cert_path":interface {}(nil), "client_id":"redacted", "client_jwt":interface {}(nil), "client_secret":"redacted", "cloud_environment_name":interface {}(nil), "communicator":"winrm", "custom_data_file":interface {}(nil), "custom_managed_image_name":interface {}(nil), "custom_managed_image_resource_group_name":interface {}(nil), "disk_additional_size":interface {}(nil), "disk_caching_type":interface {}(nil), "image_offer":"WindowsServer", "image_publisher":"MicrosoftWindowsServer", "image_sku":"2019-Datacenter", "image_url":interface {}(nil), "image_version":interface {}(nil), "location":"West Europe", "managed_image_data_disk_snapshot_prefix":interface {}(nil), "managed_image_name":"packer_image", "managed_image_os_disk_snapshot_name":interface {}(nil), "managed_image_resource_group_name":"chili_aks_shared_rg", "managed_image_storage_account_type":interface {}(nil), "managed_image_zone_resilient":interface {}(nil), "object_id":interface {}(nil), "os_disk_size_gb":interface {}(nil), "os_type":"Windows", "packer_build_name":interface {}(nil), "packer_builder_type":interface {}(nil), "packer_debug":interface {}(nil), "packer_force":interface {}(nil), "packer_on_error":interface {}(nil), "packer_sensitive_variables":interface {}(nil), "packer_user_variables":interface {}(nil), "password":interface {}(nil), "pause_before_connecting":interface {}(nil), "plan_info":interface {}(nil), "polling_duration_timeout":interface {}(nil), "private_virtual_network_with_public_ip":interface {}(nil), "resource_group_name":interface {}(nil), "shared_gallery_image_version_end_of_life_date":interface {}(nil), "shared_gallery_image_version_exclude_from_latest":interface {}(nil), "shared_image_gallery":interface {}(nil), "shared_image_gallery_destination":interface {}(nil), "shared_image_gallery_replica_count":interface {}(nil), "shared_image_gallery_timeout":interface {}(nil), "ssh_agent_auth":interface {}(nil), "ssh_bastion_agent_auth":interface {}(nil), "ssh_bastion_host":interface {}(nil), "ssh_bastion_password":interface {}(nil), "ssh_bastion_port":interface {}(nil), "ssh_bastion_private_key_file":interface {}(nil), "ssh_bastion_username":interface {}(nil), "ssh_clear_authorized_keys":interface {}(nil), "ssh_disable_agent_forwarding":interface {}(nil), "ssh_file_transfer_method":interface {}(nil), "ssh_handshake_attempts":interface {}(nil), "ssh_host":interface {}(nil), "ssh_keep_alive_interval":interface {}(nil), "ssh_keypair_name":interface {}(nil), "ssh_local_tunnels":interface {}(nil), "ssh_password":interface {}(nil), "ssh_port":interface {}(nil), "ssh_private_key":interface {}(nil), "ssh_private_key_file":interface {}(nil), "ssh_proxy_host":interface {}(nil), "ssh_proxy_password":interface {}(nil), "ssh_proxy_port":interface {}(nil), "ssh_proxy_username":interface {}(nil), "ssh_pty":interface {}(nil), "ssh_public_key":interface {}(nil), "ssh_read_write_timeout":interface {}(nil), "ssh_remote_tunnels":interface {}(nil), "ssh_timeout":interface {}(nil), "ssh_username":interface {}(nil), "storage_account":interface {}(nil), "subscription_id":"redacted", "temp_compute_name":interface {}(nil), "temp_resource_group_name":interface {}(nil), "temporary_key_pair_name":interface {}(nil), "tenant_id":"redacted", "user_name":"koko", "virtual_network_name":interface {}(nil), "virtual_network_resource_group_name":interface {}(nil), "virtual_network_subnet_name":interface {}(nil), "vm_size":"Standard_DS2_v2", "winrm_host":interface {}(nil), "winrm_insecure":interface {}(nil), "winrm_password":"pepe", "winrm_port":interface {}(nil), "winrm_timeout":interface {}(nil), "winrm_use_ntlm":interface {}(nil), "winrm_use_ssl":interface {}(nil), "winrm_username":"packer"}}
and ctx data is map[interface {}]interface {}(nil)
on sources.pkr.hcl line 1, in source "azure-arm" "this":
1: source "azure-arm" "this" {
==> Builds finished but no artifacts were created.
2020/02/20 14:53:26 waiting for all plugin processes to complete...
2020/02/20 14:53:26 /usr/local/bin/packer: plugin process exited
We think we have a PR that will fix this issue, linked above -- can you test the binary in https://circleci.com/gh/hashicorp/packer/35967#artifacts/containers/0 and let us know if it solves your issue?
Issue is resolved with the provided binary
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.
Most helpful comment
Issue is resolved with the provided binary