Bug #5119
closedCan't create new host on GCE: "Warning! undefined method `first' for nil:NilClass"
Description
Go to Host > New host > [Virtual machine tab] > Error loading virtual machine information: Internal Server Error (no stack trace)
Go to Infrastructure > Compute profiles > Click on any defined profile (for example: 1-Small) > Edit Compute profile: 1-Small > Click on GCE profile > Error with stack trace:
Warning!
undefined method `first' for nil:NilClass
Stack trace:
NoMethodError
undefined method `first' for nil:NilClass
app/models/concerns/fog_extensions/google/server.rb:15:in `image_id'
app/helpers/layout_helper.rb:110:in `block in select_f'
app/helpers/layout_helper.rb:157:in `block (3 levels) in field'
app/helpers/layout_helper.rb:156:in `block (2 levels) in field'
app/helpers/layout_helper.rb:149:in `block in field'
app/helpers/layout_helper.rb:148:in `field'
app/helpers/layout_helper.rb:108:in `select_f'
app/views/compute_resources_vms/form/_gce.html.erb:7:in `_app_views_compute_resources_vms_form__gce_html_erb__2141746024514687174_80528100'
app/views/compute_attributes/_form.html.erb:10:in `block (2 levels) in app_views_compute_attributes_form_html_erb___2910166742332063393_70284026324980'
app/views/compute_attributes/_form.html.erb:8:in `block in app_views_compute_attributes_form_html_erb___2910166742332063393_70284026324980'
app/helpers/layout_helper.rb:248:in `form_for'
app/views/compute_attributes/_form.html.erb:2:in `_app_views_compute_attributes__form_html_erb___2910166742332063393_70284026324980'
app/views/compute_attributes/edit.html.erb:3:in `_app_views_compute_attributes_edit_html_erb___2573780859027174645_70284026243820'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
OS: Centos 6.5
Foreman: 1.5 nightly rpms