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 1145835 - subscription-manager register --consumerid throws return code 1 even though it was successful
Summary: subscription-manager register --consumerid throws return code 1 even though i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Chris "Ceiu" Rog
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel71
TreeView+ depends on / blocked
 
Reported: 2014-09-23 23:00 UTC by John Sefler
Modified: 2015-03-05 13:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:17:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0502 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2015-03-05 16:20:39 UTC

Description John Sefler 2014-09-23 23:00:29 UTC
Description of problem:


Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# rpm -q subscription-manager
subscription-manager-1.13.2-1.git.6.818c13b.el7.x86_64


How reproducible:


Steps to Reproduce:
[root@jsefler-7 ~]# subscription-manager register
Username: testuser1
Password: 
Organization: admin
The system has been registered with ID: 30484e2f-8e0b-4df7-af6e-76cc5f5daf7b 
[root@jsefler-7 ~]# echo $?
0
[root@jsefler-7 ~]# subscription-manager clean
All local data removed
[root@jsefler-7 ~]# subscription-manager register --consumerid=30484e2f-8e0b-4df7-af6e-76cc5f5daf7b
Username: testuser1
Password: 
The system has been registered with ID: 30484e2f-8e0b-4df7-af6e-76cc5f5daf7b 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Not Subscribed

Unable to find available subscriptions for all your installed products.
[root@jsefler-7 ~]# echo $?
1
[root@jsefler-7 ~]# 
[root@jsefler-7 ~]# subscription-manager identity
system identity: 30484e2f-8e0b-4df7-af6e-76cc5f5daf7b
name: jsefler-7.usersys.redhat.com
org name: Admin Owner
org ID: admin
[root@jsefler-7 ~]# 


Actual results:
above

Expected results:
Notice that the exit code from registering with --consumerid returns exit code 1.  That's wrong.  The registration was successful.  Moreover you will notice that the output from register with --consumerid also displays a list of --installed products.  In my opinion this should not have been reported because the --autosubscribe option was not supplied.  My guess is that the reason for the exit code of 1 is not indicative of a failed registration with --consumerid; I believe the exit code of 1 is coming from the failure to grant an entitlement (a requirement from bug 689608), yet --autosubscribe was not requested so I believe that the exit code should be 0 since when registering with only option --consumerid succeeds, and the list of installed products should not have been reported.


Additional info:

Comment 1 Chris "Ceiu" Rog 2014-10-03 17:29:55 UTC
commit 6f82c03f05804dcc28eb66d8126453f73c250488
Author: Chris Rog <crog>
Date:   Tue Sep 30 11:08:06 2014 -0400

    1122001: Reg with --consumerid no longer checks subs
    
    Registration with the --consumerid specified, but without using the
    --autosubscribe or --auto-attach options no longer checks the
    subscription status.
    
    This also addresses bug 1145835 in which the registration was erroneously
    reporting a failure in the same case.

Comment 3 Shwetha Kallesh 2014-11-26 12:02:30 UTC
Marking verified as exit code is 1 and installed list is no longer displayed

[root@dhcp35-236 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.36-1
subscription management rules: 5.11
subscription-manager: 1.13.9-1.el7
python-rhsm: 1.13.8-1.el7


[root@dhcp35-236 ~]# subscription-manager register --org admin --force --serverurl 10.70.1.100:8443/candlepin
Username: admin
Password: 
The system has been registered with ID: 04083e77-a8dd-4e6a-a55b-5a76cf08705b 
[root@dhcp35-236 ~]# echo $?
0
[root@dhcp35-236 ~]# subscription-manager clean
All local data removed
[root@dhcp35-236 ~]# subscription-manager register --consumerid 04083e77-a8dd-4e6a-a55b-5a76cf08705b
Username: admin
Password: 
The system has been registered with ID: 04083e77-a8dd-4e6a-a55b-5a76cf08705b 
[root@dhcp35-236 ~]# echo $?
0

Comment 5 errata-xmlrpc 2015-03-05 13:17:56 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-0502.html


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