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 1246680 - rhsm-debug system --subscriptions fails to collect subscriptions.json against candlepin-2.0
Summary: rhsm-debug system --subscriptions fails to collect subscriptions.json against...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: Sean Toner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-24 21:41 UTC by John Sefler
Modified: 2015-11-19 11:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 11:49:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1194906 0 low CLOSED rhsm-debug system --no-subscriptions --subscriptions should throw a usage error 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1267014 0 unspecified CLOSED bash completion for rhsm-debug system should no longer show "--no-subscriptions" and "--subscriptions" 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2015:2122 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2015-11-19 10:31:14 UTC

Internal Links: 1194906 1267014

Description John Sefler 2015-07-24 21:41:40 UTC
Description of problem:
Due to API changes in candlpin-2.0, the rhsm-debug system --subscriptions tool fails to collect subscriptions.json.

Note: This could be a compatibility problem for existing/old subscription-manager clients as newer candlepin-2.0 servers are deployed. 


Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.0.6-1
subscription management rules: 5.16
subscription-manager: 1.15.6-1.el7
python-rhsm: 1.15.3-1.el7


How reproducible:


Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager register --serverurl=jsefler-f22-candlepin.usersys.redhat.com:8443/candlepin
Username: testuser1
Password: 
Organization: admin
The system has been registered with ID: bb222644-8fc4-4ace-a800-8d9d84842c20 
[root@jsefler-7 ~]# rhsm-debug system --subscriptions
Wrote: /tmp/rhsm-debug-system-20150724-594639.tar.gz
[root@jsefler-7 ~]# tar -tf /tmp/rhsm-debug-system-20150724-594639.tar.gz | grep json
rhsm-debug-system-20150724-594639/consumer.json
rhsm-debug-system-20150724-594639/compliance.json
rhsm-debug-system-20150724-594639/entitlements.json
rhsm-debug-system-20150724-594639/pools.json
rhsm-debug-system-20150724-594639/version.json
rhsm-debug-system-20150724-594639/var/lib/rhsm/cache/releasever.json
rhsm-debug-system-20150724-594639/var/lib/rhsm/cache/installed_products.json
rhsm-debug-system-20150724-594639/var/lib/rhsm/cache/entitlement_status.json
rhsm-debug-system-20150724-594639/var/lib/rhsm/facts/facts.json


Actual results:
above

Expected results:
The list of json files collected above should have included:
rhsm-debug-system-20150724-594639/subscriptions.json


