Vagrant up fails with "HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)"

I already had trouble with vagrant before (when downloading the box was slow, which look like a known vagrant issue), but now it fails to download it at all:

 $ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Box 'discourse-16.04' 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 'discourse-16.04' (v0) for provider: libvirt
    default: Downloading: https://www.dropbox.com/s/2132770g1e05c6d/discourse.box?dl=1
==> default: Box download is resuming from prior download progress
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

Any ideas? Can I maybe download the box manually and place it somewhere?

PS: I tried this on a stable 100 mbits cable connection (no wifi), so that shouldn’t be the problem.

Here’s a workaround I came up with:

First, download the box manually:
wget -N -O /opt/discourse.box https://www.dropbox.com/s/2132770g1e05c6d/discourse.box?dl=1

Then, edit Vagrantfile:

# Replace 
  conf.vm.box_url = "https://www.dropbox.com/s/2132770g1e05c6d/discourse.box?dl=1"
# with
  conf.vm.box_url = "file:///opt/discourse.box"

Now, vagrant up will use the downloaded box.

Note: You have to re-download the image from time to time. The -N option signals wget to only download the box if it has changed.

3 Likes

It’s faster to download the box using aria2 with 5 connections (seems to be Dropbox’ maximum):

aria2c -x5 -o /opt/discourse.box https://www.dropbox.com/s/2132770g1e05c6d/discourse.box\?dl\=1
2 Likes