Bug 740329

Summary: 'subscription-manager list --available' fails against katello (but not underlying candlepin)
Product: [Retired] Katello Reporter: Corey Welton <cwelton>
Component: ClientAssignee: Bryan Kearney <bkearney>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-21 16:41:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Corey Welton 2011-09-21 16:27:35 UTC
Description of problem:
Trying to run 'subscription-manager list --available' (as well as other similar commands fails against katello. modifying the prefix and port as appropriate in rhsm.conf to point to underlying candlepin allows us to get proper results.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  install subscription-manager.  Assure prefix and port are set to /katello/api and 443 accordingly
2.  'subscription-manager list --available'; note error
3.  Modify prefix to point to underlying candlepin prefix and port (usually /candlepin and 8443)
4. rerun the command.
  
Actual results:
* Works fine when pointing to candlepin itself, but when trying to point to katello, an error is thrown: 

[root@katello-test-rhel6-1 ~]# subscription-manager list --available
Network error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information.

(see logs in "Additional info" below)

Expected results:
Command should work.

Additional info:


2011-09-21 12:20:56,792 [INFO]  @connection.py:350 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = True
2011-09-21 12:20:56,793 [DEBUG]  @connection.py:209 - Making request: GET /katello/api/
2011-09-21 12:20:56,890 [DEBUG]  @connection.py:218 - Response status: 401
2011-09-21 12:20:56,891 [ERROR]  @connection.py:230 - No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 228, in validateResponse
    parsed = json.loads(response['content'])
  File "/usr/lib64/python2.6/site-packages/simplejson/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.6/site-packages/simplejson/decoder.py", line 335, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.6/site-packages/simplejson/decoder.py", line 353, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
2011-09-21 12:20:56,892 [ERROR]  @connection.py:231 - Response: {'content': ' ', 'status': 401}
2011-09-21 12:20:56,893 [WARNING]  @connection.py:383 - Error fetching supported resources, this UEPConnection is likely not usable:
2011-09-21 12:20:56,893 [ERROR]  @connection.py:385 - 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 376, in _load_supported_resources
    resources_list = self.conn.request_get("/")
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 252, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 219, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 236, in validateResponse
    raise NetworkException(response['status'])
NetworkException
2011-09-21 12:20:56,894 [INFO]  @connection.py:362 - Connection Established: host: katello-test-f15-1.usersys.redhat.com, port: 443, handler: /katello/api
2011-09-21 12:20:56,896 [INFO]  @cache.py:154 - Checking current system info against cache: /var/lib/rhsm/facts/facts.json
2011-09-21 12:20:57,012 [DEBUG]  @cert_sorter.py:89 - Sorting product and entitlement cert status for: 2011-09-21 16:20:57.012075+00:00
2011-09-21 12:20:57,013 [DEBUG]  @cert_sorter.py:174 - Installed product IDs: []
2011-09-21 12:20:57,013 [DEBUG]  @cert_sorter.py:93 - valid entitled products: []
2011-09-21 12:20:57,013 [DEBUG]  @cert_sorter.py:94 - expired entitled products: []
2011-09-21 12:20:57,014 [DEBUG]  @cert_sorter.py:95 - partially entitled products: []
2011-09-21 12:20:57,014 [DEBUG]  @cert_sorter.py:96 - unentitled products: []
2011-09-21 12:20:57,014 [DEBUG]  @cert_sorter.py:97 - future products: []
2011-09-21 12:20:57,015 [INFO]  @cache.py:169 - No changes.
2011-09-21 12:20:57,015 [INFO]  @cache.py:209 - Server does not support packages, skipping profile upload.
2011-09-21 12:20:57,017 [DEBUG]  @connection.py:209 - Making request: GET /katello/api/consumers/41ac1671-fb6e-42b8-bb3c-4dc8cc440e7b/owner
2011-09-21 12:20:57,061 [DEBUG]  @connection.py:218 - Response status: 401
2011-09-21 12:20:57,062 [ERROR]  @connection.py:230 - No JSON object could be decoded
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 228, in validateResponse
    parsed = json.loads(response['content'])
  File "/usr/lib64/python2.6/site-packages/simplejson/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.6/site-packages/simplejson/decoder.py", line 335, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.6/site-packages/simplejson/decoder.py", line 353, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
2011-09-21 12:20:57,063 [ERROR]  @connection.py:231 - Response: {'content': ' ', 'status': 401}
2011-09-21 12:20:57,063 [ERROR]  @managercli.py:64 - exception caught in subscription-manager
2011-09-21 12:20:57,063 [ERROR]  @managercli.py:65 - 
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 78, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 69, in main
    return managercli.CLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1357, in main
    cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 228, in main
    self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1222, in _do_command
    self.facts, self.options.all, on_date)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 370, in getAvailableEntitlements
    dlist = list_pools(cpserver, consumer_uuid, facts, get_all, active_on)
  File "/usr/share/rhsm/subscription_manager/managerlib.py", line 348, in list_pools
    owner = uep.getOwner(consumer_uuid)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 475, in getOwner
    return self.conn.request_get(method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 252, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 219, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 236, in validateResponse
    raise NetworkException(response['status'])
NetworkException

Comment 2 Corey Welton 2011-09-21 16:41:39 UTC
Closing. System did not have the appropriate changes to katello.conf... adding those fixed the issue.