Bug 1448501 - GUI: Subscription-manager cannot unregister a system once network is up again
Summary: GUI: Subscription-manager cannot unregister a system once network is up again
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Jiri Hnidek
QA Contact: Jan Stavel
Depends On:
TreeView+ depends on / blocked
Reported: 2017-05-05 15:07 UTC by Jan Stavel
Modified: 2018-04-10 09:49 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.20.2-1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2018-04-10 09:49:05 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1642 None None None 2017-05-30 07:01:34 UTC
Red Hat Product Errata RHBA-2018:0681 None None None 2018-04-10 09:49:28 UTC

Description Jan Stavel 2017-05-05 15:07:44 UTC
Description of problem:

Sub-man-gui should be able to unregister a system once network is up again.

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

  Red Hat Enterprise Linux Workstation release 7.4 Beta (Maipo)
  ----------------------------     ----------------------------
  arch                             x86_64
  kernel version                   3.10.0-663.el7.x86_64
  ----------------------------     ----------------------------
  server type                      Red Hat Subscription Management
  subscription management server
  subscription management rules    5.15.1
  subscription-manager             1.19.12-1.el7
  python-rhsm                      1.19.6-1.el7
  ----------------------------     ----------------------------
  Product                          71.pem
  ----------------------------     ----------------------------
  Entitlement                      7608889971651551168.pem
  ----------------------------     ----------------------------

Steps to Reproduce:

Given a system is registered
 and subscription-manager-gui is run
 and network is down
When network is up again
 and I click 'Unregister' button
Then the application should unregister the system.

Actual results:

The application raises an error message 'Network error. Unable to connect a server'.

Expected results:

The application should unregister the system.

Additional info:

It is similar to a case RHEL7-23897
RHSM-TC : Subscription-manager-gui : running instance of subscription-manager gui reads updated network details

Comment 2 Jiri Hnidek 2017-05-15 13:37:07 UTC
I'm able to reproduce this bug.

Comment 3 Jiri Hnidek 2017-05-16 13:25:35 UTC
The problem is deeper than I thought it will be. When you will run following simple C application using system call getaddrinfo():


then you will notice same problem.

Comment 4 Jiri Hnidek 2017-05-24 12:27:42 UTC
I was able to prove this bug can be fixed using calling res_init() adding to previous example. Look also at this:


The socket module does not have api for res_init(), but salt stack uses following hack:


Comment 5 Jiri Hnidek 2017-05-24 12:50:14 UTC
Cool, sub-man GUI has method reset_resolver() using ctypes and direct glibc res_init() in similar way as salt stack does it. Thus it is not so complicated to fix it.

Comment 6 Jan Stavel 2017-05-24 17:05:59 UTC

I am comping at the bit to automate this scenarion!

Comment 8 Rehana 2017-11-10 08:46:49 UTC
reproducing the failure on RHEL74

subscription management server: 2.2.0-1
subscription management rules: 5.26
subscription-manager: 1.19.21-1.el7
python-rhsm: 1.19.9-1.el7

1) register client to candlepin
2) launch gui
3) stop network
4) try to unregister from GUI--> notice network error ( expected ) 
5) start network service
6) Again try to unregister from GUI 

Observed an error message 'Network error. Unable to connect a server'.

Verifying on RHEL75:

Followed the same steps , observed that system was unregistered from the GUI with out any network error.

rhsm.log for reference:

2017-11-10 14:14:04,037 [INFO] subscription-manager-gui:15480:MainThread @managergui.py:497 - Unregister button pressed, asking for confirmation.
2017-11-10 14:14:06,158 [INFO] subscription-manager-gui:15480:MainThread @managergui.py:472 - Proceeding with un-registration: 6e2874e2-d592-4e93-b91f-d2eea484c968
2017-11-10 14:14:06,322 [INFO] subscription-manager-gui:15480:MainThread @connection.py:556 - Response: status=204, requestUuid=d32f3f7e-18e1-45ce-9f1a-4cbe26676140, request="DELETE /candlepin/consumers/6e2874e2-d592-4e93-b91f-d2eea484c968"
2017-11-10 14:14:06,323 [INFO] subscription-manager-gui:15480:MainThread @unregister.py:55 - Successfully un-registered.

based on the above observations , marking the bug as "Verified"

Comment 11 errata-xmlrpc 2018-04-10 09:49:05 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.


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