Description of problem: virt-who will crash after unregistering the system from SAM server while virt-who running in vdsm backend. Version-Release number of selected component (if applicable): virt-who-0.7-6.el5 subscription-manager-1.0.17-1.el5 subscription-manager-firstboot-1.0.17-1.el5 subscription-manager-gui-1.0.17-1.el5 python-rhsm-1.0.6-1.el5 vdsm22-4.5-69.el5 katello-headpin-all-0.2.13-1.el6_2.noarch candlepin-0.6.5-1.el6_2.noarch How reproducible: 100% Steps to Reproduce: 1.Set the virt-who config file: VIRTWHO_BACKGROUND=1 VIRTWHO_DEBUG=1 VIRTWHO_VDSM=1 2.Check the virt-who current status # service virt-who status virt-who is stopped 3.Register to SAM # subscription-manager register Username: admin Password: The system has been registered with id: 95909259-8e4a-48c4-9f4b-257c0acceff9 4.Check the rhsm.log after starting virt-who service # >/var/log/rhsm/rhsm.log # service virt-who start Starting virt-who: [ OK ] # tail -f /var/log/rhsm/rhsm.log 2012-09-24 15:02:39,939 [WARNING] @virt-who.py:413 - Listening for events is not available in VDSM or ESX mode 2012-09-24 15:02:40,028 [DEBUG] @virt-who.py:428 - Virt-who is running in vdsm mode 2012-09-24 15:02:40,028 [DEBUG] @virt-who.py:435 - Starting infinite loop with 3600 seconds interval and event handling 2012-09-24 15:02:40,118 [DEBUG] @subscriptionmanager.py:81 - Sending list of uuids: ['53032303-29bd-4b0c-89eb-3de1fed01e8e', 'fee41537-fc37-4d93-b9e7-c820af97754f'] 5.Unregister the system from SAM # subscription-manager unregister System has been un-registered. 6.Check the virt-who status # service virt-who status virt-who dead but subsys locked Actual results: After step5, virt-who service is running Expected results: After step5, virt-who crashed. Additional info: After step 5, the log info: 2012-09-24 15:03:45,957 [DEBUG] @profile.py:95 - Loading current RPM profile. 2012-09-24 15:03:46,103 [INFO] @managercli.py:252 - Client Versions: {'python-rhsm': '1.0.6-1.el5', 'subscription-manager': '1.0.17-1.el5'} 2012-09-24 15:03:46,104 [INFO] @connection.py:498 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False 2012-09-24 15:03:46,104 [INFO] @connection.py:511 - Connection Built: host: samserv.redhat.com, port: 443, handler: /sam/api 2012-09-24 15:03:46,106 [DEBUG] @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/ 2012-09-24 15:03:46,106 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-local.pem' 2012-09-24 15:03:46,106 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem' 2012-09-24 15:03:46,106 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem' 2012-09-24 15:03:46,107 [DEBUG] @connection.py:344 - Making request: GET /sam/api/ 2012-09-24 15:03:46,151 [DEBUG] @connection.py:357 - Response status: 200 2012-09-24 15:03:46,152 [DEBUG] @connection.py:528 - Server supports the following resources: 2012-09-24 15:03:46,152 [DEBUG] @connection.py:529 - {'organizations': '/api/organizations/', 'users': '/api/users/', 'roles': '/api/roles/', 'providers': '/api/providers/', 'environments': '/api/environments/', 'entitlements': '/api/entitlements/', 'systems': '/api/systems/', 'activation_keys': '/api/activation_keys/', 'consumers': '/api/consumers/'} 2012-09-24 15:03:46,206 [INFO] @managercli.py:267 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'subscription management service'} 2012-09-24 15:03:46,209 [DEBUG] @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/ 2012-09-24 15:03:46,209 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-local.pem' 2012-09-24 15:03:46,209 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem' 2012-09-24 15:03:46,210 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem' 2012-09-24 15:03:46,210 [DEBUG] @connection.py:344 - Making request: DELETE /sam/api/consumers/95909259-8e4a-48c4-9f4b-257c0acceff9 2012-09-24 15:03:46,615 [DEBUG] @connection.py:357 - Response status: 204 2012-09-24 15:03:46,615 [INFO] @managerlib.py:804 - Successfully un-registered. 2012-09-24 15:03:46,616 [INFO] @cache.py:112 - Deleting cache: /var/lib/rhsm/facts/facts.json 2012-09-24 15:03:46,616 [INFO] @cache.py:112 - Deleting cache: /var/lib/rhsm/cache/installed_products.json 2012-09-24 15:03:47,880 [DEBUG] @cert_sorter.py:106 - Sorting product and entitlement cert status for: 2012-09-24 07:03:47.879831+00:00 2012-09-24 15:03:47,881 [DEBUG] @cert_sorter.py:160 - Installed product IDs: ['69'] 2012-09-24 15:03:47,882 [DEBUG] @cert_sorter.py:113 - valid entitled products: [] 2012-09-24 15:03:47,882 [DEBUG] @cert_sorter.py:114 - expired entitled products: [] 2012-09-24 15:03:47,882 [DEBUG] @cert_sorter.py:115 - partially entitled products: [] 2012-09-24 15:03:47,882 [DEBUG] @cert_sorter.py:116 - unentitled products: ['69'] 2012-09-24 15:03:47,882 [DEBUG] @cert_sorter.py:117 - future products: [] 2012-09-24 15:03:47,882 [DEBUG] @cert_sorter.py:118 - partial stacks: [] 2012-09-24 15:03:47,883 [DEBUG] @cert_sorter.py:119 - valid stacks: [] 2012-09-24 15:03:47,884 [INFO] @certlib.py:221 - certs updated: Total updates: 0 Found (local) serial# [] Expected (UEP) serial# [] Added (new) <NONE> Deleted (rogue): <NONE> Expired (deleted): <NONE> 2012-09-24 15:03:47,887 [INFO] @repolib.py:156 - repos updated: 0 2012-09-24 15:03:47,888 [ERROR] @cache.py:150 - Unable to read cache: /var/lib/rhsm/facts/facts.json 2012-09-24 15:03:48,065 [DEBUG] @cert_sorter.py:106 - Sorting product and entitlement cert status for: 2012-09-24 07:03:48.065442+00:00 2012-09-24 15:03:48,067 [DEBUG] @cert_sorter.py:160 - Installed product IDs: ['69'] 2012-09-24 15:03:48,068 [DEBUG] @cert_sorter.py:113 - valid entitled products: [] 2012-09-24 15:03:48,068 [DEBUG] @cert_sorter.py:114 - expired entitled products: [] 2012-09-24 15:03:48,068 [DEBUG] @cert_sorter.py:115 - partially entitled products: [] 2012-09-24 15:03:48,068 [DEBUG] @cert_sorter.py:116 - unentitled products: ['69'] 2012-09-24 15:03:48,068 [DEBUG] @cert_sorter.py:117 - future products: [] 2012-09-24 15:03:48,068 [DEBUG] @cert_sorter.py:118 - partial stacks: [] 2012-09-24 15:03:48,069 [DEBUG] @cert_sorter.py:119 - valid stacks: [] 2012-09-24 15:03:48,069 [INFO] @factlib.py:52 - Facts have not changed, skipping upload. 2012-09-24 15:03:48,293 [DEBUG] @utils.py:352 - Restarted virt-who 2012-09-24 15:03:48,294 [ERROR] @virt-who.py:473 - Fatal error: Traceback (most recent call last): File "/usr/share/virt-who/virt-who.py", line 468, in ? main() File "/usr/share/virt-who/virt-who.py", line 455, in main virtWho.reloadConfig() File "/usr/share/virt-who/virt-who.py", line 231, in reloadConfig if self.virt and self.virt.virt: AttributeError: VDSM instance has no attribute 'virt' 2012-09-24 15:03:48,294 [ERROR] @virt-who.py:473 - Fatal error: Traceback (most recent call last): File "/usr/share/virt-who/virt-who.py", line 468, in ? main() File "/usr/share/virt-who/virt-who.py", line 455, in main virtWho.reloadConfig() File "/usr/share/virt-who/virt-who.py", line 231, in reloadConfig if self.virt and self.virt.virt: AttributeError: VDSM instance has no attribute 'virt'
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.
This bug has been fixed in virt-who-0.7-7.el5.
Patch for this bug was not applied in virt-who-0.7-7. Fixed in virt-who-0.7-8.el5.
Verified the bug on virt-who-0.7-8.el5, the result is PASS. Moving the status to Verified. Step: set up: virt-who is running in VDSM backend and the system has been registered to SAM 1. Unregister the system # subscription-manager unregister System has been un-registered. 2.Check the virt-who service status and the log # service virt-who status virt-who (pid 6929) is running... [root@hp-dc5850-03 ~]# tail -f /var/log/rhsm/rhsm.log 2012-09-25 10:31:00,646 [ERROR] @virt-who.py:113 - Unable to obtain status from server, UEPConnection is likely not usable: Traceback (most recent call last): File "/usr/share/virt-who/virt-who.py", line 107, in initSM self.subscriptionManager = SubscriptionManager(self.logger) File "/usr/share/virt-who/subscriptionmanager.py", line 42, in __init__ self.readConfig() File "/usr/share/virt-who/subscriptionmanager.py", line 56, in readConfig raise SubscriptionManagerError("Unable to read certificate, system is not registered or you are not root") SubscriptionManagerError: Unable to read certificate, system is not registered or you are not root 2012-09-25 10:31:00,731 [ERROR] @virt-who.py:209 - Unable to recover, retry in 60 seconds. 3. Re-register system to SAM and check the virt-who log # subscription-manager register Username: admin Password: The system has been registered with id: 02eff349-caae-4905-8fde-52c3136e9dcd [root@hp-dc5850-03 ~]# tail -f /var/log/rhsm/rhsm.log 2012-09-25 10:31:22,793 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-local.pem' 2012-09-25 10:31:22,794 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem' 2012-09-25 10:31:22,794 [DEBUG] @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem' 2012-09-25 10:31:22,794 [DEBUG] @connection.py:344 - Making request: GET /sam/api/ 2012-09-25 10:31:22,851 [DEBUG] @connection.py:357 - Response status: 200 2012-09-25 10:31:22,852 [DEBUG] @connection.py:528 - Server supports the following resources: 2012-09-25 10:31:22,852 [DEBUG] @connection.py:529 - {'organizations': '/api/organizations/', 'users': '/api/users/', 'roles': '/api/roles/', 'providers': '/api/providers/', 'environments': '/api/environments/', 'entitlements': '/api/entitlements/', 'systems': '/api/systems/', 'activation_keys': '/api/activation_keys/', 'consumers': '/api/consumers/'} 2012-09-25 10:31:22,853 [INFO] @managercli.py:267 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'subscription management service'} 2012-09-25 10:31:22,853 [INFO] @cache.py:215 - Server does not support packages, skipping profile upload. 2012-09-25 10:31:22,980 [DEBUG] @subscriptionmanager.py:81 - Sending list of uuids: ['53032303-29bd-4b0c-89eb-3de1fed01e8e', 'fee41537-fc37-4d93-b9e7-c820af97754f']
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-2013-0072.html