Additional info:
[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log
2015-07-24 17:30:09,292 [DEBUG] rhsm-debug:28880 @connection.py:500 - Making request: GET /candlepin/owners/admin/subscriptions
2015-07-24 17:30:09,433 [DEBUG] rhsm-debug:28880 @connection.py:528 - Response: status=403

Comment 1 William Poteat 2015-08-31 17:40:26 UTC
We have pulled this out of the rhsm-debug tool altogether.

The SOS folks didn't seem to want it anyway and most of the information is available from the pool data.

It will be hidded from the help listing, but the parameters will still exist. If they are called, a log message will conver that they have been disabled.

Comment 2 John Sefler 2015-09-04 16:59:01 UTC
commit 6bd472d13d88934e3a3069862e26f9e7e27bec8c

    1246680: Remove subscriptions from rhsm-debug
    
    Older Candlepins don't have the call.
    Candlepin 2.0 will not return subscriptions for less than the super admin level.
    In the Candlepins where it is allowed, the default is no-subscriptions because the SOS report folks didn't really care to have them.
    
    In the end, most of the data can be gleaned from the pool listing.



commit 89b3ef311a7348936448f9ef949d9e5dbe071326

    1246680: Hide rhsm-debug --subscriptions options
    
    And disconnect them from anything aside from a log
    message that they no longer do anything. This avoids
    breaking any scripts that specify --subscriptions, and
    doesn't change any behaviour against most server versions.

Comment 4 Sean Toner 2015-09-29 19:40:21 UTC
I am not seeing the subscriptions.json report from rhsm-debug system --subscriptions

[root@rh72-stoner-latest entitlement]# tar -tf /tmp/rhsm-debug-system-20150929-373298.tar.gz | grep json
rhsm-debug-system-20150929-373298/consumer.json
rhsm-debug-system-20150929-373298/compliance.json
rhsm-debug-system-20150929-373298/entitlements.json
rhsm-debug-system-20150929-373298/pools.json
rhsm-debug-system-20150929-373298/version.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/cache/releasever.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/cache/installed_products.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/cache/entitlement_status.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/cache/product_status.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/cache/content_overrides.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/cache/written_overrides.json
rhsm-debug-system-20150929-373298/var/lib/rhsm/facts/facts.json

This is against candlepin version:
{
    "managerCapabilities": [
        "cores",
        "ram",
        "instance_multiplier",
        "derived_product",
        "cert_v3",
        "guest_limit",
        "vcpu",
        "hypervisors_async",
        "storage_band"
    ],
    "release": "1",
    "result": true,
    "rulesSource": "DEFAULT",
    "rulesVersion": "5.17",
    "standalone": true,
    "timeUTC": "2015-09-29T19:15:33.404+0000",
    "version": "2.0.6"
}

[root@rh72-stoner-latest entitlement]# rpm -qa | grep subscription
subscription-manager-initial-setup-addon-1.15.9-12.el7.x86_64
subscription-manager-migration-data-2.0.24-1.el7.noarch
subscription-manager-gui-1.15.9-12.el7.x86_64
subscription-manager-1.15.9-12.el7.x86_64
subscription-manager-migration-1.15.9-12.el7.x86_64

Also, there is no longer a --subscriptions option from the rhsm-debug options and the rhsm.log file indicates the --subscription option does nothing now:

2015-09-29 15:37:53,949 [INFO] rhsm-debug:19766 @debug_commands.py:98 - The rhsm-debug options '--subscriptions' and '--no-subscriptions' have no effect now.

Comment 5 John Sefler 2015-09-29 20:01:37 UTC
As indicated in the commits of comment 2, the decision to solve this bug was to actually remove all traces of the --subscriptions and --no-subscriptions options from rhsm-debug system.

Verifying Version...
[root@jsefler-7 ~]# rpm -q subscription-manager
subscription-manager-1.15.9-12.el7.x86_64


[root@jsefler-7 ~]# rhsm-debug system --help
Usage: rhsm-debug system [OPTIONS] 

Assemble system information as a tar file or directory

Options:
  -h, --help            show this help message and exit
  --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
  --proxyuser=PROXY_USER
                        user for HTTP proxy with basic authentication
  --proxypassword=PROXY_PASSWORD
                        password for HTTP proxy with basic authentication
  --destination=DESTINATION
                        the destination location of the result; default is
                        /tmp
  --no-archive          data will be in an uncompressed directory
  --sos                 only data not already included in sos report will be
                        collected

VERIFIED: the --subscriptions and --no-subscriptions options are no longer present in the help.



[root@jsefler-7 ~]# rhsm-debug system --<TAB><TAB>
--destination    --no-archive     --proxypassword  --sos
--help           --proxy          --proxyuser  

VERIFIED: the --subscriptions and --no-subscriptions options are no longer present in the bash-completion options.



[root@jsefler-7 ~]# man -P cat rhsm-debug
RHSM-DEBUG(8)              RHSM Debug Tool             RHSM-DEBUG(8)



NAME
       rhsm-debug  -  Compiles  information  about system's entitle‐
       ments, products, and identity used by  Red  Hat  Subscription
       Manager.


SYNOPSIS
       rhsm-debug module [options]


DESCRIPTION
       rhsm-debug  compiles information about system's entitlements,
       products, and identity used by Red Hat Subscription Manager.


COMMANDS AND OPTIONS
       rhsm-debug has specific options available  for  each  module,
       depending on what operation is being performed. The currently
       supported modules are:


              1. system



   COMMON OPTIONS
       -h, --help
              Prints the specific help  information  for  the  given
              command.


       --proxy=PROXY
              Uses  an  HTTP  proxy.  The  PROXY name has the format
              hostname:port.



       --proxyuser=PROXYUSERNAME
              Gives the username to use to authenticate to the  HTTP
              proxy.


       --proxypassword=PROXYPASSWORD
              Gives  the password to use to authenticate to the HTTP
              proxy.



   SYSTEM OPTIONS
       The system command pulls in debug information off of the cur‐
       rent system


       --destination=DESTINATION
              The  directory  to place the resulting debug data. The
              default is /tmp.


       --no-archive
              Generates  an  uncompressed  directory  instead  of  a
              gzipped file.


       --sos  Excludes  data  files  that  are also collected by the
              sosreport tool.


BUGS
       This tool is part of Red Hat Subscription  Manager.  To  file
       bugs     against    this    command-line    tool,    go    to
       <https://bugzilla.redhat.com>, and select Red Hat >  Red  Hat
       Enterprise Linux > subscription-manager.



AUTHORS
       William  Poteat<wpoteat>.  The rhsm-debug tool was
       written by William Poteat.


COPYRIGHT
       Copyright (c) 2012 Red Hat, Inc. This is licensed  under  the
       GNU General Public License, version 2 (GPLv2). A copy of this
       license  is  available  at   http://www.gnu.org/licenses/old-
       licenses/gpl-2.0.txt.



-                                 -                    RHSM-DEBUG(8)


VERIFIED:  the --subscriptions and --no-subscriptions options are no longer present in the man page for rhsm-debug.



For backward compatibility of scripts, as indicated in comment2, passing these options should be ignored...

[root@jsefler-7 ~]# rhsm-debug system --subscriptions --no-subscriptions
Wrote: /tmp/rhsm-debug-system-20150929-850365.tar.gz

[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log
2015-09-29 15:58:20,957 [INFO] rhsm-debug:5008 @debug_commands.py:98 - The rhsm-debug options '--subscriptions' and '--no-subscriptions' have no effect now.


VERIFIED: The options --subscriptions and --no-subscriptions are ignored.  Otherwise the call would have failed with rhsm-debug: error: no such option: --subscriptions.  Moreover an INFO log was written to rhsm.log

Comment 6 errata-xmlrpc 2015-11-19 11:49:38 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-2015-2122.html


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