RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 746241 - UEPConnection.updateConsumer will not allow passing [] for facts, installed_products, or guest_uuids
Summary: UEPConnection.updateConsumer will not allow passing [] for facts, installed_p...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-rhsm
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michael Stead
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel62 748554
TreeView+ depends on / blocked
 
Reported: 2011-10-14 13:52 UTC by Michael Stead
Modified: 2013-01-10 10:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 17:26:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
rhsmcertd restart log (7.29 KB, text/plain)
2011-10-17 18:58 UTC, J.C. Molet
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1696 0 normal SHIPPED_LIVE python-rhsm bug fix update 2011-12-06 00:49:52 UTC

Description Michael Stead 2011-10-14 13:52:28 UTC
Description of problem:
UEPConnection.updateConsumer(...) will not pass [] to the update request for either of facts, installed_products, or guest_uuids. If either are [], it is not added as a parameter of the POST request.

There are a couple of side effects here:

1) rhsmcertd - If an update occurs and there are no products installed (last update had > 1 products), an exception will be thrown.

2) virt-who - If virt-who attempts to update a host's guests, but there are none, an exception is thrown.



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


How reproducible:
Always

Steps to Reproduce:

RHSMCERTD
----------
1. Add a product cert to /etc/pki/product
2. sudo service rhsmcertd restart
3. Remove all products from /etc/pki/product
4. sudo service rhsmcertd restart
5. Check /var/log/rhsm/rhsm.log for error.

2011-10-14 09:38:36,676 [ERROR]  @certmgr.py:131 - Error while updating certificates using daemon
2011-10-14 09:38:36,677 [ERROR]  @certmgr.py:133 - Error updating system data, see /var/log/rhsm/rhsm.log for more details.
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 124, in <module>
    main(options)
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 103, in main
    updates = mgr.update(options.autoheal)
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 79, in update
    updates += lib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 62, in update
    return self._do_update()
  File "/usr/share/rhsm/subscription_manager/cache.py", line 58, in _do_update
    return mgr.update_check(self.uep, consumer_uuid)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 166, in update_check
    raise Exception(_("Error updating system data, see /var/log/rhsm/rhsm.log "
Exception: Error updating system data, see /var/log/rhsm/rhsm.log for more details.


VIRT-WHO
1. Run virt-who on a host (registered with Candlepin) that has no guests.
2. An exception should occur.
  

Expected results:
1) Should be able to pass [] as any parameter for updateConsumer.

i.e: connection.updateConsumer(uuid, guest_uuids=[])

2) The above side effects should not occur (no exceptions).

Additional info:

Comment 2 Michael Stead 2011-10-14 17:22:27 UTC
Fixed in:

RHEL6.2 - 15c6c49f87e91e527bc8de05e43bccc6d59cd2da
master - cc98b97ae0bcd5f2e7c09906b0ea56e67266014b

Comment 3 J.C. Molet 2011-10-17 18:58:27 UTC
Created attachment 528627 [details]
rhsmcertd restart log

Testing RHSMCERTD case:


[root@jmolet-vm0 product]# subscription-manager register --user testuser1 --pass password --org admin
The system has been registered with id: beade878-d357-4c9b-b715-4f7ee50d4dec 
[root@jmolet-vm0 product]# ls
100000000000008_.pem
[root@jmolet-vm0 product]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+

ProductName:        	Awesome OS for x86_64/s390x Bits
Version:            	3.11                     
Arch:               	x86_64,s390x             
Status:             	Not Subscribed           
Starts:             	                         
Expires:            	                         

[root@jmolet-vm0 product]# service rhsmcertd restart
Stopping rhsmcertd                                         [  OK  ]
Starting rhsmcertd 240 1440                                [  OK  ]
[root@jmolet-vm0 product]# pwd && ls
/etc/pki/product
100000000000008_.pem
[root@jmolet-vm0 product]# rm 100000000000008_.pem 
rm: remove regular file `100000000000008_.pem'? y
[root@jmolet-vm0 product]# service rhsmcertd restart
Stopping rhsmcertd                                         [  OK  ]
Starting rhsmcertd 240 1440                                [  OK  ]
[root@jmolet-vm0 product]# rhsm-version
subscription-manager-0.96.15-1.git.2.6c0ad28.el6.x86_64
subscription-manager-gnome-0.96.15-1.git.2.6c0ad28.el6.x86_64
python-rhsm-0.96.13-1.git.1.15c6c49.el6.noarch
subscription-manager-firstboot-0.96.15-1.git.2.6c0ad28.el6.x86_64


No errors fine, and the system passed a blank array successfully (see attached log).

Comment 6 John Sefler 2011-11-01 21:33:21 UTC
Verifying virt-who case...

candlepin version...
[root@jsefler-onprem-62candlepin candlepin]# git show | egrep "commit|Date"
commit 7cb7dbe8d5e2892dcbcbf3d77a61541ca221c18f
Date:   Fri Oct 28 17:02:41 2011 -0400
    Automatic commit of package [candlepin] release [0.4.25-1].

virt-who version installed...
[root@hp-dl580g5-01 ~]# rpm -q virt-who
virt-who-0.3-3.el6.noarch


[root@hp-dl580g5-01 ~]# subscription-manager facts --list | grep is_guest
virt.is_guest: False
[root@hp-dl580g5-01 ~]# service libvirtd start
Starting libvirtd daemon: [  OK  ]
[root@hp-dl580g5-01 ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: 09378ce2-479e-410e-9c09-16dda78483f8 
[root@hp-dl580g5-01 ~]# 
[root@hp-dl580g5-01 ~]# virsh list
 Id Name                 State
----------------------------------

[root@hp-dl580g5-01 ~]# echo "" > /var/log/rhsm/rhsm.log 
[root@hp-dl580g5-01 ~]# virt-who -d
Sending update to updateConsumer: []
[root@hp-dl580g5-01 ~]# cat /var/log/rhsm/rhsm.log 

2011-11-01 16:17:59,981 [DEBUG]  @subscriptionmanager.py:72 - Sending update to updateConsumer: []
[root@hp-dl580g5-01 ~]# 


^^^ Verified that virt-who sent updateConsumer with no guests to candlepin and no traceback was encountered in rhsm.log


[root@hp-dl580g5-01 ~]# curl -k -u testuser1:password https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/consumers/09378ce2-479e-410e-9c09-16dda78483f8/guests | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     2    0     2    0     0     18      0 --:--:-- --:--:-- --:--:--    43
[]
[root@hp-dl580g5-01 ~]# 

^^^ And as expected... the consumer has no virt guests known to candlepin api.

Comment 7 John Sefler 2011-11-01 21:34:31 UTC
moving to VERIFIED based on testcase results in comment 3 and comment 6

Comment 8 John Sefler 2011-11-02 14:30:00 UTC
(In reply to comment #6)

> [root@hp-dl580g5-01 ~]# curl -k -u testuser1:password
> https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/consumers/09378ce2-479e-410e-9c09-16dda78483f8/guests
> | python -mjson.tool
>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                  Dload  Upload   Total   Spent    Left  Speed
>   0     2    0     2    0     0     18      0 --:--:-- --:--:-- --:--:--    43
> []
> [root@hp-dl580g5-01 ~]# 
> 
> ^^^ And as expected... the consumer has no virt guests known to candlepin api.

^^ Disregard this assertion.  The candlepin API call to /consumers/09378ce2-479e-410e-9c09-16dda78483f8/guests is supposed to return the REGISTERED GUESTS and not just the GUESTS.  This was my misunderstanding of the candlepin API.

Comment 9 errata-xmlrpc 2011-12-06 17:26:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1696.html


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