Bug 1421010

Summary: subscription-manager gui launched successfully without error dialog when configure invalid proxy
Product: Red Hat Enterprise Linux 7 Reporter: Wei Liu <weiliu>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: medium    
Version: 7.5CC: bcourt, csnyder, jhnidek, khowell, qianzhan, redakkan, rjerrido, skallesh
Target Milestone: pre-dev-freezeKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.20.6-1 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 09:49:05 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:
Attachments:
Description Flags
the error dialog
none
the rhsm log
none
Reproducer.png
none
authentication_required
none
wrong_credentials none

Description Wei Liu 2017-02-10 06:00:55 UTC
Description of problem:
Try to launch subscription-manager gui with invalid proxy url,no dialog as shown in attachment error_message.png pops up to remind:proxy connection failed,the gui just open successfully.

Version-Release number of selected component (if applicable):
subscription-manager-gui-1.18.9-1.el6.x86_64
python-rhsm-certificates-1.18.6-1.el6.x86_64
subscription-manager-1.18.9-1.el6.x86_64
subscription-manager-firstboot-1.18.9-1.el6.x86_64
python-rhsm-1.18.6-1.el6.x86_64


How reproducible:
Always


Steps to Reproduce:
1.Install build RHEL-6.9-20170209.0
2.Open subscription-manager gui and configure the proxy with invalid one
(proxy.example.com:3128),then lick the "save" button
3.Click X button to close subscription-manager gui and try to reopen again
#subscription-manager-gui

Actual results:
The subscription-manager gui open successfully without error dialog

Expected results:
An error dialog pops up to remind : proxy connection failed


Additional info:
When configure the proxy with (error.test.com:3128),also an invalid one,the error dialog will pop up to remind.but others like (error:3128 or proxy.example.com:3128),the error dialog will not work

Comment 1 Wei Liu 2017-02-10 06:02:17 UTC
Created attachment 1248956 [details]
the error dialog

Comment 2 Wei Liu 2017-02-10 06:03:03 UTC
Created attachment 1248957 [details]
the rhsm log

Comment 4 Rehana 2017-10-11 12:44:44 UTC
Reproducing on RHEL69 machine :
=============================

subscription management server: 2.0.40-1
subscription management rules: 5.24.1
subscription-manager: 1.18.10-1.el6
python-rhsm: 1.18.6-1.el6


Demonstrates that the Error message doesnt pop-up when (proxy.example.com:3128) is used as proxy configuration 

1.Open subscription-manager gui and configure the proxy with invalid one
(proxy.example.com:3128),then click the "save" button

[root@amd-pike-06 test]# subscription-manager config --list | grep proxy
   proxy_hostname = proxy.example.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = []
2) launch 'subscription-manager-gui'

Observed that the GUI was launched with NO error message. 

Also To demonstrate that setting the proxy value to 'error.test.com:3128' , fails to launch gui with appropriate error message  (PFA: Reproducer.png)

Comment 5 Rehana 2017-10-11 12:45:17 UTC
Created attachment 1337225 [details]
Reproducer.png

Comment 6 Rehana 2017-10-11 13:47:37 UTC
Verification on RHEL75 build :
=============================

subscription-manager: 1.20.2-1.el7
python-rhsm: 1.20.2-1.el7

Observed that with all the below proxy server names , the subscription-manager gui launch was failed and error dialog was displayed 

[root@dhcp35-118 tester]# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = proxy.example.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = []
[root@dhcp35-118 tester]# subscription-manager-gui 
Proxy connection failed, please check your settings.
[root@dhcp35-118 tester]# subscription-manager-gui 
Proxy connection failed, please check your settings.
[root@dhcp35-118 tester]# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = error
   proxy_password = []
   proxy_port = 3128
   proxy_user = []
[root@dhcp35-118 tester]# subscription-manager-gui 
Proxy connection failed, please check your settings.
[root@dhcp35-118 tester]# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = error
   proxy_password = []
   proxy_port = 3129
   proxy_user = []
[root@dhcp35-118 tester]# subscription-manager-gui 
Proxy connection failed, please check your settings.
[root@dhcp35-118 tester]# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = proxy.error.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = []
[root@dhcp35-118 tester]# subscription-manager-gui 
Proxy connection failed, please check your settings.

BUT I observed that when bad /No-authentication details are given for a good proxy , the gui is launched successfully  with error message on the rhsm.log  , should this case also fail 

additional details 
==================

2017-10-11 19:04:09,081 [ERROR] subscription-manager-gui:27957:MainThread @identity.py:142 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2017-10-11 19:04:09,086 [ERROR] subscription-manager-gui:27957:MainThread @identity.py:142 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2017-10-11 19:04:09,087 [INFO] subscription-manager-gui:27957:MainThread @connection.py:832 - Connection built: http_proxy=auto-services.usersys.redhat.com:3128 host=subscription.rhsm.stage.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2017-10-11 19:04:09,372 [ERROR] rhsmd:27645:MainThread @identity.py:142 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2017-10-11 19:04:09,384 [ERROR] rhsmd:27645:MainThread @identity.py:142 - Reload of consumer identity cert /etc/pki/consumer/cert.pem raised an exception with msg: [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2017-10-11 19:04:10,412 [ERROR] subscription-manager-gui:27957:MainThread @utils.py:273 - Error while checking server version: Tunnel connection failed: 407 Proxy Authentication Required
2017-10-11 19:04:10,413 [ERROR] subscription-manager-gui:27957:MainThread @utils.py:275 - Tunnel connection failed: 407 Proxy Authentication Required
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/subscription_manager/utils.py", line 253, in get_server_versions
    if cp.supports_resource("status"):
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 858, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 845, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 656, in request_get
    return self._request("GET", method, headers=headers)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 682, in _request
    info=info, headers=headers)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 527, in _request
    conn.request(request_type, handler, body=body, headers=final_headers)
  File "/usr/lib64/python2.7/httplib.py", line 1017, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1051, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.7/httplib.py", line 826, in send
    self.connect()
  File "/usr/lib64/python2.7/httplib.py", line 1227, in connect
    HTTPConnection.connect(self)
  File "/usr/lib64/python2.7/httplib.py", line 810, in connect
    self._tunnel()
  File "/usr/lib64/python2.7/httplib.py", line 792, in _tunnel
    message.strip()))
error: Tunnel connection failed: 407 Proxy Authentication Required
^C
[root@dhcp35-118 tester]# cat /etc/rhsm/rhsm.conf | grep ^proxy
proxy_hostname =auto-services.usersys.redhat.com
proxy_port =3128
proxy_user =
proxy_password =

Comment 7 Rehana 2017-10-12 14:10:00 UTC
Moving to New , to fix comment 6 .

Comment 11 Rehana 2017-11-30 09:54:50 UTC
Verifying on latest RHEL75 build :
------------------------------
subscription-manager-rhsm-certificates-1.20.7-1.el7.x86_64
subscription-manager-rhsm-1.20.7-1.el7.x86_64
subscription-manager-1.20.7-1.el7.x86_64

1) Scenario's with wrong proxy host name and port

# subscription-manager config --server.proxy_hostname=proxy.example.com --server.proxy_port=3128
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = proxy.example.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = []

# subscription-manager config --server.proxy_hostname=error --server.proxy_port=3128
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = error
   proxy_password = []
   proxy_port = 3128
   proxy_user = []

# subscription-manager config --server.proxy_hostname=error --server.proxy_port=3129
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = error
   proxy_password = []
   proxy_port = 3129
   proxy_user = []

# subscription-manager config --server.proxy_hostname=proxy.error.com --server.proxy_port=3128
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = proxy.error.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = []

with all the above proxy configurations, message " Proxy connection failed, please check your settings" was displayed when tried to launch GUI and also user was given a option to modify the proxy setting by clicking the "Ok" button on the message. 

2) Scenario's with missing proxy authentication details

# subscription-manager config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3128
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = auto-services.usersys.redhat.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = []

following error message was displayed on the terminal and in the dialog box

# subscription-manager-gui 
Proxy authentication required, please check your settings.

PFA: authentication_required.png


3) Scenario's with wrong proxy authentication details

# subscription-manager config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3128 --server.proxy_user=redhat1 --server.proxy_password=redhat
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = auto-services.usersys.redhat.com
   proxy_password = redhat
   proxy_port = 3128
   proxy_user = redhat1

# subscription-manager config --server.proxy_hostname=auto-services.usersys.redhat.com --server.proxy_port=3128 --server.proxy_user=redhat1 --server.proxy_password=
# subscription-manager config --list | grep pro
   no_proxy = []
   proxy_hostname = auto-services.usersys.redhat.com
   proxy_password = []
   proxy_port = 3128
   proxy_user = redhat1

following error message was displayed on the terminal and in the dialog box

# subscription-manager-gui 
Wrong proxy username or password, please check your settings.

PFA: wrong_credentials.png

conclusion:

The above scenarios demontrates that now when wrong proxy details are given the subscription-manager-gui fails with appropriate error message and gives option to edit the configuration by clicking "ok" button.


Based on the above observations marking the bug as Verified!!

Comment 12 Rehana 2017-11-30 09:55:26 UTC
Created attachment 1360777 [details]
authentication_required

Comment 13 Rehana 2017-11-30 09:55:56 UTC
Created attachment 1360778 [details]
wrong_credentials

Comment 16 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.

https://access.redhat.com/errata/RHBA-2018:0681