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 1221273 - if 'register' --serverurl foo.example.com --servicelevel BogusService level fails, server options are not persisted
Summary: if 'register' --serverurl foo.example.com --servicelevel BogusService level f...
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: William Poteat
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel72
TreeView+ depends on / blocked
 
Reported: 2015-05-13 15:23 UTC by Adrian Likins
Modified: 2015-11-19 11:48 UTC (History)
3 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1262919 0 unspecified CLOSED exceptions from connection.RestlibException during autosubscribe should be printed to system error 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: 1262919

Description Adrian Likins 2015-05-13 15:23:40 UTC
Description of problem:

If using 'subscription-manager register --serverurl http://whatever.example.com --auto-attach --servicelevel AServiceLevelThatDoesExist', the system will register to whatever.example.com ok, including installing the consumer id cert, but the auto attach will fail because of the invalid server url, and the --serverurl information will not be saved in the config file.

So then subsequent subman runs will attempt to use it's consumer id cert from example.com, but will use the default/previous server url, likely failing, and often in obtuse ways.

Version-Release number of selected component (if applicable):
subscription-manager-1.14.6, but likely many versions before


Expected results:

Undetermined. Currently, that causes the 'register' command to fail, and return a non-zero exit status.

Unsure if this counts as a full failure. The register (consumer creation) worked, but the auto-attach failed. 

At the moment, the cli code won't persist the server configuration in that case, as it considers it a failure. That's reasonable, but if it's after consumer creation, we've installed the consumer client cert already,so it
should probably go ahead and persist the server configuration to match at point.

Comment 3 John Sefler 2015-05-13 16:59:05 UTC
In my opinion...
   subscription-manager register --serverurl http://whatever.example.com --auto-attach --servicelevel AServiceLevelThatDoesExist

 - should result in a successful registration to whatever.example.com
 - the rhsm.conf file should be updated with the new server.hostname  whatever.example.com
 - no subscriptions should be attached because AServiceLevelThatDoesExist
 - the serviceLevel preference on the consumer should not be set

 - the single exit code is questionable.  If you call module subscribe --servicelevel=AServiceLevelThatDoesExist then the exit code will be 70 (EX_SOFTWARE).   My vote would be for the register module to also return this same exitCode.

Comment 4 Chris "Ceiu" Rog 2015-08-12 16:58:15 UTC
commit fef344066a4d5e40a21188797d6c6197e03a1638
Author: William Poteat <wpoteat>
Date:   Thu Aug 6 10:40:01 2015 -0400

    1221273: Auto-attach failure should not short-circuit other parts of registration
    
    The registration occurs and is successful regardless of auto-bind. If the serverurl is
    set as per the bug, then the received identity cert is from an entitlement engine that
    is no longer reflected in the system configuration. With this change the config is
    updated to match the parameters of the registration.

Comment 6 Shwetha Kallesh 2015-08-17 07:00:12 UTC
Marking verified!!

[root@dhcp35-236 ~]# 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.9-6.el7
python-rhsm: 1.15.4-3.el7


[root@dhcp35-236 ~]# subscription-manager register --serverurl=10.70.35.150:8443/candlepin --force --servicelevel foo --auto-attach
Registering to: 10.70.35.150:8443/candlepin
Username: admin
Password: 
Organization: admin
The system has been registered with ID: 289f5807-2862-4ec6-ba45-4a0df6f91d2c 
Service level 'foo' is not available to units of organization admin.

Installed Product Current Status:
Product Name: Awesome OS for S390 Bits
Status:       Not Subscribed

Product Name: Stackable with Awesome OS for x86_64 Bits
Status:       Not Subscribed

Product Name: Awesome OS for x86_64/i686/ia64/ppc/ppc64/s390x/s390 Bits
Status:       Not Subscribed

Product Name: Awesome OS Workstation Bits
Status:       Not Subscribed


Unable to find available subscriptions for all your installed products.
[root@dhcp35-236 ~]# cat /etc/rhsm/rhsm.conf| grep hostname
# Server hostname:
hostname = 10.70.35.150

Comment 7 errata-xmlrpc 2015-11-19 11:48:27 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.