Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1211090 - When configuring virt-who 0.12 with rhsm_username and rhsm_password with Satellite 6, virt-who fails with a traceback.
Summary: When configuring virt-who 0.12 with rhsm_username and rhsm_password with Sate...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Tom McKay
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-12 23:41 UTC by Rich Jerrido
Modified: 2017-10-23 12:30 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 14:00:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
rhsm.log demonstrating error (2.15 KB, text/plain)
2015-04-15 17:07 UTC, Rich Jerrido
no flags Details
foreman-debug from affected satellite (1.16 MB, application/x-xz)
2015-04-17 15:19 UTC, Rich Jerrido
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 10484 0 None None None 2016-04-22 15:57:53 UTC

Description Rich Jerrido 2015-04-12 23:41:44 UTC
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:

Comment 2 Radek Novacek 2015-04-14 08:29:05 UTC
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.

Comment 4 Rich Jerrido 2015-04-15 17:07:14 UTC
Created attachment 1014907 [details]
rhsm.log demonstrating error

Comment 6 Radek Novacek 2015-04-16 11:29:23 UTC
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?

Comment 7 Devan Goodwin 2015-04-17 11:45:08 UTC
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.

Comment 8 Rich Jerrido 2015-04-17 15:19:24 UTC
Created attachment 1015637 [details]
foreman-debug from affected satellite

Comment 9 Devan Goodwin 2015-04-20 11:45:54 UTC
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.

Comment 10 RHEL Program Management 2015-04-20 11:49:55 UTC
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.

Comment 12 Liushihui 2015-04-23 07:42:58 UTC
It also exist on SAM-1.4.1-RHEL-6-20141113.0

Comment 13 Tom McKay 2015-05-11 13:24:24 UTC
@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.

Comment 14 Rich Jerrido 2015-05-11 18:24:27 UTC
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.

Comment 15 Bryan Kearney 2015-05-11 19:07:47 UTC
Per Rich's comment, removing the blocker tag.

Comment 16 Tom McKay 2015-05-12 15:51:59 UTC
Created redmine issue http://projects.theforeman.org/issues/10484 from this bug

Comment 17 Tom McKay 2015-05-12 18:51:53 UTC
@rjerrido - In the end, no changes were necessary to virt-who so it could be included in 6.1, if desired and approved.

Comment 18 Bryan Kearney 2015-05-15 17:54:55 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10484 has been closed
-------------
Thomas McKay
Applied in changeset commit:katello|9149a86d492136a1c504ec47976f53e2ea81e7cf.

Comment 21 Tazim Kolhar 2015-05-21 09:26:16 UTC
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

Comment 22 Bryan Kearney 2015-08-11 13:35:00 UTC
This bug is slated to be released with Satellite 6.1.

Comment 23 Bryan Kearney 2015-08-12 14:00:13 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.


Note You need to log in before you can comment on or make changes to this bug.