mitchellh/vagrant — Issue #658: Vagrant::Driver::VirtualBox.read_version failing on second call (JRuby)
Author: jkutner
Created: 2012-01-19 20:52:32+00:00
State: open

With JRuby only, any `vagrant` command that invokes the Vagrant::Driver::VirtualBox.read_version twice gets `nil` back when executing:

VBoxManage --version

The resulting error is:

$ vagrant up
[default] Importing base box 'torquebox'...
NoMethodError: private method `split' called for nil:NilClass
read_version at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/driver/virtualbox.rb:117
initialize at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/driver/virtualbox.rb:36
reload! at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/vm.rb:129
uuid= at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/vm.rb:124
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/vm/import.rb:15
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/warden.rb:33
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/vm/check_box.rb:28
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/warden.rb:33
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/vm/check_accessible.rb:18
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/warden.rb:33
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/general/validate.rb:14
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/warden.rb:33
call at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/builder.rb:92
run at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/runner.rb:49
busy at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/util/busy.rb:19
run at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/action/runner.rb:49
run_action at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/vm.rb:192
up at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/vm.rb:143
execute at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/command/up.rb:46
with_target_vms at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/command/base.rb:100
each at org/jruby/RubyArray.java:1612
with_target_vms at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/command/base.rb:95
execute at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/command/up.rb:39
execute at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/cli.rb:38
cli at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/lib/vagrant/environment.rb:156
(root) at ~/.rvm/gems/jruby-1.6.5/gems/vagrant-0.9.1/bin/vagrant:43
load at org/jruby/RubyKernel.java:1063
(root) at ~/.rvm/gems/jruby-1.6.5/bin/vagrant:19

This only happens on the second invocation of Vagrant::Driver::VirtualBox.read_version. Commands that only invoke it once -- such as `vagrant status` work fine.

SYSTEM INFO:

$ vagrant -v
Vagrant version 0.9.1

$ uname -a
Darwin largo.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

$ ruby -v
jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]

$ VBoxManage --version
4.1.8r75467