Bug 1034649 - subscription-manager repos --list throwing Remote server error against stage server
Summary: subscription-manager repos --list throwing Remote server error against stage ...
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
high
unspecified
Target Milestone: rc
: ---
Assignee: Michael Stead
QA Contact: John Sefler
URL:
Whiteboard:
: 1035493 (view as bug list)
Depends On:
Blocks: rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2013-11-26 09:41 UTC by Rehana
Modified: 2014-06-18 00:29 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:33:14 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Rehana 2013-11-26 09:41:46 UTC
Description of problem:


Version-Release number of selected component (if applicable):
 
[root@localhost ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.10.7-1.el7
python-rhsm: 1.10.6-1.el7

How reproducible:
3/3

Steps to Reproduce:
1.Register against stage
2.Attach subscription
[root@localhost ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux 7 High Touch Beta
Provides:          Red Hat Enterprise Linux 7 for IBM POWER High Touch Beta
                   Red Hat Enterprise Linux 7 Server High Touch Beta
                   Red Hat Enterprise Linux 7 for IBM System z High Touch Beta
                   Red Hat Enterprise Linux 7 Workstation High Touch Beta
                   Red Hat Enterprise Linux 7 for HPC Compute Node High Touch Beta
                   Red Hat Enterprise Linux 7 Resilient Storage High Touch Beta
                   Red Hat Enterprise Linux 7 Desktop High Touch Beta
                   Red Hat Enterprise Linux 7 Load Balancer High Touch Beta
                   Red Hat Enterprise Linux 7 High Availability High Touch Beta
SKU:               RH00076
Contract:          10299499
Account:           5363962
Serial:            2930066049181571715
Pool ID:           8a99f9844228f57b0142334d243f5d17
Active:            True
Quantity Used:     1
Service Level:     Self-Support
Service Type:      L1-L3
Status Details:    
Starts:            11/07/2013
Ends:              11/07/2014
System Type:       Physical

3.execute  subscription-manager repos --list 

Actual results:

The subscription had contents, bug repos --list fails with the below error 

[root@localhost ~]# subscription-manager repos --list
Remote server error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information.

<rhsm.log >
2013-11-26 14:56:22,996 [DEBUG] subscription-manager @connection.py:467 - Response: status=200
2013-11-26 14:56:22,999 [DEBUG] subscription-manager @cache.py:284 - Started thread to write cache: /var/lib/rhsm/cache/entitlement_status.json
2013-11-26 14:56:22,999 [DEBUG] subscription-manager @cert_sorter.py:200 - valid entitled products: ['230']
2013-11-26 14:56:23,000 [DEBUG] subscription-manager @cert_sorter.py:201 - expired entitled products: []
2013-11-26 14:56:23,000 [DEBUG] subscription-manager @cert_sorter.py:202 - partially entitled products: []
2013-11-26 14:56:23,000 [DEBUG] subscription-manager @cert_sorter.py:203 - unentitled products: []
2013-11-26 14:56:23,000 [DEBUG] subscription-manager @cert_sorter.py:204 - future products: []
2013-11-26 14:56:23,000 [DEBUG] subscription-manager @cert_sorter.py:205 - partial stacks: []
2013-11-26 14:56:23,000 [DEBUG] subscription-manager @cert_sorter.py:206 - entitlements valid until: 2014-11-07 05:00:00+00:00
2013-11-26 14:56:24,857 [INFO] rhsmd @rhsmd:193 - rhsmd started
2013-11-26 14:56:24,866 [INFO] rhsmd @rhsmd:148 - D-Bus interface com.redhat.SubscriptionManager.EntitlementStatus.update_status called with status = 0
2013-11-26 14:56:25,660 [INFO] rhsmd @rhsmd:116 - D-Bus signal com.redhat.SubscriptionManager.EntitlementStatus.entitlement_status_changed emitted
2013-11-26 14:56:25,670 [DEBUG] subscription-manager @connection.py:412 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-stage.pem, redhat-uep.pem, candlepin-ca.pem
2013-11-26 14:56:25,670 [DEBUG] subscription-manager @connection.py:444 - Making request: GET /subscription/consumers/1bf3792e-de25-41ec-be99-a401f3c4fa39/content_overrides
2013-11-26 14:56:27,260 [DEBUG] subscription-manager @connection.py:467 - Response: status=404
2013-11-26 14:56:27,260 [ERROR] subscription-manager @connection.py:496 - Response: 404
2013-11-26 14:56:27,260 [ERROR] subscription-manager @connection.py:497 - JSON parsing error: No JSON object could be decoded
2013-11-26 14:56:27,261 [ERROR] subscription-manager @managercli.py:155 - exception caught in subscription-manager
2013-11-26 14:56:27,261 [ERROR] subscription-manager @managercli.py:156 - Server error attempting a GET to /subscription/consumers/1bf3792e-de25-41ec-be99-a401f3c4fa39/content_overrides returned status 404
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 2404, 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 452, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1822, in _do_command
    repos = rl.get_repos()
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 55, in get_repos
    action = UpdateAction(self.uep, cache_only=self.cache_only, apply_overrides=apply_overrides)
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 121, in __init__
    status = override_cache.load_status(self.uep, self.identity.uuid)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 211, in load_status
    self._sync_with_server(uep, uuid)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 325, in _sync_with_server
    self.server_status = uep.getContentOverrides(consumer_uuid)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1058, in getContentOverrides
    return self.conn.request_get(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 548, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 476, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 524, in validateResponse
    handler=handler)
RemoteServerException: Server error attempting a GET to /subscription/consumers/1bf3792e-de25-41ec-be99-a401f3c4fa39/content_overrides returned status 404

Expected results:
subscription-manager repos --list should list repo details

Additional info:

Comment 1 Rehana 2013-11-26 10:19:04 UTC
Yum outputs 
---------

[root@localhost ~]# yum repolist 
Loaded plugins: langpacks, product-id, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
repo id                                                 repo name                                                                               status
rhel-7-server-htb-rpms/x86_64                           Red Hat Enterprise Linux 7 Server HTB (RPMs)                                            4,528
rhel-ha-for-rhel-7-server-htb-rpms/x86_64               Red Hat Enterprise Linux High Availability (for RHEL 7 Server) HTB (RPMs)                  29
rhel-lb-for-rhel-7-server-htb-rpms/x86_64               Red Hat Enterprise Linux Load Balancer (for RHEL 7 Server) HTB (RPMs)                       3
rhel-rs-for-rhel-7-server-htb-rpms/x86_64               Red Hat Enterprise Linux Resilient Storage (for RHEL 7 Server) HTB (RPMs)                  34

[root@localhost ~]# yum repoinfo
Loaded plugins: langpacks, product-id, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
Repo-id      : rhel-7-server-htb-rpms/x86_64
Repo-name    : Red Hat Enterprise Linux 7 Server HTB (RPMs)
Repo-revision: 1385409229
Repo-updated : Tue Nov 26 01:26:53 2013
Repo-pkgs    : 4,528
Repo-size    : 3.9 G
Repo-baseurl : https://test/content/htb/rhel/server/7/x86_64/os
Repo-expire  : 86,400 second(s) (last: Tue Nov 26 15:11:42 2013)
Repo-filename: ///etc/yum.repos.d/redhat.repo

Comment 2 John Sefler 2013-11-26 13:46:06 UTC
It appears that the cause for this bug is that the current version of candlepin 0.8.28.1 deployed in stage does not support repo-overrides.  Subscription-manager should be fixed to consider this (reverted to use some old code) when calling the repos module against an older candlepin.

It would be nice to fix and verify this now before candlepin is upgraded in stage.

Comment 4 Michael Stead 2013-11-27 12:57:58 UTC
Patch waiting for review:

https://github.com/candlepin/subscription-manager/pull/829

Comment 5 Alex Wood 2013-12-02 14:33:29 UTC
*** Bug 1035493 has been marked as a duplicate of this bug. ***

Comment 6 Michael Stead 2013-12-02 18:41:52 UTC
Available in:

subscription-manager-1.10.8-1

Comment 8 John Sefler 2013-12-06 16:41:00 UTC
Verifying Version...
[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription-manager: 1.10.8-1.el7
python-rhsm: 1.10.8-1.el7


[root@jsefler-7 ~]# subscription-manager register --username=rhel7beta --serverurl=subscription.rhn.stage.redhat.com:443/subscription --auto-attach
Password: 
The system has been registered with ID: 7ea64184-271e-4a5a-ab77-2a7d32db51e3 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Server High Touch Beta
Status:       Subscribed

[root@jsefler-7 ~]# subscription-manager repos --list | head -16
+----------------------------------------------------------+
    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

[root@jsefler-7 ~]# subscription-manager repo-override
Error: The 'repo-override' command is not supported by the server.


VERIFIED: subscription-manager repos --list succeeds against a candlepin server that does not support repo-overrides

Comment 9 Ludek Smid 2014-06-13 10:33:14 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.