hashicorp / hashicorp/packer-plugin-vagrant

vagrant-registry: Cannot pass checksum while uploading vagrant box

Open
#133 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
16
Forks
28
PR merge metrics
No merged PRs in 30d

Description

#### Overview of the Issue

Cannot pass checksum while uploading vagrant box

#### Reproduction Steps

Steps to reproduce this issue

```hcl
# Upload the box to Vagrant Registry
post-processor "vagrant-registry" {
client_id = "${var.hcp_client_id}"
client_secret = "${var.hcp_client_secret}"
box_tag = "utm/${var.box_name}"
version = "${var.version}"
architecture = "${var.os_arch == "x86_64" ? "amd64" : var.os_arch == "aarch64" ? "arm64" : var.os_arch}"
# There is no way to pass , check sum generated from previous steps, please provide some way
# So it is hard coded out of no choice
box_checksum = "sha512:989b3083771a68e55d08851af0be122c2b3f5efc0eb48ed1385cafb650ae1ec9b073d9434f8ff3904f828f9e80791ff39c5f6a15960fd1d5cf7252da6e0c52b7"
}
```

Even with box_checksum is passed in proper format , the build just fails with error

```bash
error: Failure creating new architecture: checksum: value: checksum must not be set when type is NONE
```

From debugging, I found the issue is not with the vagrant plugin , but with packer-sdk. I'm reporting here because this is where users consume those models from sdk.
Issue happens here : https://github.com/hashicorp/packer-plugin-vagrant/blob/053b1ca97eed3361186ae65940bb56fa978e4eec/post-processor/hcp-vagrant-registry/step_create_architecture.go#L110

### Plugin and Packer version

Packer v1.11.1
packer-plugin-vagrant_v1.1.6

### Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.

```bash
sw_vers
ProductName: macOS
ProductVersion: 14.6.1
BuildVersion: 23G93
```

### Log Fragments and crash.log files

Contributor guide

Open the contributing guide

Research direction

Start at post-processor/hcp-vagrant-registry/step_create_architecture.go around line 110 and reproduce the checksum failure with the provided Packer and plugin versions. Trace the architecture model validation into packer-sdk, then verify that a supplied checksum is accepted without the “checksum must not be set when type is NONE” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.