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

file_checksum.rb:65:in `load_digest': uninitialized constant FileChecksum::Errors (NameError) #11179

Closed
kwaping opened this issue Nov 6, 2019 · 7 comments
Assignees
Labels
Milestone

Comments

@kwaping
Copy link

@kwaping kwaping commented Nov 6, 2019

Vagrant version

2.2.6

Host operating system

Mac OSX 10.14.6 Mojave

Vagrantfile

Vagrant.configure("2") do |config|

  config.vm.synced_folder ".", "/vagrant", disabled: true
  config.vm.box = "yzgyyang/macOS-10.14"
  config.vm.network "private_network", ip: "XXXXXXXX"

end

Debug output

https://gist.github.com/kwaping/928f63e18df946eac9a1ed63e9214f47

Expected behavior

What should have happened?
Box should have downloaded, passed checksum, and updated.

Upon error, it would be nice if the downloaded file was retained for retries. Each time I get this error, I have to go through the whole (long!) download process.

Actual behavior

What actually happened?
Got a stack trace ending with this line (snipped):

[...]/vagrant-2.2.6/lib/vagrant/util/file_checksum.rb:65:in `load_digest': uninitialized constant FileChecksum::Errors (NameError)

Steps to reproduce

  1. install yzgyyang/macOS-10.14 v10.14.4
  2. update it to v10.14.6
  3. observe error after download completes

References

None that I could find.

@briancain briancain added bug core labels Nov 6, 2019
@briancain briancain added this to the 2.2.7 milestone Nov 6, 2019
@briancain briancain self-assigned this Nov 7, 2019
@briancain briancain added the has-pr label Nov 7, 2019
@briancain briancain closed this in 44c6f65 Nov 12, 2019
briancain added a commit that referenced this issue Nov 12, 2019
…ksum-util

Fixes #11179: Ensure Vagrant::Errors are loaded in file_checksum util
gitebra pushed a commit to gitebra/vagrant that referenced this issue Nov 12, 2019
* commit '2ea9323d0b1842023b84f3daa71b1b247d6ae29d':
  Update CHANGELOG
  Update CHANGELOG
  Update CHANGELOG
  Fixes hashicorp#10741: Check if update is available locally (hashicorp#11188)
  Update i18n dependency constraints
  Update CHANGELOG
  Update CHANGELOG
  website - add -moz-osx-font-smoothing for smooth firefox osx fonts
  Fixes hashicorp#11137: Fixup how cloud publish handles its arguments
  Fixes hashicorp#11179: Ensure Vagrant::Errors are loaded in file_checksum util
  Fixes hashicorp#8058: Improve wording for config.ssh.insert_key docs
  Fixes hashicorp#11173: Show guest name in hostname erorr message
  Fixes hashicorp#11168: Fix Ubuntu version in getting started guide
  Ensure empty message values are properly formatted
  Update UI to properly retain newlines when adding prefix
  Bump rspec-its dependency
  gemspec: drop rubyforge_project, it is EOL
@Redsandro

This comment has been minimized.

Copy link

@Redsandro Redsandro commented Nov 22, 2019

I have this error without upgrading anything, just installing.

Host: Linux Mint 19.2
Vagrant: 2.2.6

Command:

$ mkdir -p yzgyyang/macOS-10.14 && cd $_ && vagrant init $_ && vagrant up

Output:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'yzgyyang/macOS-10.14' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'yzgyyang/macOS-10.14'
    default: URL: https://vagrantcloud.com/yzgyyang/macOS-10.14
==> default: Adding box 'yzgyyang/macOS-10.14' (v10.14.6) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/yzgyyang/boxes/macOS-10.14/versions/10.14.6/providers/virtualbox.box
    default: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
    default: 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/lib/vagrant/action/builtin/handle_box.rb:82:in `handle_box'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/handle_box.rb:42:in `block in call'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/handle_box.rb:36:in `synchronize'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/action/builtin/handle_box.rb:36: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/warden.rb:121:in `block in finalize_action'
	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/lib/vagrant/action/builtin/call.rb:53: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/builtin/after_trigger.rb:26: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/plugins/providers/virtualbox/action/check_virtualbox.rb:26: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/lib/vagrant/machine.rb:238:in `action_raw'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/machine.rb:209:in `block in action'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/environment.rb:613:in `lock'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/machine.rb:195:in `call'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/machine.rb:195:in `action'
	from /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/lib/vagrant/batch_action.rb:86:in `block (2 levels) in run'
@Redsandro

This comment has been minimized.

Copy link

@Redsandro Redsandro commented Nov 22, 2019

After applying your fix and re-downloading the file, I get the following error:

The specified checksum type is not supported by Vagrant: .
Vagrant supports the following checksum types:

md5, sha1, sha256

Why does this happen? Surely this image works for @yzgyyang.

@briancain

This comment has been minimized.

Copy link
Member

@briancain briancain commented Nov 22, 2019

HI @Redsandro - This is a bug that is currently fixed in a pull request here: #11211

For now, you'll want to roll back your version of Vagrant since I don't believe the previous version has these issues.

@gmartinez

This comment has been minimized.

Copy link

@gmartinez gmartinez commented Nov 30, 2019

Hi there, my 2cts. next;

I got vagrant 2.2.6 installed under Windows, run into this issue while trying to add a box. After downgrading to previous versions (tried all up to 1.9.x) in all cases I got the message @Redsandro stated got after patching, which @briancain stated is an open issue as well (see above).

So I guess what I am trying to say is that rolling back to previous versions did not cut it for me.

What I ended up doing instead (kept version 2.2.6), since the checksum validation happens when vagrant does the download of the box file, I downloaded the one I needed manually and then pointed the "box add" process to that local file.

As a disclaimer; I am new to vagrant so I might be missing something, yet in any case I thought this might be useful to someone else out there.

Cheers.

@yzgyyang

This comment has been minimized.

Copy link

@yzgyyang yzgyyang commented Dec 1, 2019

@kwaping Thanks for reporting the issue! The box stopped working for me after I updated Vagrant, cause I didn't put a checksum when uploading the box. For your particular use of the box yzgyyang/macOS, I've updated the release with a vaild checksum.

@Redsandro

This comment has been minimized.

Copy link

@Redsandro Redsandro commented Dec 22, 2019

Thank you @yzgyyang 👍

@hashibot

This comment has been minimized.

Copy link

@hashibot hashibot bot commented Jan 28, 2020

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.

@hashibot hashibot bot locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.