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 1044596 - subscription-manager release --list is throwing tracebacks against rhel7 content
Summary: subscription-manager release --list is throwing tracebacks against rhel7 content
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: John Sefler
URL:
Whiteboard:
: 1035592 1057511 (view as bug list)
Depends On:
Blocks: rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2013-12-18 16:03 UTC by John Sefler
Modified: 2014-06-18 00:29 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 12:44:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Error dialog in the gui when trying to click System/Preferences after attaching a rhel7 htb subscription (48.64 KB, image/png)
2013-12-18 16:15 UTC, John Sefler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1031146 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1031146

Description John Sefler 2013-12-18 16:03:20 UTC
Description of problem:
After registering to the stage environment and attaching a rhel7 subscription, subscription-manager release --list is throwing an exception steming from a BadStatusLine response from the server.  Interestingly, the behavior is slightly different changing the baseurl.  See the reproduction steps.


Version-Release number of selected component (if applicable):
[root@jsefler-7server ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription-manager: 1.10.9-1.git.0.1a4058d.el7
python-rhsm: 1.10.9-1.git.0.e05ee04.el7


How reproducible:


Steps to Reproduce:
[root@jsefler-7server ~]# subscription-manager register --auto-attach --username=stage_test_12 --serverurl=subscription.rhn.stage.redhat.com:443/subscription --baseurl=https://cdn.redhat.com
Password: 
The system has been registered with ID: 8aff1a39-36a0-4e1c-adb9-2a566caeffde 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed

[root@jsefler-7server ~]# subscription-manager release --list
''


^^^ DID NOT EXPECT THAT.  Since there are currently no rhel7 releases, I would either expect the "Available Releases" banner with no values, or a special message stating that there is no release listing.

Here is the trace in rhsm.log...

[root@jsefler-7server ~]# tail -f /var/log/rhsm/rhsm.log
2013-12-18 10:53:55,483 [ERROR] subscription-manager @managercli.py:157 - exception caught in subscription-manager
2013-12-18 10:53:55,485 [ERROR] subscription-manager @managercli.py:158 - ''
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 82, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 73, in main
    return managercli.ManagerCLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2398, in main
    return CLI.main(self)
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 425, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1302, in _do_command
    releases = self.release_backend.get_releases()
  File "/usr/share/rhsm/subscription_manager/release.py", line 96, in get_releases
    data = self.content_connection.get_versions(listing_path)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 298, in get_versions
    results = self._request("GET", handler, body="")
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 267, in _request
    response = conn.getresponse()
  File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse
    response.begin()
  File "/usr/lib64/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.7/httplib.py", line 373, in _read_status
    raise BadStatusLine(line)
BadStatusLine: ''

Comment 1 John Sefler 2013-12-18 16:05:10 UTC
Interestingly I get a different behavior if I change the baseurl to the rcm-qa as follows...

[root@jsefler-7server ~]# subscription-manager register --auto-attach --username=stage_test_12 --serverurl=subscription.rhn.stage.redhat.com:443/subscription --baseurl=https://cdn.rcm-qa.redhat.com
Password: 
The system has been registered with ID: 4170343d-7d09-44fb-bf00-00a8fe126e2e 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed

[root@jsefler-7server ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
</body></html>
</head><body>
</p>
<address>Apache Server at cdn.rcm-qa.redhat.com Port 443</address>
<h1>Method Not Implemented</h1>
<hr>
<html><head>
<p>G to / not supported.<br />
<title>501 Method Not Implemented</title>

Comment 2 John Sefler 2013-12-18 16:15:39 UTC
Created attachment 838426 [details]
Error dialog in the gui when trying to click System/Preferences after attaching a rhel7 htb subscription

spandey is the originator of this bug.
Using baseurl=https://cdn.redhat.com, he produces the following traceback and gets the attached screenshot error when clicking the System/Preferences menu item in the gui.

Comment 3 John Sefler 2013-12-18 16:21:55 UTC
2013-12-16 05:43:09,355 [DEBUG] subscription-manager-gui @certdirectory.py:204 - Installed product IDs: ['230']
2013-12-16 05:43:09,355 [INFO] subscription-manager-gui @release.py:146 - No matching products with RHEL product tags found
2013-12-16 05:43:09,355 [INFO] subscription-manager-gui @release.py:146 - No matching products with RHEL product tags found
2013-12-16 05:43:09,355 [INFO] subscription-manager-gui @release.py:146 - No matching products with RHEL product tags found
2013-12-16 05:43:09,355 [INFO] subscription-manager-gui @release.py:146 - No matching products with RHEL product tags found
2013-12-16 05:43:09,355 [INFO] subscription-manager-gui @release.py:146 - No matching products with RHEL product tags found
2013-12-16 05:43:09,355 [INFO] subscription-manager-gui @release.py:146 - No matching products with RHEL product tags found
2013-12-16 05:43:09,356 [DEBUG] subscription-manager-gui @connection.py:274 - Loading CA certificate: '/etc/pki/entitlement/852870131209388138.pem'
2013-12-16 05:43:29,717 [ERROR] subscription-manager-gui @utils.py:75 - ''
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 314, in _preferences_item_clicked
    self.preferences_dialog.show()
  File "/usr/share/rhsm/subscription_manager/gui/preferences.py", line 200, in show
    self.load_current_settings()
  File "/usr/share/rhsm/subscription_manager/gui/preferences.py", line 98, in load_current_settings
    self.load_releases(consumer_json)
  File "/usr/share/rhsm/subscription_manager/gui/preferences.py", line 141, in load_releases
    available_releases = self.release_backend.get_releases()
  File "/usr/share/rhsm/subscription_manager/release.py", line 96, in get_releases
    data = self.content_connection.get_versions(listing_path)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 292, in get_versions
    results = self._request("GET", handler, body="")
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 261, in _request
    response = conn.getresponse()
  File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse
    response.begin()
  File "/usr/lib64/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.7/httplib.py", line 373, in _read_status
    raise BadStatusLine(line)
BadStatusLine: ''

Comment 4 Adrian Likins 2013-12-18 17:04:18 UTC
What product id is installed on this machine?

(copy of ent certs would be useful as well)

Looks like something is maybe failing to parse the content required tags, and
ending up making a bogus GET to the cdn and confusing things.

Comment 5 John Sefler 2013-12-18 23:19:41 UTC
(In reply to Adrian Likins from comment #4)
> What product id is installed on this machine?
230


[root@jsefler-7 ~]# subscription-manager register --auto-attach --username=stage_test_12 --serverurl=subscription.rhn.stage.redhat.com:443/subscription --baseurl=https://cdn.redhat.com
Password: 
The system has been registered with ID: 8dc3d3a9-266b-4df5-80e7-7e221bd6000a 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed

[root@jsefler-7 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux 7 Server High Touch Beta
Product ID:     230
Version:        7.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         12/31/2012
Ends:           12/30/2013

[root@jsefler-7 ~]# rct cat-cert /etc/pki/product/230.pem | grep ID: -B1 -A5
Product:
	ID: 230
	Name: Red Hat Enterprise Linux 7 Server High Touch Beta
	Version: 7.0 HTB
	Arch: x86_64
	Tags: rhel-7-server
	Brand Type: 


> (copy of ent certs would be useful as well)
> 

[root@jsefler-7 ~]# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-lb-for-rhel-7-server-htb-rpms
Repo Name: Red Hat Enterprise Linux Load Balancer (for RHEL 7 Server) HTB (RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/loadbalancer/os
Enabled:   1

Repo ID:   rhel-lb-for-rhel-7-server-htb-source-rpms
Repo Name: Red Hat Enterprise Linux Load Balancer (for RHEL 7 Server) HTB (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/loadbalancer/source/SRPMS
Enabled:   0

Repo ID:   rhel-lb-for-rhel-7-server-htb-debug-rpms
Repo Name: Red Hat Enterprise Linux Load Balancer (for RHEL 7 Server) HTB (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/loadbalancer/debug
Enabled:   0

Repo ID:   rhel-ha-for-rhel-7-server-htb-source-rpms
Repo Name: Red Hat Enterprise Linux High Availability (for RHEL 7 Server) HTB (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/highavailability/source/SRPMS
Enabled:   0

Repo ID:   rhel-7-server-htb-source-rpms
Repo Name: Red Hat Enterprise Linux 7 Server HTB (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/source/SRPMS
Enabled:   0

Repo ID:   rhel-7-server-optional-htb-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Optional HTB (RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/optional/os
Enabled:   0

Repo ID:   rhel-ha-for-rhel-7-server-htb-rpms
Repo Name: Red Hat Enterprise Linux High Availability (for RHEL 7 Server) HTB (RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/highavailability/os
Enabled:   1

Repo ID:   rhel-rs-for-rhel-7-server-htb-debug-rpms
Repo Name: Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) HTB (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/resilientstorage/debug
Enabled:   0

Repo ID:   rhel-7-server-optional-htb-debug-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Optional HTB (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/optional/debug
Enabled:   0

Repo ID:   rhel-rs-for-rhel-7-server-htb-rpms
Repo Name: Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) HTB (RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/resilientstorage/os
Enabled:   1

Repo ID:   rhel-7-server-htb-debug-rpms
Repo Name: Red Hat Enterprise Linux 7 Server HTB (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/debug
Enabled:   0

Repo ID:   rhel-rs-for-rhel-7-server-htb-source-rpms
Repo Name: Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) HTB (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/resilientstorage/source/SRPMS
Enabled:   0

Repo ID:   rhel-ha-for-rhel-7-server-htb-debug-rpms
Repo Name: Red Hat Enterprise Linux High Availability (for RHEL 7 Server) HTB (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/highavailability/debug
Enabled:   0

Repo ID:   rhel-7-server-optional-htb-source-rpms
Repo Name: Red Hat Enterprise Linux 7 Server - Optional HTB (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/optional/source/SRPMS
Enabled:   0

Repo ID:   rhel-7-server-htb-rpms
Repo Name: Red Hat Enterprise Linux 7 Server HTB (RPMs)
Repo URL:  https://cdn.redhat.com/content/htb/rhel/server/7/$basearch/os
Enabled:   1


[root@jsefler-7 ~]# subscription-manager release --list
No release versions available, please check subscriptions.

^^^  INTERESTING: That is the response I would have expected.  How did this get fixed?  As shown below, the version of subscription manager is slightly newer than in comment 0, but I don't think that was the fix.  Maybe the release engineering team fixed something on the CDN today.



[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.10.9-1.git.1.ebf6be6.el7
python-rhsm: 1.10.9-1.git.0.e05ee04.el7

Comment 6 spandey 2014-01-13 11:38:31 UTC
again able to repro issue using following sm with stage 

subscription-manager-migration-data-2.0.5-1.git.0.3be2ad4.el7.noarch
subscription-manager-gui-1.10.10-1.git.9.c07cb2c.el7.x86_64
subscription-manager-firstboot-1.10.10-1.git.9.c07cb2c.el7.x86_64
subscription-manager-migration-1.10.10-1.git.9.c07cb2c.el7.x86_64
subscription-manager-1.10.10-1.git.9.c07cb2c.el7.x86_64



[root@dhcp201-128 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to 4
                   guests)
Provides:          Red Hat Software Collections Beta (for RHEL Server)
                   Red Hat Enterprise Linux Server
                   Red Hat Enterprise Linux 7 Public Beta
                   Red Hat Beta
SKU:               RH0103708
Contract:          10318617
Account:           5364754
Serial:            5216867754914537949
Pool ID:           8a99f9834369692101436acd1e4b0b34
Active:            True
Quantity Used:     1
Service Level:     PREMIUM
Service Type:      L1-L3
Status Details:    
Subscription Type: 
Starts:            01/05/2014
Ends:              01/05/2015
System Type:       Virtual

[root@dhcp201-128 ~]# subscription-manager release --list
''
[root@dhcp201-128 ~]#

Comment 7 Adrian Likins 2014-01-14 18:04:51 UTC
Need the actual product id and ent certs. Need the product id to see what it's product tags look like (rct could be strip()ing it, etc). Ditto for content tags in the ent certs. One suspicion is that the URL that it is constructing to find the release file is bogus, and something odd in those files could cause that.

Comment 8 Adrian Likins 2014-01-14 18:09:42 UTC
(In reply to John Sefler from comment #1)
> Interestingly I get a different behavior if I change the baseurl to the
> rcm-qa as follows...
> 
> [root@jsefler-7server ~]# subscription-manager register --auto-attach
> --username=stage_test_12
> --serverurl=subscription.rhn.stage.redhat.com:443/subscription
> --baseurl=https://cdn.rcm-qa.redhat.com
> Password: 
> The system has been registered with ID: 4170343d-7d09-44fb-bf00-00a8fe126e2e 
> Installed Product Current Status:
> Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
> Status:       Subscribed
> 
> [root@jsefler-7server ~]# subscription-manager release --list
> +-------------------------------------------+
>           Available Releases
> +-------------------------------------------+
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> </body></html>
> </head><body>
> </p>
> <address>Apache Server at cdn.rcm-qa.redhat.com Port 443</address>
> <h1>Method Not Implemented</h1>
> <hr>
> <html><head>
> <p>G to / not supported.<br />
> <title>501 Method Not Implemented</title>

Interesting. Looks like the server returned a 501 page, but maybe with a 200 http code?

Comment 9 Adrian Likins 2014-01-14 18:14:46 UTC
(In reply to John Sefler from comment #0)
> Description of problem:
> After registering to the stage environment and attaching a rhel7
> subscription, subscription-manager release --list is throwing an exception
> steming from a BadStatusLine response from the server.  Interestingly, the
> behavior is slightly different changing the baseurl.  See the reproduction
> steps.
> 
>     raise BadStatusLine(line)
> BadStatusLine: ''


If the request gets anything but a 200 response, the result will be an
empty string. Looks like getting a list of one empty string is confusing
the cli. That's wrong. 

Not entirely sure why it's not finding releases though.

Comment 10 Carter Kozak 2014-01-23 13:32:57 UTC
*** Bug 1035592 has been marked as a duplicate of this bug. ***

Comment 11 Adrian Likins 2014-01-29 18:55:23 UTC
*** Bug 1057511 has been marked as a duplicate of this bug. ***

Comment 16 Adrian Likins 2014-02-12 14:54:13 UTC
https://github.com/candlepin/subscription-manager/pull/905

propsed fix

Comment 17 Adrian Likins 2014-02-14 16:22:27 UTC
commit 441d36401a2919f5b503e4d53f92b817728e77b3
Author: Adrian Likins <alikins>
Date:   Tue Feb 11 14:44:22 2014 -0500

    1044596: Don't match beta product tags for release
    
    Change the release module to reuse RHELProductMatcher
    so it doesn't incorrectly identify content as being
    RHEL content, so we don't attempt to find release
    listings for them.
    
    Add a rhelproduct.py with some of the RHEL product
    specific tag comparisions, and update release
    and productid modules to use it.

Comment 18 John Sefler 2014-02-19 16:32:31 UTC
Verifying Version...
[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.3-1
subscription-manager: 1.10.14-2.el7
python-rhsm: 1.10.12-1.el7


[root@jsefler-7 ~]# subscription-manager register --auto-attach --username=rhel7beta --serverurl=subscription.rhn.stage.redhat.com:443/subscription --baseurl=https://cdn.redhat.com
Password: 
The system has been registered with ID: 16c26fd0-9716-4534-88bc-c5a4fabb9fdb 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed
[root@jsefler-7 ~]# subscription-manager release --list
No release versions available, please check subscriptions.

VERIFIED: This is the expected result with baseurl=https://cdn.redhat.com from the High Touch Beta content sets.  Moreover, the subscription-manager-gui Preferences dialog handles this case approriately too.


Now let's verify against a different baseurl...
[root@jsefler-7 ~]# subscription-manager config --rhsm.baseurl=https://cdn.qa.redhat.com
[root@jsefler-7 ~]# subscription-manager release --list
No release versions available, please check subscriptions.

VERIFIED: This is the expected result with baseurl=https://cdn.qa.redhat.com from the High Touch Beta content sets.  Moreover, the subscription-manager-gui Preferences dialog handles this case approriately too.


Now let's verify against another different baseurl...
[root@jsefler-7 ~]# subscription-manager config --rhsm.baseurl=https://cdn.stage.redhat.com
[root@jsefler-7 ~]# subscription-manager release --list
No release versions available, please check subscriptions.

VERIFIED: Again, this is the expected result with baseurl=https://cdn.stage.redhat.com from the High Touch Beta content sets.  Moreover, the subscription-manager-gui Preferences dialog handles this case approriately too.


Finally let's verify against yet another baseurl...
[root@jsefler-7 ~]# subscription-manager config --rhsm.baseurl=https://cdn.rcm-qa.redhat.com
[root@jsefler-7 ~]# subscription-manager release --list
No release versions available, please check subscriptions.

VERIFIED: And again, this is the expected result with baseurl=https://cdn.rcm-qa.redhat.com from the High Touch Beta content sets.  Moreover, the subscription-manager-gui Preferences dialog handles this case approriately too.

And finally just to demonstrate that there was indeed an enabled htb repo...
[root@jsefler-7 ~]# subscription-manager repos --list | tail -5
Repo ID:   rhel-7-server-htb-rpms
Repo Name: Red Hat Enterprise Linux 7 Server HTB (RPMs)
Repo URL:  https://cdn.rcm-qa.redhat.com/content/htb/rhel/server/7/$basearch/os
Enabled:   1

[root@jsefler-7 ~]#

Comment 19 Ludek Smid 2014-06-13 12:44:24 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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