Vagrant: uninitialized constant FileChecksum::Errors (NameError)

Created on 30 Nov 2019  ยท  11Comments  ยท  Source: hashicorp/vagrant

Vagrant version 2.2.6
Virtualbox 6.0
macOS High Sierra (10.13.6)

What I expected: the vagrant box to be added and checksum passed

Steps to reproduce: try to install laravel homestead box using the instructions at
https://laravel.com/docs/5.8/homestead#first-steps

When running the command
vagrant box add laravel/homestead

The following is output:

==> box: Loading metadata for box 'laravel/homestead'
    box: URL: https://vagrantcloud.com/laravel/homestead
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.

1) hyperv
2) parallels
3) virtualbox
4) vmware_desktop

Enter your choice: 3
==> box: Adding box 'laravel/homestead' (v9.0.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/9.0.0/providers/virtualbox.box
    box: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
    box: Calculating and comparing box checksum...
/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/util/file_checksum.rb:65:in `load_digest': uninitialized constant FileChecksum::Errors (NameError)
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/util/file_checksum.rb:30:in `initialize'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/box_add.rb:533:in `new'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/box_add.rb:533:in `validate_checksum'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/box_add.rb:352:in `box_add'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/box_add.rb:283:in `add_from_metadata'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/box_add.rb:118:in `call'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/warden.rb:50:in `call'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/before_trigger.rb:23:in `call'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/warden.rb:50:in `call'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/runner.rb:102:in `block in run'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/runner.rb:102:in `run'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/commands/box/command/add.rb:78:in `execute'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/commands/box/command/root.rb:66:in `execute'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/cli.rb:66:in `execute'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/environment.rb:290:in `cli'
    from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/bin/vagrant:182:in `<main>'
duplicate

Most helpful comment

I had the same issue last night. It appears since the box is so new, a checksum hasn't been generated yet. It also appears that every attempt would discard the downloaded box after failure, so the Vagrant Cloud site would list an inaccurate number of downloads. I agree, #11211 would fix the issue.

My way around the issue was to download the box file manually and trick vagrant into thinking it came from vagrant cloud:
wget https://app.vagrantup.com/laravel/boxes/homestead/versions/9.0.0/providers/virtualbox.box -O homestead-9.0.0.box
Manually add the downloaded box to vagrant:
vagrant box add laravel/homestead homestead-9.0.0.box
Since manually added boxes discard version numbers, manually rename the folder from 0 to 9.0.0:
mv ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0 ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/9.0.0
Ensure laravel-VAGRANTSLASH-homestead/metadata_url contains the vagrant cloud url:

$ cat ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/metadata_url
https://vagrantcloud.com/laravel/homestead

After this, I was able to vagrant up.

All 11 comments

Also having this issue on a Windows 10 machine, #11211 seems to fix this.

Also having this issue on a Windows 10 machine, #11211 seems to fix this.

@mink How does one use the patch #11211?

Also having this issue on a Windows 10 machine, #11211 seems to fix this.

@mink How does one use the patch #11211?

@mink Please check my mention. You can the installer from source as a temporarily solution.

same problem here on a macbook pro 16"

Also having this issue on a Windows 10 machine, #11211 seems to fix this.

@mink How does one use the patch #11211?

@mink Please check my mention. You can the installer from source as a temporarily solution.

Install from source helped on the Mac Os 10.15.1 (19B88)

I had the same issue last night. It appears since the box is so new, a checksum hasn't been generated yet. It also appears that every attempt would discard the downloaded box after failure, so the Vagrant Cloud site would list an inaccurate number of downloads. I agree, #11211 would fix the issue.

My way around the issue was to download the box file manually and trick vagrant into thinking it came from vagrant cloud:
wget https://app.vagrantup.com/laravel/boxes/homestead/versions/9.0.0/providers/virtualbox.box -O homestead-9.0.0.box
Manually add the downloaded box to vagrant:
vagrant box add laravel/homestead homestead-9.0.0.box
Since manually added boxes discard version numbers, manually rename the folder from 0 to 9.0.0:
mv ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0 ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/9.0.0
Ensure laravel-VAGRANTSLASH-homestead/metadata_url contains the vagrant cloud url:

$ cat ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/metadata_url
https://vagrantcloud.com/laravel/homestead

After this, I was able to vagrant up.

Ditto on vagrant box update on macOS Mojave 10.14.6

I had the same issue last night. It appears since the box is so new, a checksum hasn't been generated yet. It also appears that every attempt would discard the downloaded box after failure, so the Vagrant Cloud site would list an inaccurate number of downloads. I agree, #11211 would fix the issue.

My way around the issue was to download the box file manually and trick vagrant into thinking it came from vagrant cloud:
wget https://app.vagrantup.com/laravel/boxes/homestead/versions/9.0.0/providers/virtualbox.box -O homestead-9.0.0.box
Manually add the downloaded box to vagrant:
vagrant box add laravel/homestead homestead-9.0.0.box
Since manually added boxes discard version numbers, manually rename the folder from 0 to 9.0.0:
mv ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0 ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/9.0.0
Ensure laravel-VAGRANTSLASH-homestead/metadata_url contains the vagrant cloud url:

$ cat ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/metadata_url
https://vagrantcloud.com/laravel/homestead

After this, I was able to vagrant up.

I followed these instructions, and I still get

A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

Am I missing something with the metadata_url file? I had to create it and input the url.

I had the same issue last night. It appears since the box is so new, a checksum hasn't been generated yet. It also appears that every attempt would discard the downloaded box after failure, so the Vagrant Cloud site would list an inaccurate number of downloads. I agree, #11211 would fix the issue.
My way around the issue was to download the box file manually and trick vagrant into thinking it came from vagrant cloud:
wget https://app.vagrantup.com/laravel/boxes/homestead/versions/9.0.0/providers/virtualbox.box -O homestead-9.0.0.box
Manually add the downloaded box to vagrant:
vagrant box add laravel/homestead homestead-9.0.0.box
Since manually added boxes discard version numbers, manually rename the folder from 0 to 9.0.0:
mv ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0 ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/9.0.0
Ensure laravel-VAGRANTSLASH-homestead/metadata_url contains the vagrant cloud url:

$ cat ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/metadata_url
https://vagrantcloud.com/laravel/homestead

After this, I was able to vagrant up.

I followed these instructions, and I still get

A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

Am I missing something with the metadata_url file? I had to create it and input the url.

By the way, this does successfully add the box, I just can't fire it up:

$ vagrant box list
laravel/homestead (virtualbox, 9.0.0)
$ vagrant up
A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

I had the same issue last night. It appears since the box is so new, a checksum hasn't been generated yet. It also appears that every attempt would discard the downloaded box after failure, so the Vagrant Cloud site would list an inaccurate number of downloads. I agree, #11211 would fix the issue.
My way around the issue was to download the box file manually and trick vagrant into thinking it came from vagrant cloud:
wget https://app.vagrantup.com/laravel/boxes/homestead/versions/9.0.0/providers/virtualbox.box -O homestead-9.0.0.box
Manually add the downloaded box to vagrant:
vagrant box add laravel/homestead homestead-9.0.0.box
Since manually added boxes discard version numbers, manually rename the folder from 0 to 9.0.0:
mv ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/0 ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/9.0.0
Ensure laravel-VAGRANTSLASH-homestead/metadata_url contains the vagrant cloud url:

$ cat ~/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead/metadata_url
https://vagrantcloud.com/laravel/homestead

After this, I was able to vagrant up.

I followed these instructions, and I still get

A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

Am I missing something with the metadata_url file? I had to create it and input the url.

By the way, this does successfully add the box, I just can't fire it up:

$ vagrant box list
laravel/homestead (virtualbox, 9.0.0)
$ vagrant up
A Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

I got it - you can't just vagrant up - you have to vagrant init laravel/homestead first :-)

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mpontillo picture mpontillo  ยท  3Comments

jazzfog picture jazzfog  ยท  3Comments

Cbeck527 picture Cbeck527  ยท  3Comments

dorinlazar picture dorinlazar  ยท  3Comments

rhencke picture rhencke  ยท  3Comments