Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upload box with vagrant cloud publish, post-auth, request fail with public_id / registry cannot be blank #13584

Open
eldipa opened this issue Jan 27, 2025 · 4 comments

Comments

@eldipa
Copy link

eldipa commented Jan 27, 2025

Debug output

debug.log

Expected behavior

I would be expecting to create/upload the box.

Actual behavior

After running vagrant cloud publish ..., there is a request to Vagrant Cloud that fails with public_id: cannot be blank.; registry: cannot be blank

You are about to publish a box on Vagrant Cloud with the following options:
eldipa-seclab/ubuntu2310-checksum:   (v1) for provider 'virtualbox'
Automatic Release:     true
Box Architecture:      amd64
Do you wish to continue? [y/N]y
Saving box information...
Failed to create box eldipa-seclab/ubuntu2310-checksum
Vagrant Cloud request failed - public_id: cannot be blank.; registry: cannot be blank

Reproduction information

I login using hcp, get the token and call vagrant cloud publish .... as follows:

hcp auth login --client-id=....  --client-secret=.... 
export VAGRANT_CLOUD_TOKEN="$(hcp auth print-access-token)"

BOX=ubuntu2310-checksum ; vagrant cloud publish -C sha256 -c "$(sha256sum $BOX.box | awk { print })" --release -a amd64 --direct-upload --debug "eldipa-seclab/$BOX" 1 virtualbox $BOX.box

Where ubuntu2310-checksum.box is the filename of the box to be uploaded to eldipa-seclab/ubuntu2310-checksum where eldipa-seclab is a registry created yesterday (via https://portal.cloud.hashicorp.com)

Vagrant version

2.4.3

Host operating system

Ubuntu

Guest operating system

Ubuntu

Steps to reproduce

  1. hcp auth login --client-id=.... --client-secret=....
  2. export VAGRANT_CLOUD_TOKEN="$(hcp auth print-access-token)"
  3. BOX=ubuntu2310-checksum ; vagrant cloud publish -C sha256 -c "$(sha256sum $BOX.box | awk { print })" --release -a amd64 --direct-upload --debug "eldipa-seclab/$BOX" 1 virtualbox $BOX.box
@danilapog
Copy link

Hello!
Any update about this?
I have the same issue

@prof-ninjason
Copy link

Ok, I got it to work by removing the ";" in my VAGRANT_CLOUD_TOKEN.
Then the "awk" command changed to this "awk '{print $1}'".

@danilapog
Copy link

danilapog commented Feb 27, 2025

Ok, I got it to work by removing the ";" in my VAGRANT_CLOUD_TOKEN. Then the "awk" command changed to this "awk '{print $1}'".

Hey!

Sorry, did you mean that work when you publish via hcp API?

I can also confirm that publishing via API works, like described in this issue

But It would be better to use vagrant cloud cli

@prof-ninjason
Copy link

Ok, I got it to work by removing the ";" in my VAGRANT_CLOUD_TOKEN. Then the "awk" command changed to this "awk '{print $1}'".

Hey!

Sorry, did you mean that work when you publish via hcp API?

I can also confirm that publishing via API works, like described in this issue

But It would be better to use vagrant cloud cli

Yes, I used the following to successfully upload my 14G file:

BOX=kali-purple
export VAGRANT_CLOUD_TOKEN="$(hcp auth print-access-token)"
vagrant cloud publish -C sha512 -c "$(sha512sum $BOX/$BOX.box | awk '{print $1}')" --release -a amd64 --no-direct-upload "prof-ninjason/$BOX" 1.0.1 virtualbox $BOX/$BOX.box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants