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

Builder Proxmox-iso error 506 #154

Open
ntatschner opened this issue Feb 10, 2023 · 16 comments
Open

Builder Proxmox-iso error 506 #154

ntatschner opened this issue Feb 10, 2023 · 16 comments
Labels

Comments

@ntatschner
Copy link

Overview of the Issue

Building a proxmox template with ubuntu 22.04 sourced from URL I'm getting and error 506 when attempting the build, packer file validates fine.

Plugin and Packer version

From proxmox 1.1.1 and packer latest

Simplified Packer Buildfile

source "proxmox-iso" "ubuntu2204" {
  vm_name                  = "ubuntu2204templatebuilder"
  os                       = "l26"
  onboot                   = true
  cores                    = var.cores
  memory                   = var.memory
  sockets                  = var.sockets
  machine                  = "i440fx"
  proxmox_url              = var.proxmox_url
  username                 = var.proxmox_username
  token                    = var.token
  insecure_skip_tls_verify = true
  node                     = var.node_name
  template_name            = var.template_name
  ssh_username             = var.proxmox_builder_ssh_username
  ssh_password             = var.proxmox_builder_ssh_password
  ssh_timeout              = "20m"
  ssh_pty                  = true
  ssh_handshake_attempts   = 20
  #qemu_agent               = true
  #cloud_init               = true
  scsi_controller      = "virtio-scsi-pci"
  unmount_iso          = true
  template_description = "packer generated ubuntu-22.04.server-amd64"
  disks {
    type              = "virtio"
    disk_size         = var.disk_size
    storage_pool      = var.storage_pool
    storage_pool_type = "lvm-thin"
    format            = "qcow2"
  }
  iso_url          = var.iso_url
  iso_checksum     = var.iso_checksum
  iso_storage_pool = "local"
  boot_wait        = "10s"
  http_directory   = var.http_directory
  network_adapters {
    model    = "virtio"
    bridge   = "vmbr1"
    firewall = false
  }
  # cd_files = ["./${var.http_directory}/meta-data", "./${var.http_directory}/user-data"]
  # cd_label = "cidata"
  boot_command = [
    "<esc><wait><esc><wait><f6><wait><esc><wait>",
    "<bs><bs><bs><bs><bs>",
    "ip=${cidrhost("10.20.80.0/23", 9)}::${cidrhost("10.20.80.0/23", 1)}:${cidrnetmask("10.20.80.0/23")}::::${cidrhost("10.20.80.0/23", 1)} ",
    " autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/http/ ",
    "--- <enter>"
  ]
}

Operating system and Environment details

running on ubuntu 22.04, via github actions.

Log Fragments and crash.log files


Error: /10 14:08:23 packer-plugin-proxmox_v1.1.1_x5.0_linux_amd64 plugin: 2023/02/10 14:08:23 [ERROR] "unsupported machine type, fall back to default"
2023/02/10 14:08:23 [INFO] (telemetry) ending proxmox-iso.ubuntu2204
==> Wait completed after 29 seconds 693 milliseconds
2023/02/10 14:08:23 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
==> proxmox-iso.ubuntu2204: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=65a03615a4e393b74aa66f2ad6a7df646f0ac1382aff761ca3e376c8e748' not implemented, error status:  (params: map[agent:1 args: boot: cores:2 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/ubuntu-22.04.1-live-server-amd64.iso,media=cdrom kvm:true machine:i440fx memory:4096 name:ubuntu2204templatebuilder net0:virtio=1A:3F:2A:12:24:CD,bridge=vmbr1,firewall=false onboot:true ostype:l26 scsihw:virtio-scsi-pci sockets:1 startup: tags: virtio0:biglocal:100,format=qcow2,iothread=false vmid:101])
Build 'proxmox-iso.ubuntu2204' errored after 29 seconds 693 milliseconds: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=65a03615a4e393b74aa66f2ad6a7df646f0ac1382aff761ca3e376c8e748' not implemented, error status:  (params: map[agent:1 args: boot: cores:2 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/ubuntu-22.04.1-live-server-amd64.iso,media=cdrom kvm:true machine:i440fx memory:4096 name:ubuntu2204templatebuilder net0:virtio=1A:3F:2A:12:24:CD,bridge=vmbr1,firewall=false onboot:true ostype:l26 scsihw:virtio-scsi-pci sockets:1 startup: tags: virtio0:biglocal:100,format=qcow2,iothread=false vmid:101])
@ntatschner ntatschner added the bug label Feb 10, 2023
@ntatschner
Copy link
Author

All vars specified elsewhere in the file and via github actions secrets

@lbajolet-hashicorp
Copy link
Contributor

Hi @ntatschner,

