Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 853885

Summary: Failed to display rhsm-icon pop-up dialog when do unsubscribe via CLI
Product: Red Hat Enterprise Linux 5 Reporter: gaoshang <sgao>
Component: subscription-managerAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9CC: dgoodwin, jsefler, liliu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 04:02:53 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:
Bug Depends On:    
Bug Blocks: 771748    
Attachments:
Description Flags
rhsm.log file
none
the poping up dialog none

Description gaoshang 2012-09-03 08:53:04 UTC
Created attachment 609299 [details]
rhsm.log file

Description of problem:
Failed to display rhsm-icon poping up dialog  when doing unsubscribe via CLI with build 1.0.17 on RHEL 5.9 server x86_64 

Version-Release number of selected component (if applicable):
subscription-manager-migration-1.0.17-1.el5
subscription-manager-gui-1.0.17-1.el5
subscription-manager-firstboot-1.0.17-1.el5
subscription-manager-debuginfo-1.0.17-1.el5
subscription-manager-1.0.17-1.el5
python-rhsm-1.0.6-1.el5

How reproducible:
always

Steps to Reproduce:
1.The system is registered to a candlepin and subscribed.

2.Unsubscribe subscriptions via CLI.
#subscription-manager unsubscribe --all
  
Actual results:
The notification pop-up dialog didn't display.

Expected results:
The notification pop-up dialog should display to reminder you that your system status has changed

Additional info:

Comment 1 RHEL Program Management 2012-09-03 09:09:00 UTC
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.

Comment 2 Devan Goodwin 2012-09-24 14:50:58 UTC
I think I had this reproduced on Friday but could not find the fix. I started again today but now the issue is not happening for me at all.

The call to check if we need to display the popup notification is made regardless if we're unsubscribing by serial or with --all. Today I can repeatably subscribe/unsubscribe and the icon always updates appropriately.

Can't really reproduce right now, going to try again later and see if I can isolate what it was. QE if you have time and could try again and see if you find it working, not working, or why, please let me know!

Comment 3 gaoshang 2012-09-25 08:01:14 UTC
I made a further investigation about this issue, and found that:
The poping up dialog can only be shown up when it is the first time to unsubscribe. Steps as follows:
1,The system is registered to a candlepin and subscribed.
2,Logout system and login again.
3,Unsubscribe subscriptions via CLI.
    #subscription-manager unsubscribe --all
the poping up dialog was shown up, please see the picture attached.

After that, subscribe and then unsubscribe from command line, the poping up dialog never appears.

I compared the log files in /var/log/rhsm/rhsm.log and found nothing unusual.

Comment 4 gaoshang 2012-09-25 08:03:23 UTC
Created attachment 616906 [details]
the poping up dialog

the poping up dialog diplayed when first unsubscribe

Comment 5 Devan Goodwin 2012-09-26 11:33:12 UTC
Can you clarify, are you seeing the icon in the toolbar, just no popup? Or do you see neither the icon nor the popup.

I think I now have the popup not appearing, but the icon does show up.

Comment 6 gaoshang 2012-09-26 12:06:42 UTC
(In reply to comment #5)
> Can you clarify, are you seeing the icon in the toolbar, just no popup? Or
> do you see neither the icon nor the popup.
> 
> I think I now have the popup not appearing, but the icon does show up.
yes, the icon show up here too, only the popup dialog failed to display.

Comment 7 Devan Goodwin 2012-09-26 15:09:48 UTC
Thanks for the quick clarification!

I have it reproducing at the moment, however on Monday I couldn't reproduce at all, the popup came up each time and as far as I can tell I'm doing nothing differently, so it's very hard to say what is going on here.

I have verified that every line of our code is being run both on the first popup and when we re-show the icon (but fail to pop-up), so no code logic errors seem to be present. I am starting to suspect some kind of bug or misuse of GTK code here.

Killing the rhsm-icon process and restarting it on the CLI with debug is useful for reproducing: rhsm-icon -i -d. Each time it will pop up once after restart and then stop, only the icon will re-appear in toolbar.

No errors appear to be logged in any location I can find.

Still investigating.

Comment 8 Devan Goodwin 2012-09-26 15:13:25 UTC
Problem appears on RHEL6 as well.

It is not specific to unsubscribe --all, --serial seems to do the same. I suspect any operation that forces a re-check.

Comment 9 gaoshang 2012-09-28 06:14:01 UTC
The poppup dialog can always show up in RHEL 6.3. by comparing the log files in RHEL 6.3 and in RHEL 5.9, I found this log info missed in RHEL 5.9: 

2012-09-28 13:52:33,954 [INFO]  @managercli.py:1204 - Warning: This machine has been unsubscribed from all subscriptions.

Hope it can help.

Log file when doing unsubscribe in RHEL 6.3:

2012-09-28 13:52:31,988 [DEBUG]  @connection.py:147 - ContectConnection
2012-09-28 13:52:31,990 [INFO]  @connection.py:484 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2012-09-28 13:52:31,990 [INFO]  @connection.py:495 - Connection Built: host: subscription.rhn.redhat.com, port: 443, handler: /subscription
2012-09-28 13:52:31,991 [DEBUG]  @connection.py:306 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-09-28 13:52:31,991 [DEBUG]  @connection.py:288 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-09-28 13:52:31,991 [DEBUG]  @connection.py:288 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-09-28 13:52:31,992 [DEBUG]  @connection.py:327 - Making request: DELETE /subscription/consumers/216f60fd-e0e3-4d25-9fba-17bfdff71dc3/entitlements
2012-09-28 13:52:33,954 [DEBUG]  @connection.py:340 - Response status: 200
-------------------------------------------------------------------------------
2012-09-28 13:52:33,954 [INFO]  @managercli.py:1204 - Warning: This machine has been unsubscribed from all subscriptions.
-------------------------------------------------------------------------------
2012-09-28 13:52:34,039 [DEBUG]  @connection.py:306 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-09-28 13:52:34,039 [DEBUG]  @connection.py:288 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-09-28 13:52:34,039 [DEBUG]  @connection.py:288 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-09-28 13:52:34,039 [DEBUG]  @connection.py:327 - Making request: GET /subscription/consumers/216f60fd-e0e3-4d25-9fba-17bfdff71dc3/certificates/serials
2012-09-28 13:52:35,696 [DEBUG]  @connection.py:340 - Response status: 200
2012-09-28 13:52:35,697 [INFO]  @certlib.py:194 - certs updated:
Total updates: 1
Found (local) serial# [2269577282103417813L]
Expected (UEP) serial# []
Added (new)
  <NONE>
Deleted (rogue):
  [sn:2269577282103417813 (Red Hat Enterprise Linux Server,) @ /etc/pki/entitlement/2269577282103417813.pem]
  [sn:2269577282103417813 (Red Hat Enterprise Linux Resilient Storage (for RHEL Server),) @ /etc/pki/entitlement/2269577282103417813.pem]
  [sn:2269577282103417813 (Red Hat Enterprise Linux Scalable File System (for RHEL Server),) @ /etc/pki/entitlement/2269577282103417813.pem]
  [sn:2269577282103417813 (Red Hat Beta,) @ /etc/pki/entitlement/2269577282103417813.pem]
  [sn:2269577282103417813 (Red Hat Enterprise Linux Load Balancer (for RHEL Server),) @ /etc/pki/entitlement/2269577282103417813.pem]
  [sn:2269577282103417813 (Red Hat Enterprise Linux High Availability (for RHEL Server),) @ /etc/pki/entitlement/2269577282103417813.pem]
  [sn:2269577282103417813 (Red Hat Enterprise Linux Workstation,) @ /etc/pki/entitlement/2269577282103417813.pem]
Expired (not deleted):
  <NONE>
Expired (deleted):
  <NONE>

Log file when doing unsubscribe in RHEL 5.9:

2012-09-28 00:01:15,324 [DEBUG]  @profile.py:95 - Loading current RPM profile.
2012-09-28 00:01:15,383 [INFO]  @managercli.py:252 - Client Versions: {'python-rhsm': '1.0.9-1.el5', 'subscription-manager': '1.0.20-1.el5'} 
2012-09-28 00:01:15,383 [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-28 00:01:15,383 [INFO]  @connection.py:511 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2012-09-28 00:01:15,384 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-09-28 00:01:15,384 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-09-28 00:01:15,385 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-09-28 00:01:15,385 [DEBUG]  @connection.py:329 - Using proxy: squid.corp.redhat.com:3128
2012-09-28 00:01:15,385 [DEBUG]  @connection.py:344 - Making request: GET https://subscription.rhn.stage.redhat.com:443/subscription/
2012-09-28 00:01:17,747 [DEBUG]  @connection.py:357 - Response status: 200
2012-09-28 00:01:17,748 [DEBUG]  @connection.py:528 - Server supports the following resources:
2012-09-28 00:01:17,748 [DEBUG]  @connection.py:529 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2012-09-28 00:01:17,785 [INFO]  @managercli.py:267 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'subscription management service'} 
2012-09-28 00:01:17,786 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-09-28 00:01:17,786 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-09-28 00:01:17,787 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-09-28 00:01:17,787 [DEBUG]  @connection.py:329 - Using proxy: squid.corp.redhat.com:3128
2012-09-28 00:01:17,787 [DEBUG]  @connection.py:344 - Making request: DELETE https://subscription.rhn.stage.redhat.com:443/subscription/consumers/ad964a95-0981-4c40-8473-baa22bc38296/entitlements
2012-09-28 00:01:20,576 [DEBUG]  @connection.py:357 - Response status: 200
2012-09-28 00:01:21,233 [DEBUG]  @connection.py:323 - Loading CA PEM certificates from: /etc/rhsm/ca/
2012-09-28 00:01:21,233 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2012-09-28 00:01:21,233 [DEBUG]  @connection.py:305 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2012-09-28 00:01:21,234 [DEBUG]  @connection.py:329 - Using proxy: squid.corp.redhat.com:3128
2012-09-28 00:01:21,234 [DEBUG]  @connection.py:344 - Making request: GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/ad964a95-0981-4c40-8473-baa22bc38296/certificates/serials
2012-09-28 00:01:23,768 [DEBUG]  @connection.py:357 - Response status: 200
2012-09-28 00:01:23,770 [INFO]  @certlib.py:221 - certs updated:
Total updates: 1
Found (local) serial# [3356991319272344490L]
Expected (UEP) serial# []
Added (new)
  <NONE>
Deleted (rogue):
  [sn:3356991319272344490 (Red Hat Beta,) @ /etc/pki/entitlement/3356991319272344490.pem]
  [sn:3356991319272344490 (Red Hat Enterprise Linux Desktop,) @ /etc/pki/entitlement/3356991319272344490.pem]
Expired (deleted):
  <NONE>

Comment 10 gaoshang 2012-09-28 06:15:55 UTC
I found another issue which I think have the same root cause with this bug, so I added it here.
According to test case, rhsm-icon poping up dialog should not display when doing unsubscribe via GUI, but it is shown up.

Steps as follows:
1,The system is registered to a candlepin and subscribed.
2,Logout system and login again.
3,Unsubscribe subscriptions via subscription-manager-gui by clicking "Unsubscribe" button.

Actual results:
The popup dialog show up.

Expected results:
The popup dialog should not display.

Comment 11 Devan Goodwin 2012-09-28 15:34:46 UTC
I was able to reproduce the issue on RHEL 6 using latest subscription-manager. It may not occur all the time as I quite certain I was unable to get it to happen on RHEL 5 at times.

The GUI unsubscribe is linked into the icon as well so as far as the code is concerned, this is supposed to happen. If you have test cases saying otherwise they should be adjusted, or if that behaviour is important for some reason it shoulf be a separate bug. (though IMO it should pop up after a gui unsubscribe)

We are very close to a fix, we have the popup coming up reliably but are still working on some issues around where it shows up. Won't be much longer.

Comment 12 Devan Goodwin 2012-10-01 15:50:44 UTC
Fixed in subscription-manager.git master: a83b0d8faefce163f2c4f5d26630f2107844f4c3

awood will bring into 5.9 branch.

Comment 15 gaoshang 2012-10-08 02:57:27 UTC
Verify this bug on RHEL client 5.9 x86_64 with 

[root@localhost ~]# rpm -qa | grep subscription
subscription-manager-debuginfo-1.0.21-1.el5
subscription-manager-1.0.21-1.el5
subscription-manager-migration-1.0.21-1.el5
subscription-manager-gui-1.0.21-1.el5
subscription-manager-firstboot-1.0.21-1.el5

unsubscribe via CLI multple times, the pop up dialog can show up correctly

Mark this bug as verified.

Comment 17 errata-xmlrpc 2013-01-08 04:02:53 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-2013-0033.html