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

An unexpected error occurred: Vagrant Cloud request failed - Method Not Allowed #13571

Open
mconigliaro opened this issue Jan 10, 2025 · 13 comments

Comments

@mconigliaro
Copy link

mconigliaro commented Jan 10, 2025

This is what happens when I try to download a box:

❯ vagrant up
Bringing machine 'default' up with 'vmware_desktop' provider...
==> default: Box 'gutehall/ubuntu24-10' could not be found. Attempting to find and install...
    default: Box Provider: vmware_desktop, vmware_fusion, vmware_workstation
    default: Box Version: 2024.10.11
==> default: Loading metadata for box 'gutehall/ubuntu24-10'
    default: URL: https://vagrantcloud.com/api/v2/vagrant/gutehall/ubuntu24-10
==> default: Adding box 'gutehall/ubuntu24-10' (v2024.10.11) for provider: vmware_desktop (arm64)
    default: Downloading: https://vagrantcloud.com/gutehall/boxes/ubuntu24-10/versions/2024.10.11/providers/vmware_desktop/arm64/vagrant.box
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

I haven't used Vagrant in years, but after a lot of digging, I think I need to log in to download boxes now. This is what happens when I try that:

❯ vagrant cloud auth login
In a moment we will ask for your username and password to HashiCorp's
Vagrant Cloud. After authenticating, we will store an access token locally on
disk. Your login details will be transmitted over a secure connection, and
are never stored on disk locally.

If you do not have an Vagrant Cloud account, sign up at
https://www.vagrantcloud.com

Vagrant Cloud username or email: <redacted>
Password (will be hidden):
Token description (Defaults to "Vagrant login from Mikes-Mac-mini.local"):
An unexpected error occurred: Vagrant Cloud request failed - Method Not Allowed
@mconigliaro
Copy link
Author

When I try to make the request myself via httpie:

Screenshot 2025-01-09 at 9 40 38 PM

@eugen-zwinger-protos
Copy link

I have the same issue. Tried to downgrade vagrant first, but had no luck there.

Using Apple silicon MacOS 15.2, reproduced on vagrant 2.4.3 and 2.4.1

@anitvam
Copy link

anitvam commented Jan 10, 2025

I have the same issue on local machine running Manjaro Linux,
and on Github Action workflows running Ubuntu Lastest.

Yesterday worked just fine on both of them...

@eugen-zwinger-protos
Copy link

I've been able to work around it by manually downloading the box files and importing them afterwards with
vagrant box add debian/jessie64 debian-jessie64-8.9.0.box

Got it from here initially:
https://gist.github.com/firmanelhakim/77b6ee7fb50883155eeefc9e0dc10b9b

Hope it helps as a workaround for someone.

@carlosefr
Copy link
Contributor

carlosefr commented Jan 10, 2025

I'm seeing the same issue. Cannot download boxes, and login does not work.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/ubuntu-24.04' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'bento/ubuntu-24.04'
    default: URL: https://vagrantcloud.com/api/v2/vagrant/bento/ubuntu-24.04
==> default: Adding box 'bento/ubuntu-24.04' (v202404.26.0) for provider: virtualbox (amd64)
    default: Downloading: https://vagrantcloud.com/bento/boxes/ubuntu-24.04/versions/202404.26.0/providers/virtualbox/amd64/vagrant.box
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

Now, I don't see v202404.26.0 at https://portal.cloud.hashicorp.com/vagrant/discover/bento/ubuntu-24.04, so that might explain why the box fails to download in the first place. Vagrant is looking up what's the latest version for this box, finds something, then redirects to the new portal and that something isn't there.

However, the box bento/debian-12 also fails to download, and I could manually download from the website the same version (v202407.22.0) that vagrant is attempting to download and failing.

@mhils
Copy link

mhils commented Jan 10, 2025

We are also hitting errors in CI:

vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'generic/ubuntu2204' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'generic/ubuntu2204'
    default: URL: https://vagrantcloud.com/api/v2/vagrant/generic/ubuntu2204
