ddelnano / packer-plugin-xenserver

A builder plugin for Packer.IO to support building XenServer images.
Mozilla Public License 2.0
71 stars 37 forks source link

Crash when lauching packer build only with 0.7.2 #140

Closed jothoma1 closed 1 month ago

jothoma1 commented 1 month ago

Hello i'm trying to use packer with XCP-NG (already use it with VMware) When i try a simple packer build i have a crash : panic: ConfigSpec failed: gob: type cty.Type has no exported fields [recovered] panic: ConfigSpec failed: gob: type cty.Type has no exported fields

I have tried on a Windows machine with packer 1.8.4 and on linux with the latest packer release and it's the same Don't know where to start, anyone can help ? thanks

mtcoffee commented 1 month ago

@jothoma1 after you pointed out in https://github.com/mtcoffee/xcp-ng-packer-examples/issues/1 that it still happens in the latest release, I looked further. The issue is related to the v0.7.2 release dropped yesterday. It looks like @ddelnano and team have been working to improve!

In my case I noticed if the packer file is set to use version = "= v0.7.1" the error is not thrown.

jothoma1 commented 1 month ago

Thanks @mtcoffee you are right the problem is only present with 0.7.2 it works with 0.7.1

ceejatec commented 1 month ago

This is caused by https://github.com/hashicorp/packer-plugin-sdk/issues/187 . The story is complicated, it seems, but the workaround/fix until the Packer team can sort themselves out is for @ddelnano to run packer-sdc fix . in the source directory - this adds a line

replace github.com/zclconf/go-cty => github.com/nywilken/go-cty v1.13.3 // added by packer-sdc fix as noted in github.com/hashicorp/packer-plugin-sdk/issues/187

to go.mod. I've rebuilt packer-builder-xenserver locally with that change and copied it to ~/.config/packer/plugins/github.com/ddelnano/xenserver/packer-plugin-xenserver_v0.7.2_x5.0_linux_amd64, and things are working again.

ddelnano commented 1 month ago

Thanks for reporting this, pointing out the upstream issue and identifying the short term solution! #141 addresses this and I'll create a 7.3 release once that is merged.