Bug 1709728

Summary: It is not possible to start subscription-manager-gui, when proxy server requires user authentication
Product: Red Hat Enterprise Linux 7 Reporter: Jiri Hnidek <jhnidek>
Component: subscription-managerAssignee: Jiri Hnidek <jhnidek>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 7.7CC: csnyder, jomurphy, jsefler, skallesh
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:57:32 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
Proxy pop-up dialog none

Description Jiri Hnidek 2019-05-14 08:29:55 UTC
Description of problem:
You cannot start subscription-manager-gui, when rhsm.conf contains incomplete configuration of proxy server. Proxy server and port is configured correctly, but rhsm.conf doesn't include proxy_user and proxy_pass and proxy server requires user authentication.

Version-Release number of selected component (if applicable):
[root@centos7 vagrant]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.25.5-1.git.1.d3b2ee4.el7

How reproducible:
100%

Steps to Reproduce:
1. Edit rhsm.conf to include valid proxy_serverm, proxy_port and proxy_scheme:

[root@centos7 vagrant]# grep proxy_ /etc/rhsm/rhsm.conf
proxy_hostname =192.168.121.1
proxy_scheme = http
proxy_port =3128
proxy_user =
proxy_password =

2. Try to start subscription-manager-gui

Actual results:
subscription-manager-gui is not started (it is expected), but dialog for setting proxy doesn't pop-up

Expected results:
Dialog for setting proxy pop-ups

Additional info:
Output from rhsm.log:

2019-05-14 08:28:59,728 [DEBUG] subscription_manager_gui.py:28325:MainThread @https.py:56 - Using standard libs to provide httplib and ssl
2019-05-14 08:28:59,840 [DEBUG] subscription_manager_gui.py:28325:MainThread @dbus_interface.py:39 - self.has_main_loop=True
2019-05-14 08:28:59,862 [DEBUG] subscription_manager_gui.py:28325:MainThread @ga_loader.py:91 - ga_loader GaImporterGtk3
2019-05-14 08:28:59,863 [WARNING] subscription_manager_gui.py:28325:MainThread @logutil.py:142 - logging already initialized
2019-05-14 08:28:59,928 [DEBUG] subscription_manager_gui.py:28325:MainThread @identity.py:138 - Loading consumer info from identity certificates.
2019-05-14 08:28:59,930 [DEBUG] subscription_manager_gui.py:28325:MainThread @connection.py:280 - ContentConnection
2019-05-14 08:28:59,931 [DEBUG] subscription_manager_gui.py:28325:MainThread @connection.py:924 - Connection built: http_proxy=192.168.121.1:3128 host=svice port=8443 handler=/candlepin auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=True
2019-05-14 08:28:59,932 [DEBUG] subscription_manager_gui.py:28325:MainThread @cache.py:169 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2019-05-14 08:28:59,932 [DEBUG] subscription_manager_gui.py:28325:MainThread @cache.py:186 - No changes.
2019-05-14 08:28:59,932 [DEBUG] subscription_manager_gui.py:28325:MainThread @certdirectory.py:217 - Installed product IDs: ['37060']
2019-05-14 08:28:59,933 [DEBUG] subscription_manager_gui.py:28325:MainThread @connection.py:573 - Using proxy: 192.168.121.1:3128
2019-05-14 08:28:59,933 [DEBUG] subscription_manager_gui.py:28325:MainThread @connection.py:591 - Making request: GET /candlepin/consumers/a2878b25-b1f6-4bab-9ef2-dc525e1b4727/compliance
2019-05-14 08:28:59,938 [ERROR] subscription_manager_gui.py:28325:MainThread @cache.py:236 - Tunnel connection failed: 407 Proxy Authentication Required
2019-05-14 08:28:59,938 [WARNING] subscription_manager_gui.py:28325:MainThread @cache.py:242 - Unable to reach server, using cached status.
2019-05-14 08:28:59,939 [DEBUG] subscription_manager_gui.py:28325:MainThread @cert_sorter.py:206 - Product status: valid_products=37060 partial_products= expired_products= unentitled_producs= future_products= valid_until=2019-05-20 14:11:49+00:00
2019-05-14 08:28:59,940 [DEBUG] subscription_manager_gui.py:28325:MainThread @cert_sorter.py:208 - partial stacks: []
2019-05-14 08:28:59,940 [DEBUG] subscription_manager_gui.py:28325:MainThread @connection.py:573 - Using proxy: 192.168.121.1:3128
2019-05-14 08:28:59,940 [DEBUG] subscription_manager_gui.py:28325:MainThread @connection.py:591 - Making request: GET /candlepin/
2019-05-14 08:28:59,941 [ERROR] subscription_manager_gui.py:28325:MainThread @subscription_manager_gui.py:231 - Tunnel connection failed: 407 Proxy Authentication Required
Traceback (most recent call last):
  File "/vagrant/src/subscription_manager/scripts/subscription_manager_gui.py", line 214, in main
    main = managergui.MainWindow(auto_launch_registration=options.register)
  File "/vagrant/src/subscription_manager/gui/managergui.py", line 220, in __init__
    cp.supports_resource("status")
  File "/vagrant/src/rhsm/connection.py", line 950, in supports_resource
    self._load_supported_resources()
  File "/vagrant/src/rhsm/connection.py", line 937, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/vagrant/src/rhsm/connection.py", line 746, in request_get
    return self._request("GET", method, headers=headers)
  File "/vagrant/src/rhsm/connection.py", line 772, in _request
    info=info, headers=headers)
  File "/vagrant/src/rhsm/connection.py", line 623, in _request
    raise ProxyException(err)
ProxyException: Tunnel connection failed: 407 Proxy Authentication Required

Comment 8 Shwetha Kallesh 2019-06-19 08:34:28 UTC
Created attachment 1582158 [details]
Proxy pop-up dialog

Verification as the proxy pop-up appears when user fails to provide username and passowrd for auth proxy

[root@kvm-06-guest26 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 2.3.17-1
subscription management rules: 5.35
subscription-manager: 1.24.11-1.el7

Comment 10 errata-xmlrpc 2019-08-06 12:57:32 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-2019:2008