API Error running boot command sendkey EOF

Proxmox-Researcher

New Member
Mar 16, 2022
5
0
1
36
Hello,
I'm using the latest Proxmox 8.0.4 6.2.16-15-pve , and while building the VM's with packer I'm getting an error during "Typing boot commands"

Code:
==> proxmox-iso.ubuntu: Creating VM
==> proxmox-iso.ubuntu: No VM ID given, getting next free from Proxmox
==> proxmox-iso.ubuntu: Starting VM
==> proxmox-iso.ubuntu: Waiting 25s for boot
==> proxmox-iso.ubuntu: Typing the boot command
==> proxmox-iso.ubuntu: Error running boot command: Put "https://proxmox-02-01.xxxxx.com:8006/api2/json/nodes/proxmox-02-01/qemu/101/sendkey": EOF
==> proxmox-iso.ubuntu: Stopping VM
==> proxmox-iso.ubuntu: Deleting VM
Build 'proxmox-iso.ubuntu' errored after 2 minutes 6 seconds: Error running boot command: Put "https://proxmox-02-01.xxxxx.com:8006/api2/json/nodes/proxmox-02-01/qemu/101/sendkey": EOF

What I can say after keeping an eye on the issue for 2 months :
  • It happens randomly (i.e sometimes works sometimes not)
  • It's not related to the system, I'v been building different systems, be it wnidows, linux etc, and it happens with different "boot commands"
  • It's not related also to the Proxmox version since I'v had the same problem also with proxmox v6 or v7.
  • The proxmox is on a remote server and I'm connecting through wireguard, no idea if that has an impact with the problem.

Would be interesting to understand why it's happening and how to fix it.
 
Hi,


I would use `-debug` with packer in order to get more information,e.g.,:
Bash:
 packer build -debug -var-file=<filename> .

Could you tell us what key you want to send to the VM in order to see if there is another/easiest way to do that instead of from API?
 
Hi,
I have opened upstream the issue as well, https://github.com/hashicorp/packer-plugin-proxmox/issues/237 , there's more detail / debug on the second log, but just in case :
Bash:
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 Plugin address: unix /tmp/packer-plugin4053739862
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 Waiting for connection...
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 Serving a plugin connection...
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 [TRACE] starting builder iso
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 Number of sockets 0 is too small, using default: 1
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 OS not set, using default 'other'
2023/10/12 10:12:06 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:06 Disk 0 cache mode not set, using default 'none'
2023/10/12 10:12:07 Build debug mode: false
2023/10/12 10:12:07 Force build: false
2023/10/12 10:12:07 On error:
2023/10/12 10:12:07 Waiting on builds to complete...
2023/10/12 10:12:07 Starting build run: proxmox-iso.ubuntu-server
proxmox-iso.ubuntu-server: output will be in this color.
2023/10/12 10:12:07 Running builder:
2023/10/12 10:12:07 [INFO] (telemetry) Starting builder proxmox-iso.ubuntu-server

2023/10/12 10:12:07 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:07 using token auth
2023/10/12 10:12:07 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:07 No URLs were provided to Step Download. Continuing...
==> proxmox-iso.ubuntu-server: Creating VM
==> proxmox-iso.ubuntu-server: No VM ID given, getting next free from Proxmox
==> proxmox-iso.ubuntu-server: Starting VM
==> proxmox-iso.ubuntu-server: Waiting 20s for boot
==> proxmox-iso.ubuntu-server: Typing the boot command
2023/10/12 10:12:35 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:35 [INFO] Waiting 2s
2023/10/12 10:12:37 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:37 [INFO] Waiting 2s
2023/10/12 10:12:44 packer-plugin-proxmox_v1.1.5_x5.0_linux_amd64 plugin: 2023/10/12 10:12:44 [INFO] Waiting 5s
==> proxmox-iso.ubuntu-server: Error running boot command: Put "https://proxmox-02-01.upstream.domain.com:8006/api2/json/nodes/proxmox-02-01/qemu/102/sendkey": EOF
==> proxmox-iso.ubuntu-server: Stopping VM
==> proxmox-iso.ubuntu-server: Deleting VM
2023/10/12 10:12:55 [INFO] (telemetry) ending proxmox-iso.ubuntu-server
==> Wait completed after 48 seconds 224 milliseconds
2023/10/12 10:12:55 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2023/10/12 10:12:55 machine readable: proxmox-iso.ubuntu-server,error []string{"Error running boot command: Put \"https://proxmox-02-01.upstream.domain.com:8006/api2/json/nodes/proxmox-02-01/qemu/102/sendkey\": EOF"}
==> Builds finished but no artifacts were created.
2023/10/12 10:12:55 [INFO] (telemetry) Finalizing.
Build 'proxmox-iso.ubuntu-server' errored after 48 seconds 224 milliseconds: Error running boot command: Put "https://proxmox-02-01.upstream.domain.com:8006/api2/json/nodes/proxmox-02-01/qemu/102/sendkey": EOF

==> Wait completed after 48 seconds 224 milliseconds

==> Some builds didn't complete successfully and had errors:
--> proxmox-iso.ubuntu-server: Error running boot command: Put "https://proxmox-02-01.upstream.domain.com:8006/api2/json/nodes/proxmox-02-01/qemu/102/sendkey": EOF

==> Builds finished but no artifacts were created.
2023/10/12 10:12:56 waiting for all plugin processes to complete...
2023/10/12 10:12:56 /home/user/.config/packer/plugins/github.com/hashicor

The API Call is done automatically by the packer proxmox plugin, it is what's being selected automatically to execute the boot commands and I'm sure that regardless of the key it may happen, because I'v seen the same problem with at least 5 or 6 different Linux based OS that of course have different boot commands generally speaking.


I'm not saying that it has nothing to do at all, because for example by changing a wait5 to wait4 I was able to have more stable builds.
I took a look also at the source code of the plugin and this is the part which is related to the problem :
It's using the commandTyper interface and Sendkey call.
https://github.com/hashicorp/packer.../proxmox/common/step_type_boot_command.go#L34
Code:
type commandTyper interface {
    Sendkey(*proxmox.VmRef, string) error
}

Then it triggers the error due to EOF
err := fmt.Errorf("Error running boot command: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt }

You can take a look also at the function here : https://github.com/hashicorp/packer...lder/proxmox/common/bootcommand_driver.go#L26

Since the EOF usually is a connectivity issue, I'v already excluded my network having issues or the remote proxmox instance having connectivity issues, which mainly leaves only either the proxmox plugin itself or the Proxmox API. There was one suggestion that the problem was solved by switching to HTTP, so maybe that has an impact as well, but I'm not sure.

Thank you for the shown interest on my issue.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!