Open hgch opened 8 years ago
Stepped through the code and I see cfg = env[:machine].provider_config and cfg.box is actually Nil. This seems to be the problem. The code assumes .box is not nil and it's probably correct in doing so. I'm not super familiar with vagrant plugin development but it seems the warden is sending a different env[:machine] than expected to the check inventory method. Is this a difference in vagrant versions? I will try an older version and see if it helps.
I'm facing the same issue, any suggestions please?
I have the same problem, anyone found a solution?
/home/user/.vagrant.d/gems/2.2.5/gems/vagrant-vcenter-0.3.3/lib/vagrant-vcenter/action/inventory_check.rb:29:in vcenter_upload_box': undefined method
name' for nil:NilClass (NoMethodError)
vagrant 1.8.6: I get the same error message vagrant 1.9.0: I get the same error message
Same error here with Vagrant 1.9.1. Going back to the plugin version 0.3.2 works fine.
vagrant plugin install vagrant-vcenter --plugin-version 0.3.2
Same error here Vagrant 1.8.1 or 1.9.1 plugin version 0.3.3
More information about this. The error started to appear after I added another machine to the Vagrant file that is using new box. When I change the box name to something that is already uploaded to VCenter server as template the error disappears.
Going back to version 0.3.2 makes the error go away
Is this going to be fixed?
This error affects both vagrant status
as well the vagrant up
command and seems to be related to lib/vagrant-vcenter/action/inventory_check.rb referencing properties of the box file ( specifically 'name' and 'directory') before the HandleBox action downloads the box file, resulting in env[:machine].box being nil.
One work around I found was I could use vagrant box add
to download/stage the box file before initially running vagrant up
or vagrant status
to prevent env[:machine].box from being nil. The vagrant commands would then behave as expected.
looking at the commit that causes the issue
I assume it's the missing to_s causing the issue here?
Hi,
I've installed version 0.3.3 and now when im trying create one new vagrant then
vcenter_upload_box': undefined method
name'.I'm using the new template from git
.vagrant.d/gems/gems/vagrant-vcenter-0.3.3/lib/vagrant-vcenter/action/inventory_check.rb:29:in'
vcenter_upload_box': undefined method
name' for nil:NilClass (NoMethodError) from C:/Users/hgoncalves/.vagrant.d/gems/gems/vagrant-vcenter-0.3.3/lib/vagrant-vcenter/action/inventory_check.rb:130:invcenter_check_inventory' from C:/Users/hgoncalves/.vagrant.d/gems/gems/vagrant-vcenter-0.3.3/lib/vagrant-vcenter/action/inventory_check.rb:22:in
call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:incall' from C:/Users/hgoncalves/.vagrant.d/gems/gems/vagrant-vcenter-0.3.3/lib/vagrant-vcenter/action/connect_vcenter.rb:33:in
call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builtin/config_validate.rb:25:in
call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:34:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/builder.rb:116:in
call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:inblock in run' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/util/busy.rb:19:in
busy' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/action/runner.rb:66:inrun' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:225:in
action_raw' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:200:inblock in action' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:561:in
lock' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:incall' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:186:in
action' from C:/Users/hgoncalves/.vagrant.d/gems/gems/vagrant-vcenter-0.3.3/lib/vagrant-vcenter/provider.rb:28:instate' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:504:in
state' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/machine.rb:145:ininitialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/vagrantfile.rb:79:in
new' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/vagrantfile.rb:79:inmachine' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:663:in
machine' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/plugin/v2/command.rb:177:inblock in with_target_vms' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/plugin/v2/command.rb:201:in
call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/plugin/v2/command.rb:201:inblock in with_target_vms' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/plugin/v2/command.rb:183:in
each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/plugin/v2/command.rb:183:inwith_target_vms' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/commands/up/command.rb:131:in
install_providers' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/plugins/commands/up/command.rb:85:inexecute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/cli.rb:42:in
execute' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/environment.rb:302:incli' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:174:in