Bug 1211090
| Summary: | When configuring virt-who 0.12 with rhsm_username and rhsm_password with Satellite 6, virt-who fails with a traceback. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Rich Jerrido <rjerrido> | ||||||
| Component: | API | Assignee: | Tom McKay <tomckay> | ||||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Tazim Kolhar <tkolhar> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 6.0.0 | CC: | Axel.Thimm, bbuckingham, bkearney, cwelton, dgoodwin, gxing, rbalakri, rjerrido, sgao, shihliu, tkolhar, wlehman | ||||||
| Target Milestone: | Unspecified | Keywords: | Triaged | ||||||
| Target Release: | Unused | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| URL: | http://projects.theforeman.org/issues/10484 | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2015-08-12 14:00:13 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Please, enable debug logging in virt-who (VIRTWHO_DEBUG=1 in /etc/sysconfig/virt-who) and paste /var/log/rhsm/rhsm.log here. Thank you. Created attachment 1014907 [details]
rhsm.log demonstrating error
From the log file in comment #4: 2015-04-15 17:02:42,562 [ERROR] @virtwho.py:107 - Error in communication with subscription manager: Traceback (most recent call last): File "/usr/share/virt-who/virtwho.py", line 100, in send self._sendGuestAssociation(report) File "/usr/share/virt-who/virtwho.py", line 117, in _sendGuestAssociation result = manager.hypervisorCheckIn(report.config, report.association, report.config.type) File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 133, in hypervisorCheckIn return self.connection.hypervisorCheckIn(config.owner, config.env, mapping) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 754, in hypervisorCheckIn return self.conn.request_post(url, host_guest_mapping) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 553, in request_post return self._request("POST", method, params) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 478, in _request self.validateResponse(result, request_type, handler) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 520, in validateResponse raise RestlibException(response['status'], error_msg) RestlibException: undefined method `admin?' for nil:NilClass This looks like server-side problem. Devan, could you please check what could be the source of this exception? I think we need a foreman-debug on this, need server side logs to see what's actually failing. It feels like ruby code to me. Created attachment 1015637 [details]
foreman-debug from affected satellite
Appears to be erroring out in the foreman logs somewhere before hitting candlepin:
Imported report for satellite.rhsat.auroracloud.com in 0.14 seconds
Completed 201 Created in 155ms (Views: 1.8ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::Rhsm::CandlepinProxiesController#server_status as JSON
Completed 200 OK in 89ms (Views: 0.6ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::Rhsm::CandlepinProxiesController#hypervisors_update as JSON
Parameters: {"31433646-3635-3835-3833-3342ffffffff"=>["4210148d-26ce-00e1-ce37-5247712fa6ce", "421615b3-8d0c-98ee-d5e5-7222fe1b3dfb", "4210f7ee-9d32-bae4-03e1-686b7c3
c70b3", "564dac02-38ae-63a8-5614-98e833baee25", "42103129-b371-89d1-b928-8b3e30f76e43"], "31433646-3635-3835-3833-3236ffffffff"=>[], "owner"=>"Default_Organization", "e
nv"=>"Library"}
[ERROR 2015-04-17 11:14:05 cp_proxy #4030] NoMethodError: undefined method `admin?' for nil:NilClass
| /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb:425:in `authorize_client_or_admin'
| /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:509:in `block (3 levels) in _run__2059531746247327140__process_action__1
851924459166198104__callbacks'
Reassigning to Satellite.
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. It also exist on SAM-1.4.1-RHEL-6-20141113.0 @rjerrido - virt-who does not currently support communication to Sat-6/SAM-6 (or SAM-1.4) with any mechanism besides the rhsm credentials that come from subscription-manager register. I can correct the stack trace but I would not consider that a blocker issue. Note that the entitlement team will be working on allowing virt-who to use other credentials and corresponding work will need to be done in Sat-6/SAM-6 to support this as well. So the usage of the rhsm_* directives are for usage with Satellite & SAM, but does work for RHSM? That might need to be clarified in the docs/manual, though. I do not consider this a blocker for 6.1, however, it definitely makes a 'nice to have' (and could potentially also satisfy https://bugzilla.redhat.com/show_bug.cgi?id=1209467), [RFE] Allow virt-who to be installed on a Satellite 6 instance. Per Rich's comment, removing the blocker tag. Created redmine issue http://projects.theforeman.org/issues/10484 from this bug @rjerrido - In the end, no changes were necessary to virt-who so it could be included in 6.1, if desired and approved. Moving to POST since upstream bug http://projects.theforeman.org/issues/10484 has been closed ------------- Thomas McKay Applied in changeset commit:katello|9149a86d492136a1c504ec47976f53e2ea81e7cf. VERIFIED: # rpm -qa | grep foreman foreman-1.7.2.24-1.el7sat.noarch foreman-libvirt-1.7.2.24-1.el7sat.noarch ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch dell-pe1950-06.rhts.englab.brq.redhat.com-foreman-proxy-1.0-1.noarch foreman-gce-1.7.2.24-1.el7sat.noarch rubygem-hammer_cli_foreman-0.1.4.11-1.el7sat.noarch foreman-selinux-1.7.2.13-1.el7sat.noarch ruby193-rubygem-foreman_docker-1.2.0.13-1.el7sat.noarch ruby193-rubygem-foreman-redhat_access-0.1.0-1.el7sat.noarch ruby193-rubygem-foreman_discovery-2.0.0.14-1.el7sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch foreman-postgresql-1.7.2.24-1.el7sat.noarch foreman-debug-1.7.2.24-1.el7sat.noarch foreman-ovirt-1.7.2.24-1.el7sat.noarch ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch rubygem-hammer_cli_foreman_docker-0.0.3.6-1.el7sat.noarch foreman-proxy-1.7.2.4-1.el7sat.noarch dell-pe1950-06.rhts.englab.brq.redhat.com-foreman-client-1.0-1.noarch ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch dell-pe1950-06.rhts.englab.brq.redhat.com-foreman-proxy-client-1.0-1.noarch foreman-vmware-1.7.2.24-1.el7sat.noarch rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch foreman-compute-1.7.2.24-1.el7sat.noarch ruby193-rubygem-foreman-tasks-0.6.12.5-1.el7sat.noarch steps: 1. Register a RHEL instance to Satellite 6. Install virt-who 2. Creating /etc/virt-who.d/vsphere with the following contents: [vsphere] # cat /etc/virt-who.d/vsphere [vsphere] type=esx server=10.16.132.40 username=administrator password=xxxx owner=Default Organization env=Library rhsm_username=admin rhsm_password=xxxxx 3. (re)start virt-who # service virt-who restart Redirecting to /bin/systemctl restart virt-who.service 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. |
Description of problem: When configuring virt-who 0.12 to report to a Satellite 6.0.8 instance, using the rhsm_username & rhsm_password, virt-who fails with a traceback. Version-Release number of selected component (if applicable): virt-who-0.12-2.el6_6sat.noarch foreman-1.6.0.53-1.el6sat.noarch foreman-compute-1.6.0.53-1.el6sat.noarch foreman-discovery-image-6.5-20140620.2.el6sat.noarch foreman-gce-1.6.0.53-1.el6sat.noarch foreman-libvirt-1.6.0.53-1.el6sat.noarch foreman-ovirt-1.6.0.53-1.el6sat.noarch foreman-postgresql-1.6.0.53-1.el6sat.noarch foreman-proxy-1.6.0.33-1.el6sat.noarch foreman-selinux-1.6.0.14-1.el6sat.noarch foreman-vmware-1.6.0.53-1.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 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 How reproducible: 100% Steps to Reproduce: 1. Register a RHEL instance to Satellite 6.0.8. Install virt-who-0.12-2.el6_6sat.noarch 2. Creating /etc/virt-who.d/vsphere with the following contents: [vsphere] type=esx server=vmware.example.com username=Administrator password=<redacted? owner=Default Organization env=Library rhsm_username=admin rhsm_password=<redacted> 3. (re)start virt-who Actual results: virt-who fails with the following traceback and no host-guest mapping is reported to Satellite 6: 2015-04-12 23:37:07,555 [ERROR] @virtwho.py:107 - Error in communication with subscription manager: Traceback (most recent call last): File "/usr/share/virt-who/virtwho.py", line 100, in send self._sendGuestAssociation(report) File "/usr/share/virt-who/virtwho.py", line 117, in _sendGuestAssociation result = manager.hypervisorCheckIn(report.config, report.association, report.config.type) File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 133, in hypervisorCheckIn return self.connection.hypervisorCheckIn(config.owner, config.env, mapping) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 754, in hypervisorCheckIn return self.conn.request_post(url, host_guest_mapping) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 553, in request_post return self._request("POST", method, params) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 478, in _request self.validateResponse(result, request_type, handler) File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 520, in validateResponse raise RestlibException(response['status'], error_msg) RestlibException: undefined method `admin?' for nil:NilClass Expected results: virt-who reports host/guest mapping using the rhsm_* directives without traceback. Additional info: