Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1246409

Summary: Generate redundant "SubscriptionManagerUnregisteredError:" when unregister to system
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: xingge <gxing>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: gxing, hsun, ldai, ovasik, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.14-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 11:57:15 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:

Description Liushihui 2015-07-24 08:50:02 UTC
Description of problem:
When system unregister to satellite, it will generate redundant "SubscriptionManagerUnregisteredError:" in the virt-who's log.

Version-Release number of selected component (if applicable):
Version-Release number of selected component (if applicable):
virt-who-0.14-2.el7.noarch
subscription-manager-1.15.6-1.el7.x86_64
python-rhsm-1.15.3-1.el7.x86_64
Satellite-6.1.0-RHEL-7-20150721.7

How reproducible:
Always

Steps to Reproduce:
1.Register system to satellite
2.Configure virt-who run at libvirt mode, Then restart virt-who service
[root@hp-z220-05 /]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
[root@hp-z220-05 /]# systemctl restart virt-who
3. Unregister system, then check virt-who's log
[root@hp-z220-05 /]# subscription-manager unregister
System has been unregistered.
[root@hp-z220-05 ~]# tail -f /var/log/rhsm/rhsm.log 
2015-07-24 16:39:33,715 [DEBUG] subscription-manager:18519 @utils.py:284 - Restarted virt-who
2015-07-24 16:39:33,715 [WARNING]  @virtwho.py:333 - virt-who reload
2015-07-24 16:39:33,716 [INFO]  @virtwho.py:668 - Reloading
2015-07-24 16:39:33,717 [DEBUG]  @virtwho.py:203 - Starting infinite loop with 3600 seconds interval
2015-07-24 16:39:33,720 [INFO]  @libvirtd.py:137 - Using libvirt url: ""
2015-07-24 16:39:33,723 [DEBUG]  @libvirtd.py:210 - Virtual machine found: 7.1_Server_x86_64: 2c8198c2-8e26-4d70-89fb-9eaaf67aaf47
2015-07-24 16:39:33,723 [DEBUG]  @libvirtd.py:216 - Virtual machine found: 6.5_Client_i386: bcd6eb25-7183-4c83-bcac-08553b54440f
2015-07-24 16:39:33,724 [DEBUG]  @libvirtd.py:216 - Virtual machine found: 6.4_Server_x86_64: 83a69786-13b2-45a8-8401-6356068e30d3
2015-07-24 16:39:33,724 [DEBUG]  @libvirtd.py:216 - Virtual machine found: 7.0_Server_x86_64: cde1bad7-3c4e-4be8-a4aa-e8dd42f53d28
2015-07-24 16:39:33,724 [DEBUG]  @libvirtd.py:216 - Virtual machine found: 5.10_Server_x86_64: efbc465f-24ec-435e-8779-0ea26d4986ae
2015-07-24 16:39:33,725 [DEBUG]  @libvirtd.py:220 - Libvirt domains found: ['2c8198c2-8e26-4d70-89fb-9eaaf67aaf47', 'bcd6eb25-7183-4c83-bcac-08553b54440f', '83a69786-13b2-45a8-8401-6356068e30d3', 'cde1bad7-3c4e-4be8-a4aa-e8dd42f53d28', 'efbc465f-24ec-435e-8779-0ea26d4986ae']
2015-07-24 16:39:33,727 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-07-24 16:39:33,728 [ERROR]  @virtwho.py:168 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 158, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 183, in _sendGuestList
    manager.sendVirtGuests(report.guests)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 130, in sendVirtGuests
    self._connect()
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 115, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root
2015-07-24 16:39:33,729 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-07-24 16:39:33,729 [ERROR]  @virtwho.py:168 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 158, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 183, in _sendGuestList
    manager.sendVirtGuests(report.guests)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 130, in sendVirtGuests
    self._connect()
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 115, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root
2015-07-24 16:39:33,731 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-07-24 16:39:33,731 [ERROR]  @virtwho.py:168 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 158, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 183, in _sendGuestList
    manager.sendVirtGuests(report.guests)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 130, in sendVirtGuests
    self._connect()
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 115, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root
2015-07-24 16:39:33,732 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-07-24 16:39:33,732 [ERROR]  @virtwho.py:168 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 158, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 183, in _sendGuestList
    manager.sendVirtGuests(report.guests)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 130, in sendVirtGuests
    self._connect()
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 115, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root
2015-07-24 16:39:33,734 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-07-24 16:39:33,734 [ERROR]  @virtwho.py:168 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 158, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 183, in _sendGuestList
    manager.sendVirtGuests(report.guests)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 130, in sendVirtGuests
    self._connect()
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 115, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root
2015-07-24 16:39:33,734 [ERROR]  @virtwho.py:281 - Sending data failed 5 times, report skipped

Actual results:
It generate five times of the following info:
"SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root"

Expected results:
It should only show these error info one time. 

Additional info:

Comment 1 Radek Novacek 2015-07-30 13:16:33 UTC
Fixed in virt-who-0.14-3.el7.

Comment 3 Liushihui 2015-08-11 06:28:54 UTC
Verified it on virt-who-0.14-3.el7.noarch since virt-who won't generate redundant error info after unregister system

Verified version
virt-who-0.14-3.el7.noarch
subscription-manager-1.15.9-2.el7.x86_64
python-rhsm-1.15.4-2.el7.x86_64
Satellite 6.1.0-20150731.0

Verified process:
1.Register system to satellite
2.Configure virt-who run at libvirt mode, Then restart virt-who service
[root@hp-z220-05 /]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
[root@hp-z220-05 /]# systemctl restart virt-who
3. Unregister system, then check virt-who's log
[root@hp-z220-05 /]# subscription-manager unregister
System has been unregistered.
[root@hp-z220-05 ~]# tail -f /var/log/rhsm/rhsm.log 
2015-08-11 14:22:59,372 [DEBUG] subscription-manager:12945 @utils.py:284 - Restarted virt-who
2015-08-11 14:22:59,372 [WARNING]  @virtwho.py:340 - virt-who reload
2015-08-11 14:22:59,383 [INFO]  @virtwho.py:675 - Reloading
2015-08-11 14:22:59,383 [DEBUG]  @virtwho.py:209 - Starting infinite loop with 3600 seconds interval
2015-08-11 14:22:59,392 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-08-11 14:22:59,393 [ERROR]  @virtwho.py:174 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 166, in send
    self._sendGuestAssociation(report)
  File "/usr/share/virt-who/virtwho.py", line 197, in _sendGuestAssociation
    report.config.type)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 145, in hypervisorCheckIn
    self._connect(config)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 115, in _connect
    "Unable to read certificate, system is not registered or you are not root")
SubscriptionManagerUnregisteredError: Unable to read certificate, system is not registered or you are not root

Result: virt-who only generate one error info when unregister system, therefore, verify it

Comment 4 errata-xmlrpc 2015-11-19 11:57:15 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.

https://rhn.redhat.com/errata/RHBA-2015-2370.html