cirruslabs / packer-plugin-tart

Packer builder for Tart VMs
https://developer.hashicorp.com/packer/plugins/builders/tart
Mozilla Public License 2.0
68 stars 17 forks source link

packer build templates/vanilla-sequoia.pkr.hcl failed with missing config.json #168

Closed eecsmap closed 2 months ago

eecsmap commented 2 months ago

Failed when running: packer build templates/vanilla-sequoia.pkr.hcl

==> tart-cli.tart: Cleaning up virtual machine...
    tart-cli.tart: failed to open lock file file:///Users/cm/.tart/vms/sequoia-vanilla/config.json: No such file or directory
edigaryev commented 2 months ago

I've tried reproducing this on macOS Sequoia 15.0 host to no avail.

Is there a chance that some other process is deleting the sequoia-vanilla VM while the Packer one is running? E.g. this could happen when building a second VM that has a vm_name directive with the same value.

eecsmap commented 2 months ago
packer build templates/vanilla-sequoia.pkr.hcl
tart-cli.tart: output will be in this color.

==> tart-cli.tart: Creating virtual machine...
    tart-cli.tart: Using cached *.ipsw file...
    tart-cli.tart: Installing OS...
    tart-cli.tart: 0%
    tart-cli.tart: Error: A software update is required to complete the installation. Installation requires a software update.
==> tart-cli.tart: Cleaning up virtual machine...
    tart-cli.tart: failed to open lock file file:///Users/cm/.tart/vms/sequoia-vanilla/config.json: No such file or directory
Build 'tart-cli.tart' errored after 752 milliseconds 150 microseconds: Failed to create a VM: Bad exit status: 1

also I have the system:

macos-image-templates % packer plugins installed
/Users/cm/.config/packer/plugins/github.com/cirruslabs/tart/packer-plugin-tart_v1.13.0_x5.0_darwin_arm64
macos-image-templates % sw_vers
ProductName:            macOS
ProductVersion:         14.6.1
BuildVersion:           23G93
edigaryev commented 2 months ago

Thanks for posting some more details!

I think the reason for the Packer build failure is this line:

Error: A software update is required to complete the installation. Installation requires a software update.

As for the Cleaning up virtual machine and failed to open lock file — this is purely cosmetic. I've created two PRs below to address these UX issues:

eecsmap commented 2 months ago

Just FYI. I reimage the machine with macOS 15.0 then the issue is gone. It seems only show up in my macOS 14+ box.