Vagrant crashes without providing a useful error message when asked to package a base box #4931

Closed
SpryDaniel opened this Issue Dec 10, 2014 · 26 comments

Projects

None yet
@SpryDaniel

When issued the command vagrant package --base BaseBox, where BaseBox names a VirtualBox VM, vagrant crashes, reporting the following:

/opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/machine.rb:153:in `action': wrong number of arguments (2 for 1) (ArgumentError)
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/plugins/commands/package/command.rb:83:in `package_vm'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/plugins/commands/package/command.rb:66:in `package_base'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/plugins/commands/package/command.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.0/bin/vagrant:174:in `<main>'

With VAGRANT_LOG=debug, vagrant reports:

/opt/vagrant/embedded/gems/gems/vagrant-share-1.1.2/lib/vagrant-share/activate.rb:8:in `rescue in <encoded>': vagrant-share can't be installed without vagrant-login (RuntimeError)
    from /opt/vagrant/embedded/gems/gems/vagrant-share-1.1.2/lib/vagrant-share/activate.rb:5:in `<encoded>'
    from /opt/vagrant/embedded/gems/gems/vagrant-share-1.1.2/lib/vagrant-share/activate.rb:16:in `RGLoader_load'
    from /opt/vagrant/embedded/gems/gems/vagrant-share-1.1.2/lib/vagrant-share/activate.rb:16:in `<top (required)>'
    from /opt/vagrant/embedded/gems/gems/vagrant-share-1.1.2/lib/vagrant-share.rb:23:in `require'
    from /opt/vagrant/embedded/gems/gems/vagrant-share-1.1.2/lib/vagrant-share.rb:23:in `block in <class:Plugin>'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:75:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:75:in `block (2 levels) in help'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/registry.rb:48:in `block in each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/registry.rb:47:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/registry.rb:47:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:69:in `block in help'
    from /opt/vagrant/embedded/lib/ruby/2.0.0/optparse.rb:885:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:57:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:57:in `help'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/cli.rb:32:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.0/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.0/bin/vagrant:174:in `<main>'

Vagrant is at 1.7.0 (installed via the disk image from VagrantUp.com), running on OS X 10.10.1 with Ruby 2.1.5p273 and VirtualBox 4.3.20. The would-be guest OS is CentOS 6.6 x86_64 minimal, with VirtualBox guest tools installed and network configuration correct as far as my limited experience can ascertain.

@sethvargo
Collaborator

This is a bug in the latest version of Vagrant as a result of open sourcing vagrant-login. This will be fixed when we release a new Vagrant installer /cc @mitchellh

Sorry about that.

@sethvargo sethvargo closed this Dec 10, 2014
@jgosmann

Is there a workaround in the meanwhile? When is a new Vagrant installer going to be released?

@sethvargo
Collaborator

Vagrant 1.7.1 was released this morning.

@jgosmann

I am using Vagrant 1.7.1 (I just installed it this afternoon), but still getting that error.

@fxlv
fxlv commented Dec 13, 2014

Vagrant 1.7.1 on Debian Wheezy, same problem.

@gabrialm

Vagrant 1.7.1 on Ubuntu Trusty, same problem (fresh install for OS and Vagrant 1.7.1)

@sethvargo
Collaborator

Please track #4960

@wayne-o
wayne-o commented Dec 17, 2014

Same - I am using 1.7.1

@slier81
slier81 commented Dec 19, 2014

same - Im using 1.71

@sethvargo
Collaborator

@wayne-o @slier81 as you can see in #4960, this has been fixed in master and will be in the next release 😄

@wayne-o
wayne-o commented Dec 19, 2014

Nice! Wasn't that much of a nause for me - was just making sure it was
recorded :)

On Fri, Dec 19, 2014 at 4:09 PM, Seth Vargo notifications@github.com
wrote:

@wayne-o https://github.com/wayne-o @slier81
https://github.com/slier81 as you can see in #4960
#4960, this has been fixed
in master and will be in the next release [image: 😄]


Reply to this email directly or view it on GitHub
#4931 (comment).

--------------------

w://

t: 07508 215 459

--------------------

@gofighting123

In my case, i have to shutdown -h with my box then i can use vagrant package without modify vagrant 1.7.1 source.

@fthamura
fthamura commented Jan 6, 2015

my error in 1.7.1

-- Ruby level backtrace information ----------------------------------------
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:105:in `<main>'
/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.1/bin/vagrant:105:in `require'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant.rb:55:in `<top (required)>'
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant.rb:55:in `require'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json.rb:54:in `<top (required)>'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json.rb:58:in `<module:JSON>'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json.rb:58:in `require'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/ext.rb:9:in `<top (required)>'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/ext.rb:12:in `<module:JSON>'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/ext.rb:17:in `<module:Ext>'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/common.rb:67:in `generator='
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/common.rb:67:in `new'
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/common.rb:67:in `initialize'

-- C level backtrace information -------------------------------------------
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1c1e67) [0x7f7322b09e67]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x66b77) [0x7f73229aeb77] vfscanf.c:2022
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_bug+0x108) [0x7f73229aecb5] vfscanf.c:1841
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x139f6d) [0x7f7322a81f6d] ../sysdeps/x86_64/multiarch/strcmp-sse42.S:303
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f732273a340] ../nptl/sysdeps/pthread/funlockfile.c:29
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_hash_aref+0x14) [0x7f73229d12a8] strdup.c:40
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/ext/generator.so(+0x336b) [0x7f731e80736b] generator.c:528
/home/merv/.vagrant.d/gems/gems/json-1.8.1/lib/json/ext/generator.so(+0x4e91) [0x7f731e808e91] generator.c:954
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a8ca3) [0x7f7322af0ca3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1b7013) [0x7f7322aff013]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1b7147) [0x7f7322aff147]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1b72de) [0x7f7322aff2de]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1b6e08) [0x7f7322afee08]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1b795f) [0x7f7322aff95f]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1b8373) [0x7f7322b00373]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_funcall2+0x38) [0x7f7322b00c7b]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_obj_call_init+0x67) [0x7f73229b67e1] iofdopen.c:147
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_class_new_instance+0x38) [0x7f7322a0d358] ../posix/glob.c:236
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a8ca3) [0x7f7322af0ca3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a98a9) [0x7f7322af18a9]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a99e3) [0x7f7322af19e3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aa526) [0x7f7322af2526]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aad70) [0x7f7322af2d70]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1ae6d3) [0x7f7322af66d3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1bde46) [0x7f7322b05e46]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_iseq_eval+0x34) [0x7f7322b06a67]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x70b7b) [0x7f73229b8b7b] ioseekoff.c:79
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_require_safe+0x197) [0x7f73229b9911] iofwide.c:241
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_f_require+0x25) [0x7f73229b909c] libioP.h:905
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a8d08) [0x7f7322af0d08]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a98a9) [0x7f7322af18a9]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a99e3) [0x7f7322af19e3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aa526) [0x7f7322af2526]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aad70) [0x7f7322af2d70]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1ae6d3) [0x7f7322af66d3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1bde46) [0x7f7322b05e46]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_iseq_eval+0x34) [0x7f7322b06a67]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x70b7b) [0x7f73229b8b7b] ioseekoff.c:79
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_require_safe+0x197) [0x7f73229b9911] iofwide.c:241
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_f_require+0x25) [0x7f73229b909c] libioP.h:905
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a8d08) [0x7f7322af0d08]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a98a9) [0x7f7322af18a9]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a99e3) [0x7f7322af19e3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aa526) [0x7f7322af2526]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aad70) [0x7f7322af2d70]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1ae6d3) [0x7f7322af66d3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1bde46) [0x7f7322b05e46]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_iseq_eval+0x34) [0x7f7322b06a67]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x70b7b) [0x7f73229b8b7b] ioseekoff.c:79
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_require_safe+0x197) [0x7f73229b9911] iofwide.c:241
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_f_require+0x25) [0x7f73229b909c] libioP.h:905
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a8d08) [0x7f7322af0d08]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a98a9) [0x7f7322af18a9]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1a99e3) [0x7f7322af19e3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aa526) [0x7f7322af2526]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1aad70) [0x7f7322af2d70]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1ae6d3) [0x7f7322af66d3]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x1bde46) [0x7f7322b05e46]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(rb_iseq_eval_main+0x34) [0x7f7322b06ab4]
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(+0x6c3db) [0x7f73229b43db] vfscanf.c:1252
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(ruby_exec_node+0x24) [0x7f73229b44ee] vfscanf.c:1919
/opt/vagrant/embedded/bin/../lib/libruby.so.2.0(ruby_run_node+0x3e) [0x7f73229b44c1] vfscanf.c:1926
ruby() [0x4009e1]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f7321a3aec5] libc-start.c:287
ruby() [0x4008c9]
@sethvargo
Collaborator

@fthamura that's a segfault and an unrelated issue. Please open a new issue with more detailed information with your Vagrantfile and the output of Vagrant in debug mode

@alexwenzel

How do i applay this patch in windows? c0d4b39

I still get this bug with vagrant 1.7.1 on windows.

@sethvargo
Collaborator

@alexwenzel we recently released Vagrant 1.7.2, which includes that fix (and many more) in core. You can safely upgrade to Vagrant 1.7.2 and receive that patch 😄.

@farooqsadiq

Vagrant 1.7.2 package worked on Mac OSX 10.10.1

@vmrob
vmrob commented Jan 15, 2015

Chiming in to confirm that upgrading to Vagrant 1.7.2 fixed my issue on 10.10.1 as well.

@wwek
wwek commented Jan 20, 2015

I use Vagrant 1.7.1 at Windows

G:\VirtualBox VMs\centos7_64>vagrant --version   
Vagrant 1.7.1                                    
G:\VirtualBox VMs\centos7_64>vagrant package --base "centos7_64"                                      
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/machine.rb:153:in `action': wrong nu
er of arguments (2 for 1) (ArgumentError)                                                             
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb
3:in `package_vm'                                                                                     
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb
6:in `package_base'                                                                                   
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/commands/package/command.rb
2:in `execute'                                                                                        
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/cli.rb:42:in `execute' 
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:301:in `
i'                                                                                                    
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/bin/vagrant:174:in `<main>'        

Vagrant 1.7.2 fixed
so please upgrading to Vagrant 1.7.2

@haad
haad commented Jan 21, 2015

caracal:openam (master*) $ vagrant plugin list
Bundler, the underlying system used to manage Vagrant plugins,
is reporting that a plugin or its dependency can't be found.
This is usually caused by manual tampering with the 'plugins.json'
file in the Vagrant home directory. To fix this error, please
remove that file and reinstall all your plugins using vagrant plugin install.
/opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/resolver.rb:368:in resolve': Could not find gem 'vagrant-login (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound) from /opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/resolver.rb:166:instart'
from /opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/resolver.rb:129:in resolve' from /opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/definition.rb:193:inresolve'
from /opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/definition.rb:132:in specs' from /opt/vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/definition.rb:177:inspecs_for'
from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant.rb:76:in <top (required)>' from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:inrequire'
from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in rescue in require' from /opt/vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:inrequire'
from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:105:in `

'

I can see it with OS.X 10.10.1

@chilic
chilic commented Jan 23, 2015

OS.X 10.10.1 Same problem with Vagrant 1.7.2

@yevmel
yevmel commented Feb 4, 2015

1.7.2 fixed the problem for me on OS X 10.10

@pbc
pbc commented Mar 20, 2015

same issue on Ubuntu 14.04 and vagrant 1.7.2

@pbc
pbc commented Mar 20, 2015

after doing a full wipe of vagrant binaries and reinstalling vagrant 1.7.2 it works again:

aptitude remove vagrant
rm -rf /opt/vagrant
rm -rf ~/.vagrant.d*
@PierrePaul

Installing 1.7.2 on a fresh computer didnt work for me. Removing then re-installing (like @pbc suggested) fixed the issue.

@AndrienkoAleksandr

Thank you, pbc, it's helped me on ubuntu 15.04 vagrant 1.7.2:
sudo apt-get remove vagrant
sudo rm -rf /opt/vagrant
sudo rm -rf ~/.vagrant.d*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment