Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log

Latest response

Please check the error

[munish259272@munish259272example ~]$ sudo subscription-manager list --available
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.
[munish259272@munish259272example ~]$ sudo subscription-manager remove --all
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.

THERE IS NO PROBLEM WITH INTERNET curl google.com WORKS FINE

CONTENTS FOR /var/log/rhsm/rhsm.log:
2023-01-21 12:42:45,250 [ERROR] subscription-manager:1085813:MainThread @cli.py:60 - exception caught in subscription-manager
2023-01-21 12:42:45,250 [ERROR] subscription-manager:1085813:MainThread @cli.py:61 - [Errno 110] Connection timed out
Traceback (most recent call last):
File "/usr/lib64/python3.9/site-packages/subscription_manager/cli_command/cli.py", line 342, in main
return_code = self._do_command()
File "/usr/lib64/python3.9/site-packages/subscription_manager/cli_command/list.py", line 344, in _do_command
epools = entitlement.EntitlementService().get_available_pools(
File "/usr/lib64/python3.9/site-packages/rhsmlib/services/entitlement.py", line 390, in get_available_pools
available_pools = managerlib.get_available_entitlements(
File "/usr/lib64/python3.9/site-packages/subscription_manager/managerlib.py", line 332, in get_available_entitlements
dlist = pool_stash.get_filtered_pools_list(
File "/usr/lib64/python3.9/site-packages/subscription_manager/managerlib.py", line 558, in get_filtered_pools_list
pools = list_pools(
File "/usr/lib64/python3.9/site-packages/subscription_manager/managerlib.py", line 276, in list_pools
require(FACTS).update_check(uep, consumer_uuid)
File "/usr/lib64/python3.9/site-packages/subscription_manager/cache.py", line 188, in update_check
raise e
File "/usr/lib64/python3.9/site-packages/subscription_manager/cache.py", line 176, in update_check
self._sync_with_server(uep, consumer_uuid)
File "/usr/lib64/python3.9/site-packages/subscription_manager/facts.py", line 85, in _sync_with_server
uep.updateConsumer(consumer_uuid, facts=self.get_facts())
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 1266, in updateConsumer
ret = self.conn.request_put(method, params)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 938, in request_put
return self._request("PUT", method, params, headers=headers)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 961, in _request
result = super(Restlib, self)._request(request_type, method,
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 745, in _request
conn.request(request_type, handler, body=body, headers=final_headers)
File "/usr/lib64/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/lib64/python3.9/http/client.py", line 980, in send
self.connect()
File "/usr/lib64/python3.9/http/client.py", line 1447, in connect
super().connect()
File "/usr/lib64/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/usr/lib64/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/lib64/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
2023-01-21 12:46:18,241 [ERROR] subscription-manager:1087962:MainThread @entcertlib.py:118 - [Errno 110] Connection timed out
Traceback (most recent call last):
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 116, in perform
expected = self._get_expected_serials()
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 291, in _get_expected_serials
exp = self.get_certificate_serials_list()
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 271, in get_certificate_serials_list
reply = self.uep.getCertificateSerials(identity.uuid)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 1448, in getCertificateSerials
return self.conn.request_get(method)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 929, in request_get
return self._request("GET", method, headers=headers, cert_key_pairs=cert_key_pairs)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 961, in _request
result = super(Restlib, self)._request(request_type, method,
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 745, in _request
conn.request(request_type, handler, body=body, headers=final_headers)
File "/usr/lib64/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/lib64/python3.9/http/client.py", line 980, in send
self.connect()
File "/usr/lib64/python3.9/http/client.py", line 1447, in connect
super().connect()
File "/usr/lib64/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/usr/lib64/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/lib64/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
2023-01-21 12:46:18,242 [ERROR] subscription-manager:1087962:MainThread @entcertlib.py:119 - Cannot modify subscriptions while disconnected
2023-01-21 12:46:18,242 [ERROR] subscription-manager:1087962:MainThread @cli.py:60 - Unable to perform remove due to the following exception:
2023-01-21 12:46:18,242 [ERROR] subscription-manager:1087962:MainThread @cli.py:61 -
Traceback (most recent call last):
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 116, in perform
expected = self._get_expected_serials()
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 291, in _get_expected_serials
exp = self.get_certificate_serials_list()
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 271, in get_certificate_serials_list
reply = self.uep.getCertificateSerials(identity.uuid)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 1448, in getCertificateSerials
return self.conn.request_get(method)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 929, in request_get
return self._request("GET", method, headers=headers, cert_key_pairs=cert_key_pairs)
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 961, in _request
result = super(Restlib, self)._request(request_type, method,
File "/usr/lib64/python3.9/site-packages/rhsm/connection.py", line 745, in _request
conn.request(request_type, handler, body=body, headers=final_headers)
File "/usr/lib64/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib64/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/lib64/python3.9/http/client.py", line 980, in send
self.connect()
File "/usr/lib64/python3.9/http/client.py", line 1447, in connect
super().connect()
File "/usr/lib64/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/usr/lib64/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/lib64/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/python3.9/site-packages/subscription_manager/cli_command/remove.py", line 105, in _do_command
total = ent_service.remove_all_entitlements()
File "/usr/lib64/python3.9/site-packages/rhsmlib/services/entitlement.py", line 505, in remove_all_entitlements
self.entcertlib.update()
File "/usr/lib64/python3.9/site-packages/subscription_manager/certlib.py", line 30, in update
self.report = self.locker.run(self._do_update)
File "/usr/lib64/python3.9/site-packages/subscription_manager/certlib.py", line 16, in run
return action()
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 39, in _do_update
return action.perform()
File "/usr/lib64/python3.9/site-packages/subscription_manager/entcertlib.py", line 120, in perform
raise Disconnected()
subscription_manager.entcertlib.Disconnected

Responses

Hi,
sudo subscription-manager list --available

try this
If you know that this errata advisory does not apply to a system listed, the package profile for that server may be out of date. In that case you should refresh the system's package profile by running the following commands as root on that system:

(1) rm -f /var/lib/rhsm/packages/packages.json
(2) service rhsmcertd restart (please allow up to 4 hours for the package profile to be reported to the customer portal)
subscription-manager register --auto-attach --force
If success show this?
sudo subscription-manager list --available
[sudo] password for Foysalisp:
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Beta Access

Thanks.

Hello Mukesh,

Check if this helps you there https://access.redhat.com/solutions/1323123

On a general note, you may clear out the yum/dnf cached contents, clean out all/old entitlements details from the system and register it again. This works out at times.

# subscription-manager remove --all
# subscription-manager unregister
# subscription-manager clean
# rm -rf /var/cache/yum/*

# subscription-manager register
# subscription-manager refresh
# subscription-manager identity

Hope this helps!