==> default: Adding box 'generic/ubuntu2204' (v4.3.[12](https://github.com/kubernetes-sigs/security-profiles-operator/actions/runs/12707458320/job/35427345459?pr=2667#step:5:13)) for provider: virtualbox (amd64)
    default: Downloading: https://vagrantcloud.com/generic/boxes/ubuntu2204/versions/4.3.12/providers/virtualbox/amd64/vagrant.box

Progress: 0% (Rate: 0*/s, Estimated time remaining: --:--:--)
Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
    default: Calculating and comparing box checksum...
The checksum of the downloaded box did not match the expected
value. Please verify that you have the proper URL setup and that
you're downloading the proper file.

Expected: 10c2a460ef7dde[13](https://github.com/kubernetes-sigs/security-profiles-operator/actions/runs/12707458320/job/35427345459?pr=2667#step:5:14)cdf5ed2b8d8cca657a7fadcb1486a4b241d8edd637a02e8e
Received: ff735a9f17075145db8378f5884e35bd98f19a7ac828a1d9157021106a035809

@delanni
Copy link

delanni commented Jan 13, 2025

I've tested a few of the linked images, and Vagrant Cloud seems to be functioning OK now. (also including our problematic image @ ubuntu/jammy64

@anoopcs9
Copy link

We are still facing errors during vagrant up.

$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Box 'generic/centos9s' could not be found. Attempting to find and install...
    default: Box Provider: libvirt
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'generic/centos9s' (v0) for provider: libvirt
    default: Downloading: https://vagrantcloud.com/generic/centos9s
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):

bsdtar: Error opening archive: Unrecognized archive format

@mconigliaro
Copy link
Author

@anoopcs9 run vagrant up --debug to find the location of the downloaded box file, then open it in a text editor. Is it an HTML file? Open that HTML file in a web browser. Does it bring you to log in page? Then you probably need to run vagrant cloud auth login.

@lnussbaum
Copy link

I had a CI job that started on 2025-01-09T16:19:15Z, involved downloading an image from a Vagrant registry, and worked fine. the same job failed 24 hours later.

Regarding ubuntu/jammy64, I also encounter issues with that image, so I'm surprised that you don't. For example, when checking for box updates, vagrant does:

 INFO subprocess: Starting process: ["/usr/bin/curl", "-q", "--fail", "--location", "--max-redirs", "10", "--verbose", "--user-agent", "Vagrant/2.3.8.dev (+https://www.vagrantup.com; ruby3.1.2)", "-H", "Accept: application/json", "-H", "Authorization: Bearer *****", "--output", "/tmp/vagrant-lucas-905189/vagrant-load-metadata20250113-905189-c6dk6s", "https://vagrantcloud.com/ubuntu/jammy64"]

I suppose that this used to return a JSON doc (based on the Accept:) but now returns an HTML page.

@anoopcs9
Copy link

@anoopcs9 run vagrant up --debug to find the location of the downloaded box file, then open it in a text editor. Is it an HTML file? Open that HTML file in a web browser. Does it bring you to log in page? Then you probably need to run vagrant cloud auth login.

I don't have the box downloaded yet. It fails while attempting to download at the first place.

$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.

$ cat Vagrantfile 
Vagrant.configure("2") do |config|
  config.vm.box = "generic/centos9s"
end

$ vagrant up --debug 2> vagrant_up_debug
Bringing machine 'default' up with 'libvirt' provider...
==> default: Box 'generic/centos9s' could not be found. Attempting to find and install...
    default: Box Provider: libvirt
    default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'generic/centos9s' (v0) for provider: libvirt
    default: Downloading: https://vagrantcloud.com/generic/centos9s

See debug logs vagrant_up_debug.txt

@lnussbaum
Copy link

After further debug, this looks like a change introduced in HCP Vagrant Registry after 2025-01-09, that broke Vagrant versions before 2.4.0. I could confirm that everything works fine with Vagrant 2.4.0 (and later), but fails to work with Vagrant 2.3.7 (and earlier).
The root cause is that Vagrant 2.3.7 uses the equivalent of curl --location --verbose -H "Accept: application/json" https://vagrantcloud.com/debian/bookworm64 to fetch the box metadata, but this no longer returns a JSON document.
Vagrant 2.4.0 uses https://vagrantcloud.com/api/v2/vagrant/debian/bookworm64 instead.

I don't know if this change is intentional. I opened a ticket on HashiCorp's ZenDesk and will report back here.

@lnussbaum
Copy link

TL; DR: HashiCorp support says "you need to update the Vagrant version if you want to use HCP Vagrant boxes"

Long version:

  • I reported the issue and mentioned "I would like to continue using Vagrant 2.3.7 for legal reasons."
  • HashiCorp support replied saying it works with 2.4.1, and "I would suggest you update to the latest Vagrant version and try again."
  • I replied:

I confirm that it works with Vagrant 2.4.0, but I am not able to move to Vagrant 2.4.0 for legal reasons (Business Software License).
Does your message mean that HCP stops supporting Vagrant before 2.4.0 ?

  • HashiCorp support replied:

My message means that you need to update the Vagrant version if you want to use HCP Vagrant boxes.
Vagrant is OSS tool: https://github.com/hashicorp/vagrant
We do support only the HCP Vagrant (former Vagrant Cloud). We do support the only functionalities HCP Vagrant provides and the boxes from Hashicorp family: https://portal.cloud.hashicorp.com/vagrant/discover/hashicorp
We do not support:

  • Vagrant OSS issues
  • Vagrant provider issues
  • Issues with specific user's 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

8 participants