Bug 1859532
| Summary: | Proxy configuration in /etc/rhsm/rhsm.conf file is not considered by subscription-manager role,usage or addons module | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Shwetha Kallesh <skallesh> |
| Component: | subscription-manager | Assignee: | Jiri Hnidek <jhnidek> |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 8.3 | CC: | jhnidek, jsefler, redakkan, wpoteat |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1634023 | ||
When you test this, then you have to consider that usage, role and addons commands uses cache: /var/lib/rhsm/cache/valid_fields.json When you delete this file and then you set wrong values of proxy server into /etc/rhsm/rhsm.conf, then you get following result as for service-level command: [root@localhost subscription-manager]# PYTHONPATH=./src:./syspurpose/src python -m subscription_manager.scripts.subscription_manager usage --list Proxy error, unable to connect to proxy server. I'm considering this as not a bug. I actually see a traceback now with invalid proxy
[root@kvm-08-guest05 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription-manager: 1.27.10-1.git.2.ffd7a7e.el8
[root@kvm-08-guest05 ~]# ll /etc/rhsm/rhsm.conf
-rw-r--r--. 1 root root 2994 Jul 23 04:59 /etc/rhsm/rhsm.conf
[root@kvm-08-guest05 ~]#
[root@kvm-08-guest05 ~]# cat /etc/rhsm/rhsm.conf | grep proxy
# an http proxy server to use
proxy_hostname = sasadsa
# The scheme to use for the proxy when updating repo definitions, if needed
proxy_scheme = http
# port for http proxy server
proxy_port = 3129
# user name for authenticating to an http proxy, if needed
proxy_user =
# password for basic http proxy auth, if needed
proxy_password =
# host/domain suffix blacklist for proxy, if needed
no_proxy =
[root@kvm-08-guest05 ~]# cat /var/lib/rhsm/cache/valid_fields.json
cat: /var/lib/rhsm/cache/valid_fields.json: No such file or directory
[root@kvm-08-guest05 ~]# subscription-manager role --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 946, 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.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 3246, 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 899, in _do_command
self.list()
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 834, in list
valid_fields = self._get_valid_fields()
File "/usr/lib64/python3.6/site-packages/subscription_manager/managercli.py", line 675, in _get_valid_fields
valid_fields = get_syspurpose_valid_fields(uep=self.cp, identity=self.identity)
File "/usr/lib64/python3.6/site-packages/subscription_manager/syspurposelib.py", line 146, in get_syspurpose_valid_fields
syspurpose_valid_fields = cache.read_data(uep, identity)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 899, in read_data
current_data = self._sync_with_server(uep=uep, consumer_uuid=identity.uuid)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 925, in _sync_with_server
owner = cache.read_data(uep)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 899, in read_data
current_data = self._sync_with_server(uep=uep, consumer_uuid=identity.uuid)
File "/usr/lib64/python3.6/site-packages/subscription_manager/cache.py", line 969, in _sync_with_server
return uep.getOwner(consumer_uuid)
File "/usr/lib64/python3.6/site-packages/rhsm/connection.py", line 1275, in getOwner
return self.conn.request_get(method)
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 735, in _request
err))
rhsm.connection.ProxyException: Unable to connect to: sasadsa:3129 [Errno -2] Name or service not known
Moving the bug to verified as I dont see any traceback with invalid proxy and also proper message is thrown [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager version server type: This system is currently not registered. subscription management server: Unknown subscription management rules: Unknown subscription-manager: 1.27.11-1.el8 [root@hpe-dl380pgen8-02-vm-2 ~]# cat /etc/rhsm/rhsm.conf | grep proxy # an http proxy server to use proxy_hostname = autoservjv # The scheme to use for the proxy when updating repo definitions, if needed proxy_scheme = http # port for http proxy server proxy_port = 3129 # user name for authenticating to an http proxy, if needed proxy_user = # password for basic http proxy auth, if needed proxy_password = # host/domain suffix blacklist for proxy, if needed no_proxy = [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager identity This system is not yet registered. Try 'subscription-manager register --help' for more information. [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager role --list --username stage_auto_syspurpose001 --password redhat Organization: 12814047 Proxy connection failed, please check your settings. [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager register --noproxy=* Registering to: subscription.rhsm.stage.redhat.com:443/subscription Username: stage_auto_testuser Password: The system has been registered with ID: 248c3228-ff5c-4a30-9d6f-c56fadfde6e1 The registered system name is: hpe-dl380pgen8-02-vm-2.hpe2.lab.eng.bos.redhat.com [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager role --list Proxy connection failed, please check your settings. Adding verification steps for addons and usage module too [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager usage --list --username stage_auto_syspurpose001 --password redhat Organization: 12814047 Proxy connection failed, please check your settings. [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager addons --list --username stage_auto_syspurpose001 --password redhat Organization: 12814047 Proxy connection failed, please check your settings. [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager register --noproxy=* Registering to: subscription.rhsm.stage.redhat.com:443/subscription Username: stage_auto_syspurpose001 Password: CACHED_SYSPURPOSE: /var/lib/rhsm/cache/syspurpose.json The system has been registered with ID: d810505c-bd37-4eef-99c6-e4a50e967386 The registered system name is: hpe-dl380pgen8-02-vm-2.hpe2.lab.eng.bos.redhat.com [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager usage --list Proxy connection failed, please check your settings. [root@hpe-dl380pgen8-02-vm-2 ~]# subscription-manager addons --list Proxy connection failed, please check your settings. 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 |
Description of problem: Proxy configuration in /etc/rhsm/rhsm.conf file is not considered by subscription-manager role,usage or addons module Version-Release number of selected component (if applicable): [root@kvm-07-guest02 ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: Unknown subscription management rules: Unknown subscription-manager: 1.27.10-1.git.2.ffd7a7e.el8 How reproducible: Steps to Reproduce: [root@kvm-07-guest02 ~]# cat /etc/rhsm/rhsm.conf | grep proxy # an http proxy server to use proxy_hostname = autoservjv # The scheme to use for the proxy when updating repo definitions, if needed proxy_scheme = http # port for http proxy server proxy_port = 3129 # user name for authenticating to an http proxy, if needed proxy_user = # password for basic http proxy auth, if needed proxy_password = # host/domain suffix blacklist for proxy, if needed no_proxy = [root@kvm-07-guest02 ~]# subscription-manager role --list +-------------------------------------------+ Available role +-------------------------------------------+ - Red Hat Enterprise Linux Workstation - Red Hat Enterprise Linux Server - Red Hat Enterprise Linux Compute Node [root@kvm-07-guest02 ~]# subscription-manager usage --list +-------------------------------------------+ Available usage +-------------------------------------------+ - Development/Test - Production - Disaster Recovery [root@kvm-07-guest02 ~]# subscription-manager addons --list No valid values provided for "addons" Actual results: Values are listed Expected results: Proxy connection failed, please check your settings. Additional info: