vagrant-google icon indicating copy to clipboard operation
vagrant-google copied to clipboard

Add guard method for image_family selector

Open Temikus opened this issue 7 years ago • 4 comments

If image family does not exist we trace back:

undefined method `self_link' for nil:NilClass

/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/run_instance.rb:99:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/warn_ssh_keys.rb:28:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/warn_networks.rb:28:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/call.rb:53:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/temikus/.vagrant.d/gems/2.4.3/gems/vagrant-google-2.0.0/lib/vagrant-google/action/connect_google.rb:44:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/box_check_outdated.rb:79:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/builder.rb:116:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `block in run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/util/busy.rb:19:in `busy'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/action/runner.rb:66:in `run'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:227:in `action_raw'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:202:in `block in action'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/environment.rb:592:in `lock'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:188:in `call'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/machine.rb:188:in `action'
/opt/vagrant/embedded/gems/2.0.3/gems/vagrant-2.0.3/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

Need a guard method that rolls back the process of machine creation here: https://github.com/mitchellh/vagrant-google/blob/f870d7c404b2d38d9e7d098fd458b293bf4029ca/lib/vagrant-google/action/run_instance.rb#L103

Temikus avatar Apr 10 '18 08:04 Temikus

Should update the docs example aswell to account for this..

I got the example working by adding:

google.image_project_id = "ubuntu-os-cloud"

fatmcgav avatar Sep 26 '18 09:09 fatmcgav

@fatmcgav Thank you for this. I missed a piece of logic here. Default image project id's should be autopopulated. I'll address this in the nearest patch.

Temikus avatar Oct 02 '18 03:10 Temikus

@fatmcgav what you've experienced is actually a regression, apologies - see #206. I'll roll out a fix today.

Temikus avatar Oct 06 '18 12:10 Temikus

Cool, cheers for confirming.

On Sat, 6 Oct 2018, 13:02 Artem Yakimenko, [email protected] wrote:

@fatmcgav https://github.com/fatmcgav what you've experienced is actually a regression, apologies - see #206 https://github.com/mitchellh/vagrant-google/pull/206. I'll roll out a fix today.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mitchellh/vagrant-google/issues/192#issuecomment-427568454, or mute the thread https://github.com/notifications/unsubscribe-auth/ACIbIhXcEP2c587mMGuaOW8HKDI6nFZtks5uiJvBgaJpZM4TN2V7 .

fatmcgav avatar Oct 06 '18 15:10 fatmcgav