Bug 1659070 - subscription-manager commands throw traceback when proxy is not reachable
Summary: subscription-manager commands throw traceback when proxy is not reachable
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1698322
TreeView+ depends on / blocked
 
Reported: 2018-12-13 14:04 UTC by Rehana
Modified: 2021-02-01 07:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1698322 (view as bug list)
Environment:
Last Closed: 2021-02-01 07:31:12 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

Description Rehana 2018-12-13 14:04:51 UTC
Description of problem:


Version-Release number of selected component (if applicable):
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.3.11-1
subscription management rules: 5.30
subscription-manager: 1.23.8-7.el8


How reproducible:
always

Steps to Reproduce:
1.Register system 
2.set bad proxy configuration on the rhsm.conf file 
3.# subscription-manager  config --list | grep proxy
   no_proxy = []
   proxy_hostname = bad-auto-services.usersys.redhat.com
   proxy_password = []
   proxy_port = 3129
   proxy_user = []
4.Execute subscription-manager list --available / --consumed commands 

Actual results:
# subscription-manager  list --available
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 603, in _request
    conn.request(request_type, handler, body=body, headers=final_headers)
  File "/usr/lib64/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/lib64/python3.6/http/client.py", line 1392, in connect
    super().connect()
  File "/usr/lib64/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib64/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib64/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

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.23.8', 'console_scripts', 'subscription-manager')()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/subscription_manager.py", line 85, in main
    return managercli.ManagerCLI().main()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2905, 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 506, in main
    return_code = self._do_command()
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 2567, in _do_command
    after_date=after_date,
  File "/usr/lib64/python3.6/site-packages/rhsmlib/services/entitlement.py", line 264, in get_available_pools
    after_date=after_date,
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managerlib.py", line 324, in get_available_entitlements
    overlapping, uninstalled, text, filter_string, future=future, after_date=after_date)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managerlib.py", line 530, in get_filtered_pools_list
    filter_string=filter_string, future=future, after_date=after_date):
  File "/usr/lib64/python3.6/site-packages/subscription_manager/managerlib.py", line 282, in list_pools
    profile_mgr.update_check(uep, consumer_uuid)
  File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 445, in update_check
    if not uep.supports_resource(PACKAGES_RESOURCE):
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 947, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 934, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 743, in request_get
    return self._request("GET", method, headers=headers)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 769, in _request
    info=info, headers=headers)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 615, in _request
    err))
rhsm.connection.ProxyException: Unable to connect to: bad-auto-services.usersys.redhat.com:3129 [Errno -2] Name or service not known 


Expected results:
No Trace back
Additional info:

Comment 5 Archana Pandey 2021-01-19 09:06:48 UTC
Issue also exist in case Connection Test is performed during initial-setup with wrong proxy details.

How to reproduce:

-Click on "Configure Proxy" button -------> Select "I would like to connect via an HTTP proxy" checkbox and enter invalid proxy server details and Click on test connection button

- through CLI check rhsm.log-

021-01-19 13:39:13,669 [DBG] initial-setup-graphical:7746:TestNetworkConnectionThread @connection.py:587 - Using proxy: auto-services.usersysssredhat.com:3129
2021-01-19 13:39:13,789 [ERR] initial-setup-graphical:7746:TestNetworkConnectionThread @networkConfig.py:284 - 'Unable to connect to: auto-services.usersysssredhat.com:3129 [Errno -2] Name or service not known ' when attempting to connect through auto-services.usersysssredhat.com:3129
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 719, in _request
    conn.request(request_type, handler, body=body, headers=final_headers)
  File "/usr/lib64/python3.6/http/client.py", line 1269, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1315, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1264, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1040, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.6/http/client.py", line 978, in send
    self.connect()
  File "/usr/lib64/python3.6/http/client.py", line 1429, in connect
    super().connect()
  File "/usr/lib64/python3.6/http/client.py", line 950, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib64/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/lib64/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/subscription_manager/gui/networkConfig.py", line 268, in test_connection
    cp.getStatus()
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 1627, in getStatus
    return self.conn.request_get(method)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 897, 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 923, in _request
    info=info, headers=headers, cert_key_pairs=cert_key_pairs)
  File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 749, in _request
    err))
rhsm.connection.ProxyException: Unable to connect to: auto-services.usersysssredhat.com:3129 [Errno -2] Name or service not known

Comment 6 RHEL Program Management 2021-02-01 07:31:12 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


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