Red Hat Bugzilla – Bug 1188435
Editing host or computer profile associated with VmWare resource fails with undefined method
Last modified: 2017-02-23 15:35:53 EST
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
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Specifically : VMware ESXi, 5.5.0, 1892794 Works with our 4.x environment : ESXi, 4.1.0, 1363503
Created redmine issue http://projects.theforeman.org/issues/9617 from this bug
Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1196357
Upstream bug assigned to szadok@redhat.com
Upstream bug assigned to lzap@redhat.com
Quick update - I am reproducing this BZ.
Associating case from https://bugzilla.redhat.com/show_bug.cgi?id=1196357
*** Bug 1196357 has been marked as a duplicate of this bug. ***
I am currently facing different issue in our 6.0.z composes which blocks me from fixing this one. Working on a local workaround: https://bugzilla.redhat.com/show_bug.cgi?id=1170276
Hello, it looks like VmWare resource is returning nil when we query for list of datacenters. Due to bug in our code, we fail instead of rendering an empty field in the form. Here is a hotfix you can provide. It is for this file: /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb diff --git a/app/models/compute_resources/foreman/model/vmware.rb b/app/models/compute_resources/foreman/model/vmware.rb index ad3c268..365929d 100644 --- a/app/models/compute_resources/foreman/model/vmware.rb +++ b/app/models/compute_resources/foreman/model/vmware.rb @@ -44,7 +44,7 @@ module Foreman::Model end def clusters - dc.clusters + dc.clusters rescue [] end After this change, Satellite 6 UI must be restarted: # service httpd restart But this is just a cosmetic fix that will prevent Satellite 6 from failing. If you see this bug, then the vmware/fog does not see any datacenters. Please work with customers in identifing why the list of datacenters is empty (permission issue?) 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.
VERIFIED: # rpm -qa | grep foreman ruby193-rubygem-foreman_docker-1.2.0.10-1.el6_6sat.noarch ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch foreman-debug-1.7.2.18-1.el6_6sat.noarch foreman-vmware-1.7.2.18-1.el6_6sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.6-1.el6_6sat.noarch rubygem-hammer_cli_foreman_discovery-0.0.1.8-1.el6_6sat.noarch puppet-foreman_scap_client-0.3.3-8.el6_6sat.noarch foreman-1.7.2.18-1.el6_6sat.noarch foreman-libvirt-1.7.2.18-1.el6_6sat.noarch ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch ruby193-rubygem-foreman_bootdisk-4.0.2.12-1.el6_6sat.noarch rubygem-hammer_cli_foreman-0.1.4.10-1.el6_6sat.noarch foreman-postgresql-1.7.2.18-1.el6_6sat.noarch foreman-selinux-1.7.2.13-1.el6_6sat.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-proxy-1.0-2.noarch foreman-compute-1.7.2.18-1.el6_6sat.noarch foreman-gce-1.7.2.18-1.el6_6sat.noarch ruby193-rubygem-foreman_discovery-2.0.0.12-1.el6_6sat.noarch foreman-proxy-1.7.2.4-1.el6_6sat.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-client-1.0-1.noarch qe-sat6-rhel66.usersys.redhat.com-foreman-proxy-client-1.0-1.noarch foreman-ovirt-1.7.2.18-1.el6_6sat.noarch ruby193-rubygem-foreman-redhat_access-0.1.0-1.el6_6sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el6_6sat.noarch ruby193-rubygem-foreman-tasks-0.6.12.4-1.el6_6sat.noarch steps: *Infrastructure > compute profiles *Create a new compute profile *Select the compute resource *Able to select the compute resource screen shot attached
Created attachment 1020481 [details] compute resource
(In reply to Tazim Kolhar from comment #27) > Created attachment 1020481 [details] > compute resource That seems to be a libvirt compute resource, this needs to be tested on a vmware compute resource as this is mainly a vmware issue unless I'm missing something.
This bug is slated to be released with Satellite 6.1.
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.