Regarding the error you're getting on the machine type, according to the code for the plugin, only the following values are supported: pc, q35, pc-i440fx, if you want that error to go away, you can replace this in your config.
I see that the documentation contradicts this statement, so I will open a PR to fix that problem.

Regarding the 506 error you're receiving, it's not clear which step fails, would you be able to produce more verbose logs? You can enable those by setting the PACKER_LOG=1 environment variable when running the build.

Thanks for reporting this, we'll take a closer look at this once you provide more context to the error.

@sebastian-de
Copy link
Contributor

Build 'proxmox-iso.ubuntu2204' errored after 29 seconds 693 milliseconds: Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data

Hey @ntatschner , the 506 error is the same as #146 which is caused by wrong HTTP headers after uploading the ISO file. This should be fixed with #152

@lbajolet-hashicorp
Copy link
Contributor

Hm, thanks for the update on this @sebastian-de!

According to one of the linked issues, this can be fixed temporarily by pinning the plugin version to 1.1.0, could you try this @ntatschner?

Since there's a fix in the pipes, this will be fixed once we release 1.1.2, we'll keep you posted as to when this happens, and you can then try on that version.

@ntatschner
Copy link
Author

ntatschner commented Feb 11, 2023

Hey both, @sebastian-de @lbajolet-hashicorp
Thanks for the replies, version pinning seemed to help with the initial error, for the machine type, it seem the current version regex patten matches to validate the input and it dose not like pc-i440fx

==> proxmox-iso.ubuntu2204: Error creating VM: error creating VM: 400 Parameter verification failed., error status: {"data":null,"errors":{"machine":"value does not match the regex pattern"}} (params: map[agent:1 args: boot: cores:2 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/ubuntu-22.04.1-live-server-amd64.iso,media=cdrom kvm:true machine:pc-i440fx memory:4096 name:ubuntu2204templatebuilder net0:virtio=C6:2D:9A:21:5F:2B,bridge=vmbr1,firewall=false numa:false onboot:true ostype:l26 scsihw:virtio-scsi-pci sockets:1 tablet:false tags: virtio0:biglocal:100,format=qcow2,iothread=false vmid:101])

@lbajolet-hashicorp
Copy link
Contributor

Hi @ntatschner,

That's good to know, I imagine the machine type is unsupported by Proxmox then, which contradicts with what the code accepts.

According to the docs for the Go proxmox API, it looks like the values I provided earlier are the accepted ones, but maybe there's a mismatch between this config excerpt and what the actual supported values are?

If you set the machine type to i440fx without the pc- prefix, this is ignored and the empty value takes its place, as pointed out in the logs for your previous run.
Unfortunately, this isn't something we can fix on Packer's side alone, this change will need to happen on the API client side as well.

Looking at the Proxmox wiki (maybe not up-to-date so it might be worth taking this info with a grain of salt), the regex for accepting machine values is a bit more complex than what is in the API: (pc|pc(-i440fx)?-\d+(\.\d+)+(\+pve\d+)?(\.pxe)?|q35|pc-q35-\d+(\.\d+)+(\+pve\d+)?(\.pxe)?|virt(?:-\d+(\.\d+)+)?(\+pve\d+)?).
According to this regexp, px-i440fx is indeed rejected, the only values that are accepted by both the Go API and this regex are pc or q35.

@sebastian-de
Copy link
Contributor

@lbajolet-hashicorp the current documentation can be found here: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#qm_configuration

But the regex for machine still seems to be (pc|pc(-i440fx)?-\d+(\.\d+)+(\+pve\d+)?(\.pxe)?|q35|pc-q35-\d+(\.\d+)+(\+pve\d+)?(\.pxe)?|virt(?:-\d+(\.\d+)+)?(\+pve\d+)?)

The GUI offers the following options:
pm_01
pm_02
Version seems to specify a QEMU release.

Looking at the config files, after setting different options yields the following:
q35 + Latest -> machine: q35
q35 + 7.1 -> machine: pc-q35-7.1
i440fx + 7.1 -> machine: pc-i440fx-7.1
i440fx + Latest -> machine not set in config-file (default)

Setting machine to i440fx manually results in a QEMU error when trying to start the VM. Setting it to pc works and seems to be the same as the default setting.

So the only allowed settings should indeed be q35 or pc (if we stick to the schema without QEMU version).

@sebastian-de
Copy link
Contributor

here is the output of qemu-system-x86_64 -machine help on a 7.3 PVE node:

