Bug 676870

Summary: Autosubscribe not finding subscriptions
Product: [Community] Candlepin Reporter: J.C. Molet <jmolet>
Component: candlepinAssignee: Bryan Kearney <bkearney>
Status: CLOSED CURRENTRELEASE QA Contact: J.C. Molet <jmolet>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.5CC: bkearney, spandey
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Solaris   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-30 20:44:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 568421    

Description J.C. Molet 2011-02-11 16:02:49 UTC
Description of problem:
When using the autosubscribe feature in the register dialog in the gui and cli.  It does not find any subscriptions.

Version-Release number of selected component (if applicable):
subscription-manager-gnome-0.96.1-1.git.9.b5f84fd.el6.x86_64
subscription-manager-0.96.1-1.git.9.b5f84fd.el6.x86_64
python-rhsm-0.96.1-1.git.0.905ff2e.el6.noarch
subscription-manager-firstboot-0.96.1-1.git.9.b5f84fd.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. Install rhsm versions above ^^ with all their deps on a rhel6 machine.
2. Configure rhsm.conf to point to your stand alone candlepin instance
3. Copy all of the product certs on the stand-alone server to your
/etc/pki/product/
4. Start up subscription-manager-gui.
5. Register your system and check "Select the most appropriate subscriptions for this system".

alternatively do steps 1-3, and use the cli register with --autosubscribe
  
Actual results:
Nothing is subscribed to and you are still out of compliance on all installed products.

Expected results:
At the very least, products with only one matching subscription should be subscribed to.  

Additional info:
For the other products, I'm not sure if the autosubscribe aborts here on purpose because of multiple solutions. But if not, the selection for products that can be fulfilled with multiple subscriptions should be optimized in some way so best matching occurs and the fewest subscriptions are used.

Comment 2 James Bowes 2011-02-18 12:57:08 UTC
I tracked this down to attempting to subscribe to both a modifier product, and a product that it modifies, in the same REST call. In particular, it only happens if the pool containing the modifier product is attempted to be entitled to first. Forcing that pool to come first is nigh impossible, however, and depends upon the database ids of the pools.

What happens is the modifier entitlement certificate is generated, then when the modifiee entitlement certificate is generated, candlepin goes back and sees that this consumer has an entitlement that will modify the current one. So it attempts to delete the modifier entitlement certificate from the db so that it may regenerate one that performs the modification. This deletion fails, as the cert has not yet been saved to the db.

There's a fix for this in master now, commit d48ce0b99. It should be in candlepin-0.2.7-1

Comment 3 J.C. Molet 2011-03-04 21:11:36 UTC
As of tests since subscription-manager-0.95.3, I have not been able to reproduce this bug, and auto-subscribe is working as expected.

Comment 4 John Sefler 2011-05-04 14:41:06 UTC
Group move of VERIFIED Candlepin component bugs to RELEASE_PENDING