hashicorp/vagrant

embedded libcurl provides out-of-date version

Closed this issue · 6 comments

Vagrant version

1.8.7

Host operating system

Mac OS X 10.11.6

Guest operating system

Ubuntu 16.04.1

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "xenial64"
  config.vm.box_url = "https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-vagrant.box"

  config.vm.provider "virtualbox" do |vb|
    vb.name = LOCAL_VM_NAME
    vb.customize ["modifyvm", :id, "--memory", "2048"]
  end

  $bootstrap_script = <<SCRIPT
if [ ! -e "~/fixed_tty" ] ; then
  cat /root/.profile |grep -v mesg > TMP_profile
  echo 'if `tty -s`; then mesg n; fi' >> TMP_profile
  mv TMP_profile /root/.profile
  touch ~/fixed_tty
fi

SCRIPT
  config.vm.provision :shell, :inline => $bootstrap_script

end

Debug output

<script src="https://gist.github.com/gerardkok/7184612c30ca727252f94a5f2e4ec2fc.js"></script>

Expected behavior

Vagrant should have downloaded the box

Actual behavior

Vagrant couldn't download the box

Steps to reproduce

  1. vagrant up

Workaround

Part of the debug output suggests there's something wrong with the bundled curl binary:

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

Linking /opt/vagrant/embedded/bin/curl to OS X's curl binary (ln -s /usr/bin/curl /opt/vagrant/embedded/bin/curl) seems to fix this, and downloads the box correctly.

Just been hit by the same in conjunction with vagrant-puppet-install

Workaround get's it working again, but would be good to get a fix...

I have followed the suggested workaround (both with the system cURL from /usr/bin/curland the Homebrew keg-only curl from /usr/local/opt/curl/bin/curl and I now get a different error:

DEBUG subprocess: stderr: dyld: Symbol not found: _iconv
  Referenced from: /usr/lib/libcups.2.dylib
  Expected in: /opt/vagrant/embedded/lib/libiconv.2.dylib
 in /usr/lib/libcups.2.dylib

Below are the corresponding cURL versions:

$ /usr/bin/curl -V
curl 7.49.1 (x86_64-apple-darwin16.0) libcurl/7.49.1 SecureTransport zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets
$ /usr/local/opt/curl/bin/curl -V
curl 7.51.0 (x86_64-apple-darwin16.1.0) libcurl/7.51.0 SecureTransport zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets

Thanks @gerardkok
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.

Closing as this is a dup of #7969. Thanks for the report!

👍

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.