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 1262919 - exceptions from connection.RestlibException during autosubscribe should be printed to system error
Summary: exceptions from connection.RestlibException during autosubscribe should be pr...
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: Chris "Ceiu" Rog
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-14 15:43 UTC by John Sefler
Modified: 2016-11-03 20:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 20:27:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1221273 0 unspecified CLOSED if 'register' --serverurl foo.example.com --servicelevel BogusService level fails, server options are not persisted 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2016:2592 0 normal SHIPPED_LIVE Moderate: subscription-manager security, bug fix, and enhancement update 2016-11-03 12:10:42 UTC

Internal Links: 1221273

Description John Sefler 2015-09-14 15:43:39 UTC
Description of problem:
A follow up to a subscription-manager commit to solve bug 1221273 should print to system error...


-------------------- src/subscription_manager/managercli.py --------------------
index 706a353..ba1c4d9 100644
@@ -1118,8 +1118,11 @@ class RegisterCommand(UserPassCommand):
             if 'serviceLevel' not in consumer and self.options.service_level:
                 system_exit(os.EX_UNAVAILABLE, _("Error: The --servicelevel option is not supported "
                                  "by the server. Did not complete your request."))
-            autosubscribe(self.cp, consumer['uuid'],
-                    service_level=self.options.service_level)
+            try:
+                autosubscribe(self.cp, consumer['uuid'],
+                        service_level=self.options.service_level)
+            except connection.RestlibException, re:
+                print(re.msg)   <===================== FIX NEEDED HERE
 
         if (self.options.consumerid or self.options.activation_keys or self.autoattach):
             log.info("System registered, updating entitlements if needed")




See https://bugzilla.redhat.com/show_bug.cgi?id=1221273#c4


Version-Release number of selected component (if applicable):
subscription-manager-1.15.9-5

Comment 2 Chris "Ceiu" Rog 2015-09-22 15:58:56 UTC
commit 7795df84edcb4f4fef08085548f6c2a23f86ceb4
Author: Chris Rog <crog>
Date:   Mon Sep 14 16:21:38 2015 -0400

    1262919: Added convenience function for printing to stderr
    
    - Added a print_error function to print a message to stderr
    - Updated the error printing in autoattach during register to
      use the print_error function

Comment 3 John Sefler 2015-09-24 19:13:21 UTC
Deferring to rhel-7.3.0 for a fix.

Comment 5 Shwetha Kallesh 2016-04-26 12:56:21 UTC
Marking verified!!

[root@dhcp35-31 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.15-1
subscription management rules: 5.15.1
subscription-manager: 1.17.5-1.el7
python-rhsm: 1.17.2-1.el7


[root@dhcp35-31 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com:443/subscription --user qa --password ****** --force --servicelevel foo --auto-attach 1>/tmp/stdout 2>/tmp/stderr


[root@dhcp35-31 ~]# cat /tmp/stdout
Registering to: subscription.rhn.stage.redhat.com:443/subscription
The system has been registered with ID: d56355f9-a722-42ae-8eae-2eb679878898 

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@dhcp35-31 ~]# cat /tmp/stderr 
Service level 'foo' is not available to units of organization 711497.
[root@dhcp35-31 ~]#

Comment 7 errata-xmlrpc 2016-11-03 20:27:07 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/RHSA-2016-2592.html


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