Curl broken in macOS vagrant 1.8.7 #7997

Closed
docwhat opened this Issue Nov 11, 2016 · 31 comments

Projects

None yet
@docwhat
docwhat commented Nov 11, 2016 edited

Vagrant version

Vagrant 1.8.7

Installed via brew cask install vagrant.

Host operating system

macOS Sierra
10.12.1

Vagrantfile

For testing I'm using this image, but it fails with anything that uses curl

vagrant init bento/centos-7.2

Debug output

From running vagrant box update

...
 INFO interface: output: Checking for updates to 'bento/centos-7.2'
 INFO interface: output: ==> default: Checking for updates to 'bento/centos-7.2'
==> default: Checking for updates to 'bento/centos-7.2'
 INFO interface: detail: Latest installed version: 2.3.0
 INFO interface: detail:     default: Latest installed version: 2.3.0
    default: Latest installed version: 2.3.0
 INFO interface: detail: Version constraints:
 INFO interface: detail:     default: Version constraints:
    default: Version constraints:
 INFO interface: detail: Provider: virtualbox
 INFO interface: detail:     default: Provider: virtualbox
    default: Provider: virtualbox
 INFO downloader: Downloader starting download:
 INFO downloader:   -- Source: https://atlas.hashicorp.com/bento/centos-7.2
 INFO downloader:   -- Destination: /var/folders/sb/bms_668s56dcm__8z_zp799w0000gn/T/vagrant-load-metadata20161111-9721-1ntvv4f
 INFO subprocess: Starting process: ["/opt/vagrant/embedded/bin/curl", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.8.7 (+https://www.vagrantup.com; ruby2.2.5)", "-H", "Accept: application/json", "--output", "/var/folders/sb/bms_668s56dcm__8z_zp799w0000gn/T/vagrant-load-metadata20161111-9721-1ntvv4f", "https://atlas.hashicorp.com/bento/centos-7.2"]
 INFO subprocess: Command in the installer. Specifying DYLD_LIBRARY_PATH...
DEBUG subprocess: Selecting on IO
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: 6
 WARN downloader: Downloader exit code: 6
ERROR downloader: Exit code: 6
...

Steps to reproduce

  1. vagrant init bento/centos-7.2
  2. vagrant box update

Workaround

sudo rm -f /opt/vagrant/embedded/bin/curl

Impact

This breaks all network features (metadata, getting boxes, updating boxes, etc.) in Vagrant.

@zg
Contributor
zg commented Nov 11, 2016

I followed the steps you outlined and tried running vagrant up:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'bento/centos-7.2' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'bento/centos-7.2' 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/bento/centos-7.2"]
Error: 
@jamesgoodhouse

I'm running El Capitan (10.11.6 (15G1108)) and am seeing the same exact problem.

The workaround also worked.

@docwhat
docwhat commented Nov 11, 2016 edited

@zg:

I should have mentioned the error is also silently eaten by the vagrant command. I had to use debug to see the dynlib errors from curl.

You're seeing the same error I'm reporting. Try the work-around and see if that fixes it.

@zg
Contributor
zg commented Nov 11, 2016

That didn't fix the issue I'm having, unfortunately.

@jamesgoodhouse

@zg: linking system curl didn't fix the issue for you?

@zg
Contributor
zg commented Nov 11, 2016

It did not. One thing to note is that I have System Integrity Protection disabled, though I don't know if that is relevant.

@bantonj
bantonj commented Nov 11, 2016

The workaround helped me with the following error:

docker-host: URL: file:///Users/paulj/Desktop/intelligence-api/vagrant/vagrantcloud.proxy.json An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.

@docwhat
docwhat commented Nov 11, 2016

Huh... vagrant box add -c bento/centos-7.1 works fine for me. (I already have the 7.2 image and I don't want to risk deleting it).

Your error message didn't format right and is missing the bit where it says something like 404 or something. Also, I see proxy in your path... are you using a proxy server? Could the problem be there? Also, I'm not sure what that path is... What is that .json file?

@zg
Contributor
zg commented Nov 11, 2016

Okay, I managed to fix the issue on my end.

I realized after some time that it seems like the .dmg file that is posted up on vagarantup.com is unreliably outdated, so I built vagrant from source.

  1. Install and link Ruby (to override the pre-installed Ruby that comes with macOS)

    brew install ruby && brew link ruby --force

  2. Clone the vagrant repository off of GitHub

    git clone https://github.com/mitchellh/vagrant

  3. Install the bundle program

    gem install bundler

  4. Switch to the vagrant directory and generate the executables

    cd vagrant && bundle --binstubs exec

  5. Link the newly generated executables

    ln -sf /path/to/vagrant/exec/vagrant /usr/local/bin/vagrant

@jtreminio

Please see #7969

@qbyte-opensource

I did managed to build vagrant from source on Mac OSX "El capitΓ‘n", but IΒ΄m still unable to "vagrant box add laravel/homestead"

@DelightedD0D
DelightedD0D commented Nov 14, 2016 edited

sudo rm -rf /opt/vagrant/embedded/bin/curl

Got it working for me

@jimklo
jimklo commented Nov 14, 2016

broken in Yosemite too

@joshmanders

Confirmed sudo rm -rf /opt/vagrant/embedded/bin/curl works for me too. macOS Sierra.

@scottwarren

I got this as well on Vagrant version 1.8.7 on Mac OS Sierra but "fixed" it by reverting to Vagrant version 1.8.6

@hyvs hyvs referenced this issue in Elao/symfony-standard Nov 15, 2016
Open

Indiquate Vagrant and VirtualBox supported version #161

@bacongobbler
bacongobbler commented Nov 15, 2016 edited

Confirming that removing the embedded curl binary works for me as well. Thanks for the fix @DelightedD0D!

For reference, this fix worked for me on:

macOS 10.12.1
vagrant 1.8.7
virtualbox 5.1.8

@SunSparc

Me too! :)

I was running fine on vagrant 1.8.1. Then while troubleshooting vagrant problems for someone else I updated to 1.8.7 and got the same networking issues. The workaround fixed the problem for me.

macOS Sierra 10.12.1
vagrant 1.8.7
parallels 10.3.0 (29227)

@chuckreynolds

ditto. i ran sudo rm /opt/vagrant/embedded/bin/curl and that allowed me to add boxes.

@cwonrails

@chuckreynolds' solution worked for me. Running Vagrant 1.8.7 on Sierra 10.12.2 Beta (16C48b) with Xcode 8.2 Beta 2.

@dduportal

Same here. The workaround provided are working, but we'll stick on the 1.8.6 version time for a fix :)

@scotthain
scotthain commented Nov 18, 2016 edited

More debug information:

/opt/vagrant/embedded/bin/curl --version
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
Trace/BPT trap: 5

Running on OS X El Capitan 10.11.6

@jwm
jwm commented Nov 18, 2016

See #7969 - looks like this will be fixed in Vagrant 1.8.8.

@Tokynet
Tokynet commented Nov 21, 2016

FWIW,
sudo rm -rf /opt/vagrant/embedded/bin/curl
fixed it for me too, OS X 10.10.5
vagrant 1.8.7

@ksiggaard

Yay thanks!! Fixed my MacOS 10.12.1... Oddly enough this was the same problem, the Windows version af Vagrant struggled with some months ago...

@danhopkins

Just to add to the debug (vagrant 1.8.7, macOS sierra 10.12.1)

otool -L /opt/vagrant/embedded/bin/curl /usr/bin/curl | grep libcurl

/opt/vagrant/embedded/bin/curl:
	@rpath/libcurl.4.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/bin/curl:
	/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 8.0.0)
@val-litvak

Happened to me as well on macOS sierra 10.12.1 and the suggested work-around works for me:

sudo rm -rf /opt/vagrant/embedded/bin/curl
@kikitux
Collaborator
kikitux commented Nov 25, 2016

duplicate of #7997

@kikitux kikitux closed this Nov 25, 2016
@umairwaheed umairwaheed added a commit to umairwaheed/zulip that referenced this issue Nov 27, 2016
@umairwaheed umairwaheed provisioning: Add version warning for Vagrant 1.8.7.
Vagrant 1.8.7 is not supported due to broken curl, see
mitchellh/vagrant#7997 for reference.
d64c0e7
@timabbott timabbott added a commit to zulip/zulip that referenced this issue Nov 27, 2016
@umairwaheed @timabbott umairwaheed + timabbott provisioning: Add version warning for Vagrant 1.8.7.
Vagrant 1.8.7 is not supported due to broken curl, see
mitchellh/vagrant#7997 for reference.
287eb2c
@rotated8

@kikitux this is #7997, did you mean to close it as a duplicate of itself?

@number61971

FYI: This issue still remains as of today. Fortunately, the posted workaround of deleting vagrant's embedded curl binary works.

Vagrant 1.8.7
MacOS 10.12.1 (Sierra)

@brockwhittaker brockwhittaker added a commit to brockwhittaker/zulip that referenced this issue Nov 30, 2016
@umairwaheed @brockwhittaker umairwaheed + brockwhittaker provisioning: Add version warning for Vagrant 1.8.7.
Vagrant 1.8.7 is not supported due to broken curl, see
mitchellh/vagrant#7997 for reference.
62bc333
@dfduarte
dfduarte commented Jan 30, 2017 edited

The issue stills happening up today. I'm using an El Captain with the latest Vagrant version (1.8.7).

I inform that the aforementioned workaround (deleting curl) has been worked too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment