Nat Ritmeyer
Nat Ritmeyer

Reputation: 5678

`vagrant box list` returning "Malformed version number string virtualbox (ArgumentError)"

After upgrading vagrant version, when I run vagrant box list I get a Malformed version number string virtualbox (ArgumentError) error:

$ vagrant box list
my_box             (virtualbox, 0)
/opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/version.rb:191:in `initialize': Malformed version number string virtualbox (ArgumentError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/box_collection.rb:277:in `new'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/box_collection.rb:277:in `block (2 levels) in find'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/box_collection.rb:272:in `map'
...

What's broken vagrant? And how do I fix it?

Upvotes: 1

Views: 1183

Answers (1)

Nat Ritmeyer
Nat Ritmeyer

Reputation: 5678

It appears that somewhere along the line virtualbox changed the way they store box versions. They used to be stored by name; now they're stored by number.

$ tree -L 2 .vagrant.d/boxes/
.vagrant.d/boxes/
└── my_box
    └── 0           # <-- new format, keep this
    └── virtualbox  # <-- old, offending format

In the above case, the virtualbox directory is the problem - to get vagrant box list working again, delete the offending version like so:

rm -rf .vagrant.d/boxes/my_box/virtualbox

Upvotes: 0

Related Questions