Project

General

Profile

Bug #9617

Creating compute profile on Vmware: undefined method `[]' for nil:NilClass

Added by Bryan Kearney over 6 years ago. Updated about 3 years ago.

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

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1188435
Description of problem:
Creating a Compute Resource works and control of existing VM's is working, when trying to add a compute profile we get an error.

Version-Release number of selected component (if applicable):
Installed Packages

candlepin-0.9.23.1-1.el6.noarch
candlepin-common-1.0.1-1.el6_5.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
candlepin-selinux-0.9.23.1-1.el6.noarch
candlepin-tomcat6-0.9.23.1-1.el6.noarch
elasticsearch-0.90.10-6.el6sat.noarch
katello-1.5.0-30.el6sat.noarch
katello-certs-tools-1.5.6-1.el6sat.noarch
katello-default-ca-1.0-1.noarch
katello-installer-0.0.67-1.el6sat.noarch
katello-server-ca-1.0-1.noarch
katello.croberts.org-apache-1.0-1.noarch
katello.croberts.org-foreman-client-1.0-1.noarch
katello.croberts.org-foreman-proxy-1.0-1.noarch
katello.croberts.org-parent-cert-1.0-1.noarch
katello.croberts.org-puppet-client-1.0-1.noarch
katello.croberts.org-qpid-broker-1.0-1.noarch
katello.croberts.org-qpid-client-cert-1.0-1.noarch
mod_wsgi-3.4-1.pulp.el6sat.x86_64
pulp-katello-0.3-4.el6sat.noarch
pulp-nodes-common-2.4.4-1.el6sat.noarch
pulp-nodes-parent-2.4.4-1.el6sat.noarch
pulp-puppet-plugins-2.4.4-1.el6sat.noarch
pulp-puppet-tools-2.4.4-1.el6sat.noarch
pulp-rpm-plugins-2.4.4-1.1.el6sat.noarch
pulp-selinux-2.4.4-1.el6sat.noarch
pulp-server-2.4.4-1.el6sat.noarch
python-gofer-qpid-1.3.0-1.el6sat.noarch
python-isodate-0.5.0-1.pulp.el6sat.noarch
python-kombu-3.0.15-12.pulp.el6sat.noarch
python-pulp-bindings-2.4.4-1.el6sat.noarch
python-pulp-common-2.4.4-1.el6sat.noarch
python-pulp-puppet-common-2.4.4-1.el6sat.noarch
python-pulp-rpm-common-2.4.4-1.1.el6sat.noarch
python-qpid-0.22-14.el6sat.noarch
python-qpid-qmf-0.22-37.el6.x86_64
qpid-cpp-client-0.22-42.el6.x86_64
qpid-cpp-server-0.22-42.el6.x86_64
qpid-cpp-server-linearstore-0.22-42.el6.x86_64
qpid-java-client-0.22-6.el6.noarch
qpid-java-common-0.22-6.el6.noarch
qpid-proton-c-0.7-1.el6.x86_64
qpid-qmf-0.22-37.el6.x86_64
qpid-tools-0.22-12.el6.noarch
ruby193-rubygem-katello-1.5.0-93.el6sat.noarch
rubygem-hammer_cli_katello-0.0.4-14.el6sat.noarch
rubygem-smart_proxy_pulp-1.0.1-1.1.el6sat.noarch

How reproducible:

Steps to reproduce:
*Infrastructure > compute profiles
*Create a new compute profile
*Select the compute resource
*Get an undefinded method error:

Actual results:

NoMethodError
undefined method `[]' for nil:NilClass
app/helpers/layout_helper.rb:119:in `block in selectable_f'
app/helpers/layout_helper.rb:160:in `block (3 levels) in field'
app/helpers/layout_helper.rb:159:in `block (2 levels) in field'
app/helpers/layout_helper.rb:150:in `block in field'
app/helpers/layout_helper.rb:149:in `field'
app/helpers/layout_helper.rb:117:in `selectable_f'
app/views/compute_resources_vms/form/_vmware.html.erb:6:in `_app_views_compute_resources_vms_form__vmware_html_erb__1234955438304079943_85954960'
app/views/compute_attributes/_form.html.erb:10:in `block (2 levels) in app_views_compute_attributes_form_html_erb__2956532270157352589_118689300'
app/views/compute_attributes/_form.html.erb:8:in `block in app_views_compute_attributes_form_html_erb__2956532270157352589_118689300'
app/helpers/layout_helper.rb:251:in `form_for'
app/views/compute_attributes/_form.html.erb:2:in `_app_views_compute_attributes__form_html_erb__2956532270157352589_118689300'
app/views/compute_attributes/new.html.erb:3:in `_app_views_compute_attributes_new_html_erb__4379414151464736042_111683820'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

Expected results:
To be able to provision vm's or add compute resources. I tested this internally with VMWare 5.1 and it worked fine for our Pune Lab. I checked on Mojo and I do not see anything higher than 5.1

Additional info:

VM Ware 5.5

Associated revisions

Revision d76ca304 (diff)
Added by Shlomi Zadok over 6 years ago

fixes #9617 - rescue from empty vmware clusters

Revision 7c21dea2 (diff)
Added by Shlomi Zadok over 6 years ago

fixes #9617 - rescue from empty vmware clusters

(cherry picked from commit d76ca3043ca1bac1229667e342da149e3cd6f304)

History

#1 Updated by Dominic Cleal over 6 years ago

  • Subject changed from Unable to create compute profile on Vmware to Creating compute profile on Vmware: undefined method `[]' for nil:NilClass
  • Category set to Compute resources - VMware

#2 Updated by Lukas Zapletal over 6 years ago

  • Assignee changed from Shlomi Zadok to Lukas Zapletal

#3 Updated by Lukas Zapletal over 6 years ago

  • Assignee changed from Lukas Zapletal to Shlomi Zadok

Assigning back to Shlomi as he worked on this area already. Shlomi, there is a different issue (https://bugzilla.redhat.com/show_bug.cgi?id=1170276#c10) with this particular line. Also, you need to find why fog is returning nil instead of empty array. Maybe we can impelemt similar workaround above in our codebase (but logging the exception rather than throwing it out). But it would be better to find real cause and fix it either in fog or foreman.

#4 Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2302 added
  • Pull request deleted ()

#5 Updated by Shlomi Zadok over 6 years ago

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

#6 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 50

Also available in: Atom PDF