Supported machines are:
microvm              microvm (i386)
pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-7.1)
pc-i440fx-7.1        Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-7.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-6.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-6.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-6.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-5.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-5.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-5.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-4.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-4.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-4.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-3.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-3.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.12       Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.11       Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.10       Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.1        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.0        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-1.7        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-1.6        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-1.5        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-1.4        Standard PC (i440FX + PIIX, 1996) (deprecated)
q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-7.1)
pc-q35-7.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-7.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-6.2           Standard PC (Q35 + ICH9, 2009)
pc-q35-6.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-6.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-5.2           Standard PC (Q35 + ICH9, 2009)
pc-q35-5.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-5.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-4.2           Standard PC (Q35 + ICH9, 2009)
pc-q35-4.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-4.0.1         Standard PC (Q35 + ICH9, 2009)
pc-q35-4.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-3.1           Standard PC (Q35 + ICH9, 2009)
pc-q35-3.0           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
pc-q35-2.12          Standard PC (Q35 + ICH9, 2009)
pc-q35-2.11          Standard PC (Q35 + ICH9, 2009)
pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
isapc                ISA-only PC
none                 empty machine
x-remote             Experimental remote machine

@lbajolet-hashicorp
Copy link
Contributor

lbajolet-hashicorp commented Feb 13, 2023

That looks consistent with the regex provided in the Proxmox docs then, I presume the docs should be updated in the plugin to reflect this, and the API as well since from what I could see the only accepted values are q35, pc-i440fx and pc, where they should only be pc and q35 since the i440fx variants are accepted only if unspecified or with a version suffix.

Since this is the API code checking this, we can't update it directly from this plugin, in the meantime, I'll update the plugin docs to better reflect the accepted alternatives, we can do another pass later if/when the API replicates the values accepted by proxmox/qemu.

I wonder what the version suffixes stand for however, are they related to proxmox versions? qemu versions maybe (probably)?

Thanks for looking into this @sebastian-de.

@sebastian-de
Copy link
Contributor

I wonder what the version suffixes stand for however, are they related to proxmox versions? qemu versions maybe (probably)?

Yes, the versions stand for QEMU releases. Here are the relevant docs: https://www.qemu.org/docs/master/system/qemu-manpage.html#hxtool-0

@halradaideh
Copy link

still facing this issue

506 upload 'Content-Type 'multipart/form-data; boundary=b7eb5bead9ef2cc02886d2ecfdc4adf2428c0b721750acb96fef0257d9e4' not implemented,

@lbajolet-hashicorp
Copy link
Contributor

Hi @halradaideh,

On v1.1.1 of the plugin it is there indeed, we are releasing v1.1.2 of the plugin today, so you will be able to test that on this version and confirm if that is fixed.

@nbensa
Copy link

nbensa commented Mar 7, 2023

Hello, I'm using 1.1.2 and I get 506.

2023/03/07 00:40:26 [TRACE] Found the following "github.com/hashicorp/proxmox" installations: [{/home/zoolook/.config/packer/plugins/github.com/hashicorp/proxmox/packer-plugin-proxmox_v1.1.2_x5.0_linux_amd64 v1.1.2}]

2023/03/07 00:41:11 machine readable: ubuntu-server-jammy.proxmox.ubuntu-server-jammy,error []string{"Error creating VM: error creating VM: 506 upload 'Content-Type 'multipart/form-data; boundary=00fa053d27fae8abff60214a5d6559cc0c1480b60acd6322cc0e0f6314d9' not implemented, error status: (params: map[agent:1 args: boot:c cores:1 cpu:kvm64 description:Packer ephemeral build VM hotplug: ide2:local:iso/ubuntu-22.04.2-live-server-amd64.iso,media=cdrom kvm:true machine:pc memory:1024 name:ubuntu-server-jammy net0:virtio=92:51:32:2E:64:9B,bridge=vmbr0,firewall=false onboot:false ostype:other scsihw:virtio-scsi-pci sockets:1 startup: tags: virtio0:local-lvm:8,format=raw,iothread=false vmid:992204])"}

@tinhtruong
Copy link

I had the same error with version 1.1.2, but it's fixed in 1.1.3.

@nick-holmquist
Copy link
Contributor

nick-holmquist commented Oct 17, 2023

Seeing this with 1.1.5 and PVE 8.0.4

506 upload 'Content-Type 'multipart/form-data; boundary=c6549aba5dba692fe8bc6dd3a622b7f015aad75a653127e8e5f56db00e0d' not implemented

**Update: It appears the 506 comes (in this instance) from the created iso being too small. I had been using some random, small text files just to test. Once I threw some larger files in the cd_files section I now get the following:

501 for data too large

@nick-holmquist
Copy link
Contributor

nick-holmquist commented Oct 18, 2023

**Update
Looks like the 501 for data too large has another open bug: #197

Leaving the above as it helps detail some steps for the 506 error. Again, it appears the 506 comes if the iso is too small in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants