Bug 1861255

Summary: Traceback when there is a typo proxy username/password in /etc/rhsm/rhsm.conf file
Product: Red Hat Enterprise Linux 8 Reporter: Shwetha Kallesh <skallesh>
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: 8.3CC: cdonnell, jhnidek, jsefler, redakkan, wpoteat
Target Milestone: rcKeywords: Triaged
Target Release: 8.3   
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: 2020-11-04 01:39:41 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 Shwetha Kallesh 2020-07-28 07:34:56 UTC
Description of problem:
Traceback when there is a typo proxy username/password in /etc/rhsm/rhsm.conf file

Version-Release number of selected component (if applicable):
[root@kvm-02-guest05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.27.10-1.git.3.25bc797.el8


How reproducible:
only with few commands

Steps to Reproduce:
[root@kvm-02-guest05 ~]# cat /etc/rhsm/rhsm.conf | grep proxy
# an http proxy server to use
proxy_hostname = auto-services.usersys.redhat.com
# The scheme to use for the proxy when updating repo definitions, if needed
proxy_scheme = http
# port for http proxy server
proxy_port = 3127
# user name for authenticating to an http proxy, if needed
proxy_user = redaht                    -------> please note the typo
# password for basic http proxy auth, if needed
proxy_password = redhat
# host/domain suffix blacklist for proxy, if needed
no_proxy =

[root@kvm-02-guest05 ~]# subscription-manager list --avail
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 707, in _request
    conn.request(request_type, handler, body=body, headers=final_headers)
  File "/usr/lib64/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1300, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1249, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib64/python3.6/http/client.py", line 1414, in connect
    super().connect()
  File "/usr/lib64/python3.6/http/client.py", line 950, in connect
    self._tunnel()
  File "/usr/lib64/python3.6/http/client.py", line 929, in _tunnel
    message.strip()))
OSError: Tunnel connection failed: 407 Proxy Authentication Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 176, in update_check
    self._sync_with_server(uep, consumer_uuid)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/facts.py", line 88, in _sync_with_server
    uep.updateConsumer(consumer_uuid, facts=self.get_facts())
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 1160, in updateConsumer
    ret = self.conn.request_put(method, params)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 892, in request_put
    return self._request("PUT", method, params, headers=headers)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 909, in _request
    info=info, headers=headers, cert_key_pairs=cert_key_pairs)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 743, in _request
    raise ProxyException(err)
rhsm.connection.ProxyException: Tunnel connection failed: 407 Proxy Authentication Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.27.10', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 3251, in main
    ret = CLI.main(self)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 546, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2894, in _do_command
    after_date=after_date,
  File "/usr/lib64/python3.6/site-packages/rhsmlib/services/entitlement.py", line 374, in get_available_pools
    items_per_page=_items_per_page
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managerlib.py", line 344, in get_available_entitlements
    items_per_page=items_per_page
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managerlib.py", line 563, in get_filtered_pools_list
    items_per_page=items_per_page
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managerlib.py", line 279, in list_pools
    require(FACTS).update_check(uep, consumer_uuid)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 186, in update_check
    raise Exception(_("Error updating system data on the server, see /var/log/rhsm/rhsm.log "
Exception: Error updating system data on the server, see /var/log/rhsm/rhsm.log for more details.
[root@kvm-02-guest05 ~]# subscription-manager role --list
Proxy connection failed, please check your settings.
[root@kvm-02-guest05 ~]# subscription-manager repos --list
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 707, in _request
    conn.request(request_type, handler, body=body, headers=final_headers)
  File "/usr/lib64/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1300, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1249, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/usr/lib64/python3.6/http/client.py", line 1414, in connect
    super().connect()
  File "/usr/lib64/python3.6/http/client.py", line 950, in connect
    self._tunnel()
  File "/usr/lib64/python3.6/http/client.py", line 929, in _tunnel
    message.strip()))
OSError: Tunnel connection failed: 407 Proxy Authentication Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 11, in <module>
    load_entry_point('subscription-manager==1.27.10', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 87, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 3251, in main
    ret = CLI.main(self)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cli.py", line 183, in main
    return cmd.main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 546, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2537, in _do_command
    supported_resources = get_supported_resources()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/utils.py", line 250, in get_supported_resources
    return uep.get_supported_resources()
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 959, in get_supported_resources
    self._load_supported_resources()
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 947, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 883, in request_get
    return self._request("GET", method, headers=headers, cert_key_pairs=cert_key_pairs)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 909, in _request
    info=info, headers=headers, cert_key_pairs=cert_key_pairs)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 743, in _request
    raise ProxyException(err)
rhsm.connection.ProxyException: Tunnel connection failed: 407 Proxy Authentication Required


Actual results:


Expected results:


Additional info:

Comment 4 Shwetha Kallesh 2020-08-07 10:57:57 UTC
Verification:

[root@hpe-dl380pgen8-02-vm-3 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription management rules: Unknown
subscription-manager: 1.27.13-1.el8


[root@hpe-dl380pgen8-02-vm-3 ~]# cat /etc/rhsm/rhsm.conf | grep proxy
# an http proxy server to use
proxy_hostname = auto-services.usersys.redhat.com
# The scheme to use for the proxy when updating repo definitions, if needed
proxy_scheme = http
# port for http proxy server
proxy_port = 3127
# user name for authenticating to an http proxy, if needed
proxy_user = redhat
# password for basic http proxy auth, if needed
proxy_password = redhst
# host/domain suffix blacklist for proxy, if needed
no_proxy =


[root@hpe-dl380pgen8-02-vm-3 ~]# subscription-manager list --avail
Proxy error, unable to connect to proxy server.
[root@hpe-dl380pgen8-02-vm-3 ~]# subscription-manager role --list
Proxy connection failed, please check your settings.
[root@hpe-dl380pgen8-02-vm-3 ~]# subscription-manager list --avail --ondate 2020-09-09
Proxy error, unable to connect to proxy server.
[root@hpe-dl380pgen8-02-vm-3 ~]# subscription-manager repos --list
Proxy error, unable to connect to proxy server.
[root@hpe-dl380pgen8-02-vm-3 ~]# subscription-manager refresh
Proxy error, unable to connect to proxy server.

Comment 7 errata-xmlrpc 2020-11-04 01:39:41 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 (subscription-manager bug fix and enhancement update), 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-2020:4460

Comment 8 Pino Toscano 2022-11-25 16:48:43 UTC
*** Bug 1859145 has been marked as a duplicate of this bug. ***