packer-plugin-proxmox icon indicating copy to clipboard operation
packer-plugin-proxmox copied to clipboard

proxmox-iso: Tag check is too strict, allowed character "." is rejected

Open dreibh opened this issue 4 months ago • 3 comments

I am trying to create a Proxmox VM with tag "ubuntu-24.04". This worked until recently, when I updated Packer and the plug-ins. Now, Packer refuses this Proxmox tag, due to "." in the tag.

Overview of the Issue

Build 'proxmox-iso' errored after 12 seconds 174 milliseconds: Error creating VM: tag may not start with - and may only include the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-

"ubuntu-24.04" is a valid tag, it should be accepted by Packer.

Reproduction Steps

"builders": [ { "type": "proxmox-iso", ... "tags": "ubuntu-24.04",

Plugin and Packer version

dreibh@kringsjaa:~$ packer version Packer v1.13.1 dreibh@kringsjaa:~$ packer plugin installed /home/dreibh/.packer.d/plugins/github.com/hashicorp/docker/packer-plugin-docker_v1.1.1_x5.0_linux_amd64 /home/dreibh/.packer.d/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.2.2_x5.0_linux_amd64 /home/dreibh/.packer.d/plugins/github.com/hashicorp/qemu/packer-plugin-qemu_v1.1.3_x5.0_linux_amd64 /home/dreibh/.packer.d/plugins/github.com/hashicorp/virtualbox/packer-plugin-virtualbox_v1.1.2_x5.0_linux_amd64

Log Fragments and crash.log files

2025-07-10T16:15:54+02:00: ==> proxmox-iso: Force set, checking for existing artifact on PVE cluster 2025/07/10 16:15:54 packer-plugin-proxmox_v1.2.2_x5.0_linux_amd64 plugin: 2025/07/10 16:15:54 vm '250710613' not found 2025-07-10T16:15:54+02:00: ==> proxmox-iso: No existing artifact found 2025-07-10T16:15:54+02:00: ==> proxmox-iso: Creating VM 2025-07-10T16:15:54+02:00: ==> proxmox-iso: Error creating VM: tag may not start with - and may only include the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_- ==> Wait completed after 12 seconds 168 milliseconds 2025/07/10 16:15:54 machine readable: error-count []string{"1"} ==> Some builds didn't complete successfully and had errors: 2025/07/10 16:15:54 machine readable: proxmox-iso,error []string{"Error creating VM: tag may not start with - and may only include the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"} ==> Builds finished but no artifacts were created. 2025-07-10T16:15:54+02:00: ==> proxmox-iso: Error creating VM: tag may not start with - and may only include the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_- 2025/07/10 16:15:54 waiting for all plugin processes to complete... 2025-07-10T16:15:54+02:00: ==> proxmox-iso: Step "stepStartVM" failed, aborting... 2025-07-10T16:15:54+02:00: ==> proxmox-iso: aborted: skipping cleanup of step "stepDownloadISOOnPVE" 2025-07-10T16:15:54+02:00: Build 'proxmox-iso' errored after 12 seconds 168 milliseconds: Error creating VM: tag may not start with - and may only include the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-

==> Wait completed after 12 seconds 168 milliseconds

==> Some builds didn't complete successfully and had errors: --> proxmox-iso: Error creating VM: tag may not start with - and may only include the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-

==> Builds finished but no artifacts were created.

dreibh avatar Jul 10 '25 14:07 dreibh

Work-around is to downgrade the Proxmox plug-in to version 1.1.8:

packer plugin remove github.com/hashicorp/proxmox
packer plugin install github.com/hashicorp/proxmox 1.1.8

dreibh avatar Jul 10 '25 14:07 dreibh

This is somewhat related to https://github.com/hashicorp/packer-plugin-proxmox/issues/285.

This was fixed in upstream at:

  • https://github.com/Telmate/proxmox-api-go/pull/404
  • https://github.com/Telmate/proxmox-api-go/issues/402

rgl avatar Jul 29 '25 08:07 rgl

Indeed, the dependency on https://github.com/Telmate/proxmox-api-go needs to be updated to get the fix into the Packer plugin. Telmate/proxmox-api-go fixed the tag regexp in commit 4407a1080095aba87ac96a37b6c82cfd0a7a2110. However, this version of Telmate/proxmox-api-go seems to have changed the API, requiring some further updates of the plugin:

# github.com/hashicorp/packer-plugin-proxmox/builder/proxmox/common
builder/proxmox/common/step_convert_to_template.go:27:27: cannot use &proxmox.Client{} (value of type *"github.com/Telmate/proxmox-api-go/proxmox".Client) as templateConverter value in variable declaration: *"github.com/Telmate/proxmox-api-go/proxmox".Client does not implement templateConverter (wrong type for method CreateTemplate)
                have CreateTemplate(context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef) error
                want CreateTemplate(*"github.com/Telmate/proxmox-api-go/proxmox".VmRef) error
builder/proxmox/common/step_finalize_template_config.go:27:27: cannot use &proxmox.Client{} (value of type *"github.com/Telmate/proxmox-api-go/proxmox".Client) as templateFinalizer value in variable declaration: *"github.com/Telmate/proxmox-api-go/proxmox".Client does not implement templateFinalizer (wrong type for method GetVmConfig)
                have GetVmConfig(context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef) (map[string]interface{}, error)
                want GetVmConfig(*"github.com/Telmate/proxmox-api-go/proxmox".VmRef) (map[string]interface{}, error)
builder/proxmox/common/step_remove_cloud_init_drive.go:25:31: cannot use &proxmox.Client{} (value of type *"github.com/Telmate/proxmox-api-go/proxmox".Client) as CloudInitDriveRemover value in variable declaration: *"github.com/Telmate/proxmox-api-go/proxmox".Client does not implement CloudInitDriveRemover (wrong type for method GetVmConfig)
                have GetVmConfig(context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef) (map[string]interface{}, error)
                want GetVmConfig(*"github.com/Telmate/proxmox-api-go/proxmox".VmRef) (map[string]interface{}, error)
builder/proxmox/common/step_start_vm.go:790:26: cannot use &proxmox.Client{} (value of type *"github.com/Telmate/proxmox-api-go/proxmox".Client) as startedVMCleaner value in variable declaration: *"github.com/Telmate/proxmox-api-go/proxmox".Client does not implement startedVMCleaner (wrong type for method DeleteVm)
                have DeleteVm(context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef) (string, error)
                want DeleteVm(*"github.com/Telmate/proxmox-api-go/proxmox".VmRef) (string, error)
builder/proxmox/common/step_type_boot_command.go:37:22: cannot use &proxmox.Client{} (value of type *"github.com/Telmate/proxmox-api-go/proxmox".Client) as commandTyper value in variable declaration: *"github.com/Telmate/proxmox-api-go/proxmox".Client does not implement commandTyper (wrong type for method Sendkey)
                have Sendkey(context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef, string) error
                want Sendkey(*"github.com/Telmate/proxmox-api-go/proxmox".VmRef, string) error
builder/proxmox/common/step_upload_iso.go:28:18: cannot use &proxmoxapi.Client{} (value of type *"github.com/Telmate/proxmox-api-go/proxmox".Client) as uploader value in variable declaration: *"github.com/Telmate/proxmox-api-go/proxmox".Client does not implement uploader (wrong type for method DeleteVolume)
                have DeleteVolume(context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef, string, string) (interface{}, error)
                want DeleteVolume(*"github.com/Telmate/proxmox-api-go/proxmox".VmRef, string, string) (interface{}, error)
builder/proxmox/common/artifact.go:50:37: not enough arguments in call to a.proxmoxClient.DeleteVm
        have (*"github.com/Telmate/proxmox-api-go/proxmox".VmRef)
        want (context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef)
builder/proxmox/common/artifact.go:50:54: cannot use a.templateID (variable of type int) as "github.com/Telmate/proxmox-api-go/proxmox".GuestID value in argument to proxmox.NewVmRef
builder/proxmox/common/builder.go:155:49: not enough arguments in call to client.GetVmAgentNetworkInterfaces
        have (*"github.com/Telmate/proxmox-api-go/proxmox".VmRef)
        want (context.Context, *"github.com/Telmate/proxmox-api-go/proxmox".VmRef)
builder/proxmox/common/client.go:33:56: not enough arguments in call to client.Login
        have (string, string, string)
        want (context.Context, string, string, string)
builder/proxmox/common/client.go:33:56: too many errors
make: *** [GNUmakefile:12: build] Fehler 1

dreibh avatar Nov 11 '25 10:11 dreibh