Vagrant: 1.8.7 fails to download or update boxes

Created on 7 Nov 2016  ·  20Comments  ·  Source: hashicorp/vagrant

Just upgraded to 1.8.7 (via brew cask initially, but I've tried after a manual download and install from the website as well), and vagrant can't download or update boxes. The relevant log entry seems to be about curl.

DEBUG subprocess: stderr: dyld: Library not loaded: @rpath/libcurl.4.dylib
  Referenced from: /opt/vagrant/embedded/bin/curl
  Reason: Incompatible library version: curl requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 5
 WARN downloader: Downloader exit code: 5

Vagrant version

Vagrant 1.8.7

Host operating system

OS X 10.11.6

Guest operating system

Arch

Debug output

Not mine, but it's already posted and is the same:
https://groups.google.com/d/msg/vagrant-up/RdC6AXRWjQE/JEIHXiaxAgAJ

Expected behavior

Box added or updated from Atlas.

Actual behavior

Fails to download or update box.

The box 'ubuntu/trusty64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/ubuntu/trusty64"]
Error:

Steps to reproduce

  1. vagrant init ubuntu/trusty64
  2. vagrant up
bug hosdarwin installer

Most helpful comment

I just sudo rm -rf /opt/vagrant/embedded/bin/curl and it works now. It's looked like vagrant can fall back to system's curl.

All 20 comments

Related to #7970 I believe...

Yeah the workaround stated in #7970 works

I just sudo rm -rf /opt/vagrant/embedded/bin/curl and it works now. It's looked like vagrant can fall back to system's curl.

@jenhsun thank you, that worked for me!

Same here. Identical problem was just rebuilding my system (moving to a new one, actually).
Googling around I saw some windows folks have this issue as well. Simply sudo rm /opt/vagrant/embedded/bin/curl solves the issue.

I did some further root cause analysis on this. It appears the embedded curl is not actually referencing the local (rpath) based libcurl.4.dylib. So it blows up for me on El Capitan. In my case I solved it by replacing the vagrant embedded copy of curl and curl-config with a bash script like so:

#!/bin/bash

unset DYLD_LIBRARY_PATH
unset LD_LIBRARY_PATH

/usr/local/opt/curl/bin/curl "$@"

I think the C build options provided to ./configure; make; make install for the Vagrant embedded tools are not right so the dynamic library linkages are bogus.

@megahall You are correct. I was tracking down the root cause today and found an issue with the install_name_tool usage that was causing the problem. Fix is being tested now, and should be merged in shortly. Cheers!

Came across this issue just now after upgrading to 1.8.7, confirmed the workaround works for me as well.

Thanks for the quick response, hope to get the update soon :)

I can confirm, the workaround worked for me too.

I'm having the exact same problem now on MacOS

It even fails when adding boxes manually:

$ vagrant box add centos-7-1-1 CentOS-7-x86_64-Vagrant-1610_01.VirtualBox.box

==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos/7' (v0) for provider: 
    box: Unpacking necessary files from: file:///Volumes/Projects/Projects/temp/CentOS-7-x86_64-Vagrant-1610_01.VirtualBox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

(And there's no error message)

@chatterbeak
Remember to remove /opt/vagrant/embedded/bin/curl like I said before. And do
$vagrant box add centos/7
That's it. It will show you options below:

1) libvirt
2) virtualbox
3) vmware_fusion
4) vmware_workstation

If you need to debug it in more detail use export VAGRANT_LOG=debug.

I just ran into this issue as well. The workaround did the trick!

Please please please see about pushing out a 1.8.8 release ASAP. The number of issues and pings I'm getting about this is reaching a fever pitch, and I think I've now closed out at least twenty or so issues/tickets concerning this...

Until the next release, first-time use of Vagrant on macOS is broken if a user grabs the latest version.

this worked for me too 👍 .

Piggybacking off of what @geerlingguy said, this was the case for me too. I am persistent...but I am sure that many others are not. Definitely should see about getting this fixed ASAP as it is quite off-putting and not much out there besides this thread on what the problem is or how to fix it.

Just ran into this as well. The recommended workaround worked for me.

Thank you.

My concern is that, with default settings, there is no real indication of what actually happened during the failure. All it said was

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

with seemingly no further error message or context.

It was only when a co-worker recommended re-running with VAGRANT_LOG=debug that I started getting the actually relevant error message

DEBUG subprocess: stderr: dyld: Library not loaded: @rpath/libcurl.4.dylib
  Referenced from: /opt/vagrant/embedded/bin/curl
  Reason: Incompatible library version: curl requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0

I hope that there can be a fix or at least some more informative messaging for future users who encounter this. As far as I know, I'm running pretty close to a vanilla out-of-the-box install of everything relevant (OSX, brew, Vagrant) and the Vagrantfile in question was working fine for other co-workers quite recently. That leads me to believe this error could be a pretty common occurrence, so I hope it can be addressed soon.

Thank you again.

@chrisroberts I hate to post on a closed issue, but until Vagrant 1.8.8 is released there will continue to be many mac OS users who's first impression of Vagrant is "requires only minimal configuration and tweaking."

To the fortunate macOS users who stumble on this thread, I needed:

# Manually work around the curl issue 
# https://github.com/mitchellh/vagrant-installers/issues/98
sudo rm -rf /opt/vagrant/embedded/bin/curl

# Download a pre-built vagrant box
vagrant box add hashicorp/precise64

# Create the Vagrantfile
vagrant init

Then considering this, edit your Vagrantfile, specifically update:

  # config.vm.box = "base"                # Wrong, fix this line
  config.vm.box = "hashicorp/precise64"   # Correct, after update

Then finally you can get the candy:

vagrant up
vagrant ssh

Which confirms you have successfully ssh-d into a running Vagrant box:

Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)

 * Documentation:  https://help.ubuntu.com/
New release '14.04.5 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 06:23:18 2012 from 10.0.2.2
vagrant@precise64:~$    

Any news? When will 1.8.8 be released?

Issue also confirmed on a coworker's machine (OSX El Capitan). Rolled back to 1.8.6 to correct it, but we're also curious about any future releases that may address this.

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