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

Curl broken in macOS vagrant 1.8.7 #7997

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

Curl broken in macOS vagrant 1.8.7 #7997

docwhat opened this issue Nov 11, 2016 · 31 comments

Comments

@docwhat
Copy link

docwhat commented Nov 11, 2016

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
Copy link
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
Copy link

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

The workaround also worked.

@docwhat
Copy link
Author

docwhat commented Nov 11, 2016

@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
Copy link
Contributor

zg commented Nov 11, 2016

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

@jamesgoodhouse
Copy link

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

@zg
Copy link
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
Copy link

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
Copy link
Author

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
Copy link
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
Copy link

Please see #7969

@qbyte-opensource
Copy link

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"

@DoDSoftware
Copy link

DoDSoftware commented Nov 14, 2016

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

Got it working for me

@jimklo
Copy link

jimklo commented Nov 14, 2016

broken in Yosemite too

@joshmanders
Copy link

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

@scottwarren
Copy link

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

@bacongobbler
Copy link

bacongobbler commented Nov 15, 2016

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
Copy link

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
Copy link

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

@cwonrails
Copy link

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

@dduportal
Copy link

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

@scotthain
Copy link

scotthain commented Nov 18, 2016

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
Copy link

jwm commented Nov 18, 2016

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

@Tokynet
Copy link

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
Copy link

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...

@andydude
Copy link

Confirmed http://pastie.org/10968105

@danhopkins
Copy link

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
Copy link

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
Copy link
Contributor

kikitux commented Nov 25, 2016

duplicate of #7997

@rotated8
Copy link

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

@number61971
Copy link

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)

@dfduarte
Copy link

dfduarte commented Jan 30, 2017

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.

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests