Project

General

Profile

Bug #11079

ovirt 3.5 compute profile edit error: undefined method `text' for nil:NilClass

Added by Steve D over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - oVirt
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Foreman version 1.8.2

Attempting to create a new resource profile on a new ovirt compute resource errors out:

Warning!
undefined method `text' for nil:NilClass

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
NoMethodError
undefined method `text' for nil:NilClass
app/helpers/layout_helper.rb:112:in `block in select_f'
app/helpers/layout_helper.rb:169:in `block (3 levels) in field'
app/helpers/layout_helper.rb:168:in `block (2 levels) in field'
app/helpers/layout_helper.rb:158:in `block in field'
app/helpers/layout_helper.rb:157:in `field'
app/helpers/layout_helper.rb:110:in `select_f'
app/views/compute_resources_vms/form/ovirt/_base.html.erb:10:in `_app_views_compute_resources_vms_form_ovirt__base_html_erb__4409097850897090305_73637740'
app/views/compute_attributes/_compute_form.html.erb:3:in `_app_views_compute_attributes__compute_form_html_erb__1756491331636043450_83732500'
app/views/compute_attributes/_form.html.erb:10:in `block (2 levels) in app_views_compute_attributes_form_html_erb__2970560782621538195_81668060'
app/views/compute_attributes/_form.html.erb:8:in `block in app_views_compute_attributes_form_html_erb__2970560782621538195_81668060'
app/helpers/layout_helper.rb:273:in `form_for'
app/views/compute_attributes/_form.html.erb:2:in `_app_views_compute_attributes__form_html_erb__2970560782621538195_81668060'
app/views/compute_attributes/new.html.erb:3:in `_app_views_compute_attributes_new_html_erb__3418808687226322706_81462020'
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

/var/log/foreman/production.log:
Started GET "/foreman/compute_profiles/7-ovirt_guest_compute/compute_resources/2-ovirt-pcic-uvic-ca/compute_attributes/new" for 142.104.194.17 at 2015-07-09 18:17:45 -0700
2015-07-09 18:17:45 [I] Processing by ComputeAttributesController#new as */*
2015-07-09 18:17:45 [I] Parameters: {"compute_profile_id"=>"7-ovirt_guest_compute", "compute_resource_id"=>"2-ovirt-pcic-uvic-ca"}
2015-07-09 18:17:45 [I] Successfully decrypted field for Foreman::Model::Ovirt ovirt.pcic.uvic.ca
2015-07-09 18:17:45 [I] Successfully decrypted field for Foreman::Model::Ovirt ovirt.pcic.uvic.ca
2015-07-09 18:17:45 [I] Rendered compute_resources_vms/form/ovirt/_base.html.erb (132.8ms)
2015-07-09 18:17:45 [I] Rendered compute_attributes/_compute_form.html.erb (133.8ms)
2015-07-09 18:17:45 [I] Rendered compute_attributes/_form.html.erb (222.7ms)
2015-07-09 18:17:45 [I] Rendered compute_attributes/new.html.erb (226.3ms)
2015-07-09 18:17:45 [W] Operation FAILED: undefined method `text' for nil:NilClass
2015-07-09 18:17:45 [I] Rendered common/500.html.erb (5.0ms)
2015-07-09 18:17:45 [I] Completed 500 Internal Server Error in 241ms (Views: 5.6ms | ActiveRecord: 1.3ms)
2015-07-09 18:17:45 [I]

Started GET "/foreman/compute_profiles/7-ovirt_guest_compute/compute_resources/2-ovirt-pcic-uvic-ca/compute_attributes/new" for 142.104.194.17 at 2015-07-09 18:17:45 -0700
2015-07-09 18:17:45 [I] Processing by ComputeAttributesController#new as */*
2015-07-09 18:17:45 [I] Parameters: {"compute_profile_id"=>"7-ovirt_guest_compute", "compute_resource_id"=>"2-ovirt-pcic-uvic-ca"}
2015-07-09 18:17:45 [I] Successfully decrypted field for Foreman::Model::Ovirt ovirt.pcic.uvic.ca
2015-07-09 18:17:45 [I] Successfully decrypted field for Foreman::Model::Ovirt ovirt.pcic.uvic.ca
2015-07-09 18:17:45 [I] Rendered compute_resources_vms/form/ovirt/_base.html.erb (115.9ms)
2015-07-09 18:17:45 [I] Rendered compute_attributes/_compute_form.html.erb (116.4ms)
2015-07-09 18:17:45 [I] Rendered compute_attributes/_form.html.erb (305.0ms)
2015-07-09 18:17:45 [I] Rendered compute_attributes/new.html.erb (306.5ms)
2015-07-09 18:17:45 [W] Operation FAILED: undefined method `text' for nil:NilClass
2015-07-09 18:17:45 [I] Rendered common/500.html.erb (5.0ms)
2015-07-09 18:17:45 [I] Completed 500 Internal Server Error in 317ms (Views: 5.5ms | ActiveRecord: 1.2ms)
2015-07-09 18:21:52 [I]

Screenshot from 2015-07-10 21-19-17.png View Screenshot from 2015-07-10 21-19-17.png 37 KB list of ovirt templates Steve D, 07/11/2015 12:20 AM
Screenshot from 2015-07-10 21-35-45.png View Screenshot from 2015-07-10 21-35-45.png 25.7 KB image field multiple listings of 'centos6_compute_template' Steve D, 07/11/2015 12:36 AM
Screenshot%20from%202015 07 10%2021 19 17 Screenshot%20from%202015 07 10%2021 35 45

Related issues

Related to Foreman - Bug #14090: unable to list ovirt vms (under compute resource vms tab)Resolved2016-03-08

Associated revisions

Revision 0abad579 (diff)
Added by Tomer Brisker over 3 years ago

Fixes #11079 - Handle oVirt with missing template version name

rbovirt 0.0.37 fixes a bug that causes templates with a missing version
name to raise an exception.

Revision f625e1ec (diff)
Added by Dominic Cleal over 3 years ago

refs #11079 - require rbovirt 0.0.37

Revision 999c759f (diff)
Added by Tomer Brisker over 3 years ago

Fixes #11079 - Handle oVirt with missing template version name

rbovirt 0.0.37 fixes a bug that causes templates with a missing version
name to raise an exception.

(cherry picked from commit 0abad5795c55f84f2ffc4e744725cce72fc7b241)

History

#1 Updated by Steve D over 4 years ago

Also errors when editing a VM listed in foreman hosts after I clicked "Associate VMs" in the ovirt compute resource page:

Warning!
undefined method `text' for nil:NilClass

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
NoMethodError
undefined method `text' for nil:NilClass
app/helpers/layout_helper.rb:112:in `block in select_f'
app/helpers/layout_helper.rb:169:in `block (3 levels) in field'
app/helpers/layout_helper.rb:168:in `block (2 levels) in field'
app/helpers/layout_helper.rb:158:in `block in field'
app/helpers/layout_helper.rb:157:in `field'
app/helpers/layout_helper.rb:110:in `select_f'
app/views/compute_resources_vms/form/ovirt/_base.html.erb:10:in `_app_views_compute_resources_vms_form_ovirt__base_html_erb__4409097850897090305_73637740'
app/views/hosts/_compute_detail.html.erb:5:in `_app_views_hosts__compute_detail_html_erb__463736123555929698_71892880'
app/views/hosts/_compute.html.erb:5:in `block in app_views_hosts_compute_html_erb___3915436782847234139_49077760'
app/views/hosts/_compute.html.erb:1:in `_app_views_hosts__compute_html_erb___3915436782847234139_49077760'
app/views/hosts/_unattended.html.erb:2:in `_app_views_hosts__unattended_html_erb___71643347212118752_48874320'
app/views/hosts/_form.html.erb:91:in `block (2 levels) in app_views_hosts_form_html_erb___4505668517308913666_79729140'
app/helpers/layout_helper.rb:273:in `form_for'
app/views/hosts/_form.html.erb:8:in `block in app_views_hosts_form_html_erb___4505668517308913666_79729140'
app/models/taxonomy.rb:61:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:147:in `as_location'
app/models/taxonomy.rb:60:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:112:in `as_org'
app/models/taxonomy.rb:59:in `as_taxonomy'
app/views/hosts/_form.html.erb:6:in `_app_views_hosts__form_html_erb___4505668517308913666_79729140'
app/views/hosts/edit.html.erb:9:in `_app_views_hosts_edit_html_erb__3352575511736684862_81915880'
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

#2 Updated by Dominic Cleal over 4 years ago

  • Category set to Compute resources - oVirt

The dropdown that the error's on is the template list from oVirt, perhaps one has a blank name or something, could be causing an issue.

#3 Updated by Steve D over 4 years ago

Dominic Cleal wrote:

The dropdown that the error's on is the template list from oVirt, perhaps one has a blank name or something, could be causing an issue.

I've attached a screenshot of the templates on ovirt side, none of them have a null name field.

I also get the error below when creating an image for the ovirt resource:

Warning!
undefined method `text' for nil:NilClass

If you feel this is an error with Foreman itself, please open a new issue with Foreman ticketing system, You would probably need to attach the Full trace and relevant log entries.
NoMethodError
undefined method `text' for nil:NilClass
app/helpers/images_helper.rb:5:in `any?'
app/helpers/images_helper.rb:5:in `image_field'
app/views/images/form/_ovirt.html.erb:3:in `_app_views_images_form__ovirt_html_erb___240184826467530931_82054120'
app/views/images/_form.html.erb:7:in `block in app_views_images_form_html_erb__1126843575881072270_80396620'
app/helpers/layout_helper.rb:273:in `form_for'
app/views/images/_form.html.erb:1:in `_app_views_images__form_html_erb__1126843575881072270_80396620'
app/views/images/new.html.erb:3:in `_app_views_images_new_html_erb__1996678905612722104_77478080'
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

I added a template 'Sub Version Name' and now don't get those errors. Is there a reason this field is mandatory? If you need it for some reason, could you sub the version# in if the field is null?

Also, when creating images, the 'Image" field dropdown where I can select the ovirt template name isn't very helpful if I'm using sub version templates in ovirt, it just shows the template name multiple times. It would be handy if this dropdown contained templatename:version#:subtemplatename:description

#4 Updated by Tomer Brisker over 4 years ago

  • Bugzilla link set to 1261868

#5 Updated by Marek Hulán almost 4 years ago

rbovirt issue, PR available at https://github.com/abenari/rbovirt/pull/97

#6 Updated by Marek Hulán almost 4 years ago

  • Related to Bug #14090: unable to list ovirt vms (under compute resource vms tab) added

#7 Updated by Lionel Beard over 3 years ago

Hi,

I have the same issue with a template converted from VMWare.
Actually, the issue come from a missing field in oVirt XML file: version_name.
And foreman hangs when parsing the XML file because of this rbovirt file:
rbovirt-0.0.36/lib/ovirt/template_version.rb
which requires version_name field.

The above rbovirt PR doesn't fix this issue.

In my case, I can't add a "Sub Version Name" to my template, and I don't know why... but this is a oVirt issue... :-)

#8 Updated by Tomer Brisker over 3 years ago

Looks like this has been fixed for rbovirt 0.0.37: https://github.com/abenari/rbovirt/commit/9bb6cead2d220bef6ff7f2783a3b61387824e3d5
Lionel - could you try updating rbovirt to confirm?

#9 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Closed
  • Legacy Backlogs Release (now unused) set to 155

rbovirt 0.0.37 will be available in Debian packages in 1.11.1, and I'll target this at 1.11.2 for the RPMs (also available in nightly until then).

#10 Updated by The Foreman Bot over 3 years ago

  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/3439 added

#11 Updated by Dominic Cleal over 3 years ago

  • Status changed from Closed to Ready For Testing
  • Legacy Backlogs Release (now unused) deleted (155)

PR opened instead.

#12 Updated by Anonymous over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#13 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 155

Also available in: Atom PDF