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 1298327 - Status Cache not used when listing repos with a bad proxy
Summary: Status Cache not used when listing repos with a bad proxy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Chris Snyder
QA Contact: Jan Stavel
URL:
Whiteboard:
Depends On:
Blocks: 1176219 1306005
TreeView+ depends on / blocked
 
Reported: 2016-01-13 19:12 UTC by Chris Snyder
Modified: 2016-06-08 17:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-10 20:39:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1176219 0 low CLOSED subscription-manager repos --list with bad proxy options is silently using cache 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2016:0797 0 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-01-06 16:31:50 UTC

Internal Links: 1176219

Description Chris Snyder 2016-01-13 19:12:03 UTC
Description of problem:
When attempting to reproduce bz 1176219 I discovered that the cache was no longer being used at all due to an unhandled exception in network communication that occurs before the silent usage of the status cache.

Version-Release number of selected component (if applicable):
subscription-manager-1.16.7-1

The change in behavior can first be seen at commit: d0953939bb88199ea0f33ef7eee2521766075d50

How reproducible:
100%

Steps to Reproduce:

1) Register without a proxy
2) `subscription-manager repos --list`
3) `subscription-manager repos --list --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=bad-username --proxypassword=bad-password`

Actual results:
"
Network error, unable to connect to server. Please see /var/log/rhsm/rhsm.log for more information.
"
Expected results:

The behavior described in bz 1176219 (use the cache to finish command execution albeit silently)

Comment 1 Chris Snyder 2016-01-14 14:43:35 UTC
In master as of the commit below:

commit a544f6fce44d5bf1e7d7b740d7388baadd00d505
Author: Christopher Snyder <csnyder>
Date:   Thu Jan 14 00:01:04 2016 -0500

    1298327: Handles exception in repolib

Comment 3 Jan Stavel 2016-02-08 19:20:41 UTC
Red Hat Enterprise Linux Client release 6.7 (Santiago)
----------------------------
server type                      Red Hat Subscription Management
subscription management server   0.9.51.15-1
subscription management rules    5.15.1
subscription-manager             1.16.8-1.el6
python-rhsm                      1.16.6-1.el6
----------------------------     ----------------------------
Product                          68.pem
----------------------------     ----------------------------
Entitlement                      5795330892602082507.pem
----------------------------     ----------------------------


subscription-manager status
subscription-manager repos --list | grep "Repo ID" | wc -l
subscription-manager repos --list --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=redhat --proxypassword=badpasswd | grep "Repo ID" | wc -l

#+RESULTS:
: +-------------------------------------------+
:    System Status Details
: +-------------------------------------------+
: Overall Status: Current
: 
: 61
: 61

Comment 4 John Sefler 2016-02-08 20:16:08 UTC
Verifying version...
[root@jsefler-6 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.15-1
subscription management rules: 5.15.1
subscription-manager: 1.16.8-1.el6
python-rhsm: 1.16.6-1.el6

[root@jsefler-6 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com:443/subscription --autosubscribe
Registering to: subscription.rhn.stage.redhat.com:443/subscription
Username: stage_test_jsefler_9
Password: 
The system has been registered with ID: 982e2451-b746-43f3-9eea-0d40c8266c46 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@jsefler-6 ~]# subscription-manager repos --list | grep "Repo ID" | wc -l
76
[root@jsefler-6 ~]# 

NOTICE THAT THERE ARE 76 ENTITLED REPOS AVAILABLE FROM THE ATTACHED SUBSCRIPTION
NOW LET'S MAKE THE SAME CALL THROUGH A PROXY WITH INVALID CREDENTIALS...

[root@jsefler-6 ~]# subscription-manager repos --list --proxy=auto-services.usersys.redhat.com:3128 --proxyuser=baduser --proxypassword=badpasswd | grep "Repo ID" | wc -l
76
[root@jsefler-6 ~]# 

VERIFIED: THE COMMAND SUCCEEDS BY USING THE CACHED STATUS AS SHOWN BY THE TAIL OF THE rhsm.log BELOW "Unable to reach server, using cached status."...

[root@jsefler-6 ~]# tail -f /var/log/rhsm/rhsm.log
2016-02-08 15:09:06,996 [DEBUG] subscription-manager:6073 @connection.py:542 - Using proxy: auto-services.usersys.redhat.com:3128
2016-02-08 15:09:06,997 [DEBUG] subscription-manager:6073 @connection.py:557 - Making request: GET https://subscription.rhn.stage.redhat.com:443/subscription/
2016-02-08 15:09:07,063 [ERROR] subscription-manager:6073 @repolib.py:222 - Proxy connection failed: 407
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 219, in __init__
    self.override_supported = bool(self.identity.is_valid() and self.uep and self.uep.supports_resource('content_overrides'))
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 841, in supports_resource
    self._load_supported_resources()
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 828, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 681, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 571, in _request
    conn.request(request_type, handler, body=body, headers=headers)
  File "/usr/lib64/python2.6/httplib.py", line 936, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.6/httplib.py", line 973, in _send_request
    self.endheaders()
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 273, in endheaders
    httpslib.HTTPSConnection.endheaders(self)
  File "/usr/lib64/python2.6/httplib.py", line 930, in endheaders
    self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 802, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 761, in send
    self.connect()
  File "/usr/lib64/python2.6/site-packages/M2Crypto/httpslib.py", line 203, in connect
    raise socket.error, "Proxy connection failed: %d" % code
error: Proxy connection failed: 407
2016-02-08 15:09:07,065 [DEBUG] subscription-manager:6073 @__init__.py:85 - Searching for content of type: yum
2016-02-08 15:09:07,068 [DEBUG] subscription-manager:6073 @connection.py:509 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-os-candlepin.pem, redhat-uep.pem, jsefler-f22-candlepin.pem, jsefler-f14-candlepin.pem, jsefler-f22-6candlepin.pem
2016-02-08 15:09:07,068 [DEBUG] subscription-manager:6073 @connection.py:542 - Using proxy: auto-services.usersys.redhat.com:3128
2016-02-08 15:09:07,068 [DEBUG] subscription-manager:6073 @connection.py:557 - Making request: GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/982e2451-b746-43f3-9eea-0d40c8266c46/release
2016-02-08 15:09:07,134 [ERROR] subscription-manager:6073 @cache.py:229 - Proxy connection failed: 407
2016-02-08 15:09:07,134 [WARNING] subscription-manager:6073 @cache.py:235 - Unable to reach server, using cached status.


Despite this verification, bug 1176219 is still applicable.

Comment 6 errata-xmlrpc 2016-05-10 20:39:05 UTC
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, 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://rhn.redhat.com/errata/RHBA-2016-0797.html


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