Open paginabianca opened 4 years ago
I had the time to look around a bit and found that the code that causes this error is in proxmox-api-go/proxmox/session.go and was merged in #9587.
This code sends an empty API request when the only change that is applied to the VM template in step_finalize_template.go
is to set the VM template description to "".
I am not sure what would be the best way to fix this since the two lines
if v != "" {
vals.Set(k, v)
}
are probably there for a reason.
I could just delete the if statement or set the template description to " " in step_finalize_template.go
when template_description
is not set but neither option seems like a good solution.
Nice find! I'd say that is a bug. It is only correct to ignore empty values if it was previously not empty. I added a comment on the upstream PR: https://github.com/Telmate/proxmox-api-go/pull/76 I think the appropriate thing here would be to roll back that change upstream.
Overview of the Issue
When trying to build a VM template with Packer version 1.6.1-dev (build based on the current master branch) I get the following error
I think this is caused by a PUT request without any options sent to the Proxmox REST API. During the
finalize_template_step
the changes that have to be applied to the VM are stored inside thechanges
map. Using the same template as provided below, the only thing in that map should be the description.I'm not sure how to fix this since I'm pretty much new to golang and don't understand every piece of code.
Reproduction Steps
This should work with any template file as long as
cloud_init
,template_name
andtemplate_description
are not set.Packer version
1.6.1-dev based on the current master branch
Simplified Packer Buildfile
The error occurred with this buildfile but it should be reproducible with any buildfile as long as
cloud_init
,template_name
andtemplate_description
are not set.Operating system and Environment details
This was tested on an Archlinux LXC running Kernel: 5.4.44-2-pve OS, Architecture, and any other information you can provide about the environment.
Log Fragments and crash.log files
Here is the important part of the log