Bug 1659070 - subscription-manager commands throw traceback when proxy is not reachable
Summary: subscription-manager commands throw traceback when proxy is not reachable
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 8.0
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
Depends On:
Blocks: 1698322
TreeView+ depends on / blocked
Reported: 2018-12-13 14:04 UTC by Rehana
Modified: 2019-12-01 15:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1698322 (view as bug list)
Last Closed:
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:

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
  File "/usr/lib64/python3.6/http/client.py", line 964, in send
  File "/usr/lib64/python3.6/http/client.py", line 1392, in 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
  File "/usr/lib64/python3.6/site-packages/rhsmlib/services/entitlement.py", line 264, in get_available_pools
  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
  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
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:

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