Last modified: 2013-09-30 09:40:46 UTC
Created a fresh vagrant instance (on Mac OS X 10.8.5 w/ VirtualBox 4.2.18), fired it up, and logged in: -bash: /etc/virtualbox-version: No such file or directory Your VirtualBox guest additions are out-of-date. Please run 'update-guest-additions'. vagrant@mediawiki-vagrant:~$ update-guest-additions Cannot determine host VirtualBox version. Something seems not quite right there...
Created attachment 13386 [details] Log of output from vagrant setup.
I have seen the error message on my VM too.
Just checking some of the code from the functions in lib/mediawiki-vagrant/helpers.rb manually: >> RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw32|windows/i => nil (so it shouldn't be accidentally thinking it's Windows) >> `VBoxManage -v 2>/dev/null`[/[\d\.]+/] rescue nil => "4.2.18" (so it seems to return a sane value...) and from puppet/modules/virtualbox/manifests/init.pp: >> "4.2.18" =~ /[\d.]+/ => 0 (so it should create /etc/virtualbox-version) Apparently 0 evaluates to "true" in Ruby. Nice. :)
So the problem seems to be that VBoxManage is actually crapping out with a low-level error: sh: line 1: 2322 Trace/BPT trap: 5 VBoxManage -v 2> /dev/null ^ so we get an empty string as output. I can find some general references to this 'Trace/BPT trap: 5' thing happening in VBox, Postgres, and a couple other things on OS X and FreeBSD... not really sure what it actually means. It's possible that something in the Vagrant or Puppet environment is causing libraries or config files not to load, or something, and it's crashing the program. Weeeeeeird! I haven't figured out how to repro it directly, but it happens quite consistently when rerunning 'vagrant provision'.
Change 86212 had a related patch set uploaded by Ori.livneh: Use interval Vagrant hook to determine VirtualBox version https://gerrit.wikimedia.org/r/86212
Yes, I suspect the most recent version of Vagrant sets a custom LD_LIBRARY_PATH or LIBRARY_PATH to get its embedded Ruby interpreter to work. (You know your language's package management facilities suck when people resort to bundling the entire runtime. WTF.) The patch above uses Vagrant's internal API to get the version number. I was able to get it to work after a lot of trial-and-error and poking around in Vagrant's code. I'm not sure yet if it's a good approach, or if the APIs that it is using are stable. I think that at minimum I'd like to have 'upgrade-guest-additions' take an optional command-line argument that lets you specify a VirtualBox version, as a fallback for this issue.
Change 86212 merged by jenkins-bot: Use interval Vagrant hook to determine VirtualBox version https://gerrit.wikimedia.org/r/86212
Confirmed that patch fixes it for me; closing fixed.
(In reply to comment #3) > Apparently 0 evaluates to > "true" > in Ruby. Nice. :) As far as I know (in Ruby) only nil and false are falsy, everything else is truthy.