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 995597 - multiple pool attachments no longer tolerates a bad pool after bug fix 994711
Summary: multiple pool attachments no longer tolerates a bad pool after bug fix 994711
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 6.5
Assignee: Carter Kozak
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel65
TreeView+ depends on / blocked
 
Reported: 2013-08-09 19:53 UTC by John Sefler
Modified: 2014-09-15 00:09 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary.
Clone Of:
Environment:
Last Closed: 2013-11-21 21:27:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1659 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2013-11-20 21:53:10 UTC

Description John Sefler 2013-08-09 19:53:17 UTC
Description of problem:
As a consequence of the fix for bug 994711, we now have a less desirable behavior for the case of attaching multiple pools.

I believe the offending commit is: https://github.com/candlepin/candlepin/commit/fb38bec406461340697ccfa2cbeb51f7d37c9aa0


Behavior prior to candlepin commit fb38bec406461340697ccfa2cbeb51f7d37c9aa0...
# subscription-manager subscribe --pool=bad123 --pool=8a90f8c63159ce55013159cfd6c40303 --pool=8a90f8c63159ce55013159cfd6c40303 --pool=8a90f8c63159ce55013159cfea7a06ac --pool=8a90f8c63159ce55013159cfea7a06ac --pool=bad_POOLID
Stdout:
Subscription pool bad123 does not exist.
Successfully attached a subscription for 8a90f8c63159ce55013159cfd6c40303
This unit has already had the subscription matching pool ID '8a90f8c63159ce55013159cfd6c40303' attached.
Successfully attached a subscription for 8a90f8c63159ce55013159cfea7a06ac
Successfully attached a subscription for 8a90f8c63159ce55013159cfea7a06ac
Subscription pool bad_POOLID does not exist.
Stderr: 
ExitCode: 0

Behavior after candlepin commit fb38bec406461340697ccfa2cbeb51f7d37c9aa0...
# subscription-manager subscribe --pool=bad123 --pool=8a90f8c63159ce55013159cfd6c40303 --pool=8a90f8c63159ce55013159cfd6c40303 --pool=8a90f8c63159ce55013159cfea7a06ac --pool=8a90f8c63159ce55013159cfea7a06ac --pool=bad_POOLID
Stdout:
Stderr: Pool with id bad123 could not be found.
ExitCode: 255

The prior behavior sequentially processed each pool and continued attaching even when a bad attachment was encountered.

It would be nice to restore the original behavior and include within the stdout from an attempt to attach a pool belonging to another org:
Insufficient permission to attach a subscription for ${POOL}

Comment 1 Adrian Likins 2013-08-12 19:07:55 UTC
I would vote for this not being a RHEL510 blocker. I think the new behaviour is reasonable given the scenario, though not as optimal as suggested behaviour. Seems like a good 6.5 candidate.



Though, ignoring difficulty, I would think my preferred approach in this scenario would be to try to bind to all the pools with one bind call, and fail
the entire transaction, and provide details on what failed and why. But we
don't actually have candlepin API to do that at the moment.

Current behaviour, or the previous behaviour, don't actually do what the user has asked for ('subscribe me to all of these pools'). The previous behaviour tries to subscribe to all the pulls, but only actually subscribes to some of them, and largely ignores errors. The current behaviour will only try to subscribe to the
pools it processes before hitting the error (which could be none, or all but the last), but does provide an error and exit code.

Comment 2 Carter Kozak 2013-08-28 16:44:08 UTC
commit 9ae3ff13d9ac36ef4d97937e197fc119866fe9b7
Author: ckozak <ckozak>
Date:   Mon Aug 26 13:02:07 2013 -0400

    995597: continue attaching if a pool cannot be found

Comment 5 John Sefler 2013-09-15 17:37:00 UTC
Verifying Version...
[root@jsefler-6 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.8.23-1
subscription-manager: 1.9.6-1.el6
python-rhsm: 1.9.6-1.el6


[root@jsefler-6 ~]# subscription-manager orgs --username=testuser1 --password=password
+-------------------------------------------+
          testuser1 Organizations
+-------------------------------------------+

Name: Admin Owner
Key:  admin

Name: Snow White
Key:  snowwhite

[root@jsefler-6 ~]# subscription-manager register --username=testuser1 --password=password --org=admin --force
The system has been registered with ID: 0aa60bc1-754c-4518-a0c3-71606aee2ae4 
[root@jsefler-6 ~]# subscription-manager list --avail | grep "Pool ID" | tail -2
Pool ID:           8a9086d340d0ae7d0140d0afeaeb0705
Pool ID:           8a9086d340d0ae7d0140d0afeb0c0712
[root@jsefler-6 ~]# subscription-manager register --username=testuser1 --password=password --org=snowwhite --force
The system with UUID 0aa60bc1-754c-4518-a0c3-71606aee2ae4 has been unregistered
The system has been registered with ID: 309bad68-d17f-4370-bbf6-2b10304d2fda 
[root@jsefler-6 ~]# subscription-manager list --avail | grep "Pool ID" | tail -2
Pool ID:           8a9086d340d0ae7d0140d0b006330f43
Pool ID:           8a9086d340d0ae7d0140d0b006510f4f
[root@jsefler-6 ~]# subscription-manager attach --pool=8a9086d340d0ae7d0140d0afeaeb0705 --pool=8a9086d340d0ae7d0140d0b006330f43 --pool=bad123 --pool=8a9086d340d0ae7d0140d0afeb0c0712 --pool=8a9086d340d0ae7d0140d0b006510f4f
Insufficient permissions
Successfully attached a subscription for: Awesome OS for x86_64
Pool with id bad123 could not be found.
Insufficient permissions
Successfully attached a subscription for: Awesome OS for x86_64
[root@jsefler-6 ~]# echo $?
0


VERIFIED: When attaching subscriptions from multiple pools (mixture of good, bad, and from other orgs), each pool is once again processed until all the requested pools have been attempted.

Comment 6 errata-xmlrpc 2013-11-21 21:27:34 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.

http://rhn.redhat.com/errata/RHBA-2013-1659.html


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