Subscription-manager command fails with the error "Tunnel connection failed: 407 authenticationrequired".
Environment
- Red Hat Enterprise Linux 7.x
- Red Hat Subscription-Manager.
- Red Hat Customer Portal.
Issue
- While attaching the subscription on the server it fails with the error "Tunnel connection failed: 407 authentication required".
Resolution
- Set the proper proxy details in the
/etc/rhsm/rhsm.conf
file:
proxy_hostname =
proxy_port =
proxy_user =
proxy_password =
Root Cause
- The proper proxy details were not configured in
/etc/rhsm/rhsm.conf
file, hence the server was not able to communicate with the proxy server and Red Hat CDN.
Diagnostic Steps
- Logs from /var/log/rhsm/rhsm.log:
2018-06-26 03:35:42,592 [ERROR] rhsmd:58149:MainThread @cache.py:179 - Tunnel connection failed: 407 authenticationrequired
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/subscription_manager/cache.py", line 170, in update_check
self._sync_with_server(uep, consumer_uuid)
File "/usr/lib/python2.7/site-packages/subscription_manager/cache.py", line 522, in _sync_with_server
content_tags=self.tags)
File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1001, in updateConsumer
ret = self.conn.request_put(method, params)
File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 654, in request_put
return self._request("PUT", method, params, headers=headers)
File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 671, in _request
info=info, headers=headers)
File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 527, in _request
conn.request(request_type, handler, body=body, headers=final_headers)
File "/usr/lib64/python2.7/httplib.py", line 1017, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 1051, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 826, in send
self.connect()
File "/usr/lib64/python2.7/httplib.py", line 1227, in connect
HTTPConnection.connect(self)
File "/usr/lib64/python2.7/httplib.py", line 810, in connect
self._tunnel()
File "/usr/lib64/python2.7/httplib.py", line 792, in _tunnel
message.strip()))
error: Tunnel connection failed: 407 authenticationrequired
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments