RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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 CURRENTRELEASE
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-08-30 10:55 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-08-30 10:55:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


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.

Comment 9 Rehana 2021-08-30 10:55:25 UTC
This issue no long appears in the below version of subscription-manager 
subscription-manager: 1.28.21-2.el8


# subscription-manager register --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: *****
Password: 
The system has been registered with ID: ********
The registered system name is: ********
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 Beta
Status:       Subscribed

# subscription-manager config --server.proxy_hostname=bad-proxy.redhat.com --server.proxy_port=3129
# subscription-manager config --list | grep proxy
   no_proxy = []
   proxy_hostname = bad-proxy.redhat.com
   proxy_password = []
   proxy_port = 3129
   proxy_scheme = [http]
   proxy_user = []
]# subscription-manager list --available
Proxy error, unable to connect to proxy server.
# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Beta Access
Provides:            Red Hat Enterprise Linux for Power, little endian Beta
                     Red Hat CodeReady Linux Builder for x86_64 Beta
                     Red Hat Enterprise Linux for ARM 64 Beta
                     Red Hat CodeReady Linux Builder for Power, little endian Beta
                     Red Hat Enterprise Linux for SAP HANA for Power, little endian Beta
                     Red Hat Enterprise Linux for x86_64 Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
                     Red Hat CodeReady Linux Builder for ARM 64 Beta
                     Red Hat Enterprise Linux High Availability Beta
                     Red Hat Enterprise Linux for SAP Applications for x86_64 Beta
                     Red Hat CodeReady Linux Builder for IBM z Systems Beta
                     Red Hat Directory Server Beta
                     Red Hat Enterprise Linux for SAP Applications for Power, little endian Beta
                     Red Hat Enterprise Linux for IBM z Systems Beta
                     Red Hat Enterprise Linux Resilient Storage Beta
                     Red Hat Enterprise Linux for Real Time Beta
                     Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta
                     Red Hat Certificate System Beta
                     Red Hat Enterprise Linux for Real Time for NFV Beta
                     Red Hat Enterprise Linux Fast Datapath Beta for x86_64
                     Red Hat Enterprise Linux for SAP HANA for x86_64 Beta
                     Red Hat Enterprise Linux Advanced Virtualization Beta (for RHEL Server for IBM System Z)
SKU:                 RH00069
Contract:            
Account:             6372224
Serial:              4618308985627711492
Pool ID:             8a99f9ae7b5ee9e5017b81e07a7b0a0c
Provides Management: No
Active:              True
Quantity Used:       1
Service Type:        L1-L3
Roles:               
Service Level:       Self-Support
Usage:               
Add-ons:             
Status Details:      Subscription is current
Subscription Type:   
Starts:              08/05/2021
Ends:                08/04/2022
Entitlement Type:    Physical

Appropriate error message "Proxy error, unable to connect to proxy server." is displayed when proxy connection failed . Hence closing the bug as closed current release


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