Vagrant: [BUG] Vagrant unable to handle (appropriately) http 416 response code

Created on 11 Oct 2016  ·  6Comments  ·  Source: hashicorp/vagrant

Vagrant version

1.8.4

Host operating system

MacOS 10.11.6

Guest operating system

Any

Vagrantfile

# Not related

Steps to reproduce

  1. Start downloading a vagrant box with vagrant box update, realize that network is insanely slow to the server and stop the download.
  2. Check name of tmp file for box under ~/.vagrant.d/tmp/box*
  3. Download box file (as shown in wget progress) from another/faster network and place it in ~/.vagrant.d/tmp/ with the previous tmp file name (from step 2)
  4. Attempt to continue box update with downloaded file by calling vagrant box update one more time

    Expected behavior

Vagrant has the complete file and is able to handle HTTP 416 response (which clearly says that entire file has been downloaded already) and proceeds further

Actual behavior

Vagrant is unable to handle HTTP 416 response and takes it as if it was real error (that is not an error btw).

Comment

That is so ridiculous that 1 - vagrant box download speed is only reasonable from US, from anywhere else it is insanely slow and takes about 3 hours to download 277 MB box and 2 - that vagrant has no way to add box version from file, can only add new box (which will loose relation to previous version) with already downloaded file...

core enhancement has-pr

All 6 comments

Same is on 1.8.6. See attached screenshot.

screen shot 2016-10-11 at 5 43 27 pm

Added PR for this issue with a patch. Tested on named box with "Steps to reproduce" and works as expected.

Heres a quick solution to this issue (well it worked for me anyway):

  • cd ~/.vagrant.d
  • rm -rf tmp/*
  • rm -rf data/machine-index/*
  • re-run your vagrant box command (i.e. vagrant box add laravel/homestead or whatever)

I think it has something to do with a partial download because mine didn't start acting up until a download got messed up part of the way through. After that I get the 416 error no matter what I do. Clearing out the 2 directories listed above did the trick for me.

Please note this fix assumes you don't have any other vagrant boxes on your machine. I.e. a fresh install

Any updates on this issue. It seems to still be a problem.

Fixed via #9729 🎉

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