Hide Forgot
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:
Fixed in: RHEL6.2 - 15c6c49f87e91e527bc8de05e43bccc6d59cd2da master - cc98b97ae0bcd5f2e7c09906b0ea56e67266014b
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).
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.
moving to VERIFIED based on testcase results in comment 3 and comment 6
(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.
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