Bug 1134963
Summary: | subscrption-manager release --list fails on rhel66 against cdn.redhat.com with a traceback error | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Rehana <redakkan> |
Component: | subscription-manager | Assignee: | William Poteat <wpoteat> |
Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.6 | CC: | alikins, bkearney, jesusr, jsefler, redakkan, wpoteat |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-10-14 07:48:32 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: | 1014343 |
Description
Rehana
2014-08-28 14:05:08 UTC
I suspect this was being called by cdn issues. The server took ~20s to respond: 2014-08-28 19:31:31,309 [DEBUG] subscription-manager @connection.py:276 - Loading CA certificate: '/etc/pki/entitlement/4825910636024953707.pem' 2014-08-28 19:31:51,899 [ERROR] subscription-manager @release.py:132 - ^--- ~20s And the server likely closed the connection. httplib around line 355 is... if not line: # Presumably, the server closed the connection before # sending a valid response. raise BadStatusLine(line) No error on the command line is intentional for 'release --list' Adrian, I will email you all the entitlement cert files. Rehana. The CDN URL for server seems to be successful [as shown in Rehana's last comment #4] the workstation/client look like they are failing. I see a similar outcome when I manually force the cdn URL to server even if the subscripton is for client. Created attachment 937090 [details]
strace output for phy system that works
Having python-json installed changes the content url label string from being a unicode string to a python string. The url request does not encode the string before using it as the get "handler", and sending the unicode string either causes the request to not be finished, and therefore never send a response, or to throw a 403 sometimes. Still have no idea why this only effected virt guests. A one-liner to encode the request string as utf8 or ascii seems to fix the 20s pause, but doesn't necessarily do the right thing, and sometimes then results in a 403. So, if python-simplejson is installed, it's default "loads" behavior is to convert string objects to 'str' types: http://simplejson.readthedocs.org/en/latest/#simplejson.loads If s is a str then decoded JSON strings that contain only ASCII characters may be parsed as str for performance and memory reasons. If your code expects only unicode the appropriate solution is decode s to unicode prior to calling loads. The builtin 'json' always decodes strings to unicode however. I'm unsure if this behavior difference has implications else where. We need to update the url constructing code to encode unicode strings properly, and that should fix this issue for either json parser. We can also force simplejson to decode any json string to unicode. [1] [1] If that impacts simplejson performance, then it doesn't gain us anything over the built in json, and the optional support could be removed and only use the built in. pr for master at: https://github.com/candlepin/subscription-manager/pull/1022 commit 5fa72fde4b4d2dbe98ef4d1288028b956ace9719 Author: Adrian Likins <alikins> Date: Mon Sep 15 13:06:26 2014 -0400 1134963: Fix 'release --list' on some systems. Encode the url path we request the release 'listing' file from unicode. Depending if 'python-simplejson' is installed, the Content.url str could be a 'str' or a 'unicode'. The unicode string is not valid for inclusion in an URL. This was causing failed GET requests to the CDN, resulting in 'release --list' return no results after a 20s timeout. The exception from the timeout was causing a httplib.BadStatusLine exception to be logged. python-simplejson defaults to decoding any json strings that can be represented as 'str' to 'str' vs 'unicode'. The default 'json' decoder always returns unicode strings. For performance reasons, we attempt to use python-simplejson if installed, but it is not a package dep. If it's not installed, the 'release --list' command would fail. Re-demonstrating failure with offending package installed (and python-simplejson removed).... [root@jsefler-6 ~]# yum -q -y remove python-simplejson.x86_64 Warning: RPMDB altered outside of yum. [root@jsefler-6 ~]# rpm -q subscription-manager python-simplejson subscription-manager-1.12.14-6.el6.x86_64 package python-simplejson is not installed [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com:443/subscription --baseurl=https://cdn.redhat.com --username=stage_test_12 --auto-attach Password: The system has been registered with ID: 765784d0-317b-4226-af5e-779d3326d841 Installed Product Current Status: Product Name: Red Hat Enterprise Linux Server Status: Subscribed [root@jsefler-6 ~]# subscription-manager repos --list | grep "Enabled: 1" -B3 Repo ID: rhel-6-server-rpms Repo Name: Red Hat Enterprise Linux 6 Server (RPMs) Repo URL: https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/os Enabled: 1 [root@jsefler-6 ~]# subscription-manager release --list No release versions available, please check subscriptions. [root@jsefler-6 ~]# FAILURE CONFIRMED: Expected the release list to be returned with the following data... [root@jsefler-6 ~]# curl --stderr /dev/null --insecure --tlsv1 --cert /etc/pki/entitlement/1111212280999721487.pem --key /etc/pki/entitlement/1111212280999721487-key.pem https://cdn.redhat.com/content/dist/rhel/server/6/listing 6.1 6.2 6.3 6.4 6.5 6Server [root@jsefler-6 ~]# ------------------------------------------------------------------ Testing with corrected subscription-manager package installed (and python-simplejson removed).... [root@jsefler-6 ~]# rpm -U http://download.devel.redhat.com/brewroot/packages/subscription-manager/1.12.14/7.el6/x86_64/subscription-manager-1.12.14-7.el6.x86_64.rpm [root@jsefler-6 ~]# rpm -q subscription-manager python-simplejson subscription-manager-1.12.14-7.el6.x86_64 package python-simplejson is not installed [root@jsefler-6 ~]# subscription-manager release --list +-------------------------------------------+ Available Releases +-------------------------------------------+ 6.1 6.2 6.3 6.4 6.5 6Server [root@jsefler-6 ~]# VERIFIED: The release list is now reported as expected (with python-simplejson removed). Now let's install python-simplejson and test that that it still works... [root@jsefler-6 ~]# yum -q -y install python-simplejson --enablerepo=latest-RHEL6 Warning: RPMDB altered outside of yum. [root@jsefler-6 ~]# rpm -q subscription-manager python-simplejson subscription-manager-1.12.14-7.el6.x86_64 python-simplejson-2.0.9-3.1.el6.x86_64 [root@jsefler-6 ~]# subscription-manager release --list +-------------------------------------------+ Available Releases +-------------------------------------------+ 6.1 6.2 6.3 6.4 6.5 6Server [root@jsefler-6 ~]# VERIFIED: The release list is still reported as expected (with python-simplejson installed and removed). 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. http://rhn.redhat.com/errata/RHBA-2014-1384.html |