Bug 887113 - Katello adds subscriptions twice
Katello adds subscriptions twice
Status: CLOSED ERRATA
Product: Subscription Asset Manager
Classification: Red Hat
Component: candlepin (Show other bugs)
1.3
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Brad Buckingham
sthirugn@redhat.com
: Triaged, ZStream
Depends On:
Blocks: sam13-tracker 887255 896248
  Show dependency treegraph
 
Reported: 2012-12-13 22:43 EST by Scott McCarty
Modified: 2013-10-01 06:54 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 887255 896248 (view as bug list)
Environment:
Last Closed: 2013-10-01 06:54:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Final manaifest with 5 subscriptions removed (76.55 KB, application/zip)
2012-12-13 22:43 EST, Scott McCarty
no flags Details
Screen shot of first set 15 of attachements (139.11 KB, image/png)
2012-12-13 22:44 EST, Scott McCarty
no flags Details
Screen shot of second set 15 of attachements (311.33 KB, image/png)
2012-12-13 22:45 EST, Scott McCarty
no flags Details
Katello Debug (1016.28 KB, application/x-gzip)
2012-12-13 22:52 EST, Scott McCarty
no flags Details
First manifest with 15 subs (71.67 KB, application/zip)
2013-01-23 10:17 EST, Scott McCarty
no flags Details
Second manifest with bundle of 15 subs and 5 subs (116.58 KB, application/zip)
2013-01-23 10:17 EST, Scott McCarty
no flags Details
Third manifest with 5 subs removed, back at 15 subs (71.67 KB, application/zip)
2013-01-23 10:18 EST, Scott McCarty
no flags Details

  None (edit)
Description Scott McCarty 2012-12-13 22:43:17 EST
Created attachment 663317 [details]
Final manaifest with 5 subscriptions removed

Description of problem:
If a manifest is generated with one subscription, then imported into katello, then later a second subscription is added, later that second set of subscriptions can be removed and cause katello to have two copies of the same subscription from the same manifest.

Version-Release number of selected component (if applicable):


How reproducible:
Only done once, but I suspect very.


Steps to Reproduce:
1. Generate a manifest at access.redhat.com with 15 subscriptions add
2. Import manifest into katello
3. Add 5 subscriptions to initially generated manifest using access.redhat.com
4. Import the manifest again and both sets of subscriptions will show up correctly
5. Remove the 5 subscriptions added from the initially generated manifest at access.redhat.com
6. Import the manifest again () and now the 
  
Actual results:
The first 15 subscriptions show up twice.

Expected results:
The five extra subscriptions would be removed from Katello

Additional info:
Screen shots attached
Katello debug attached
Manifest attached
Comment 1 Scott McCarty 2012-12-13 22:44:23 EST
Created attachment 663320 [details]
Screen shot of first set 15 of attachements
Comment 2 Scott McCarty 2012-12-13 22:45:15 EST
Created attachment 663323 [details]
Screen shot of second set 15 of attachements
Comment 3 Scott McCarty 2012-12-13 22:52:46 EST
Created attachment 663324 [details]
Katello Debug
Comment 7 Lukas Zapletal 2013-01-18 12:21:18 EST
I am unable to reproduce, can you please send me all three manifests you tried this with?
Comment 8 Scott McCarty 2013-01-23 10:17:18 EST
Created attachment 685987 [details]
First manifest with 15 subs
Comment 9 Scott McCarty 2013-01-23 10:17:58 EST
Created attachment 685988 [details]
Second manifest with bundle of 15 subs and 5 subs
Comment 10 Scott McCarty 2013-01-23 10:18:47 EST
Created attachment 685989 [details]
Third manifest with 5 subs removed, back at 15 subs
Comment 12 Justin Sherrill 2013-01-23 21:36:14 EST
able to produce using katello master and candlepin-0.7.19-1.fc16.noarch which is the newest that katello ships.  @lzap, i'm not sure why you were unable to reproduce.   

The steps i took:

1.  create a manifest with a single red hat employee subscription with 5 entitlements 
2.  Import into a new org within katello
3.  update the manifest and add an addition red hat employee subscription with 2 entitlements   (Note that this is 2 subscriptions, one with 5 and one with 2 entitlements,  not a single subscription with 7)
4.  Improt 2nd manifest
5.  Remove subscription with only 2 entitlement from the manifest within the support portal
6.  Import the 3rd manifest

Results: 
See two subscriptions within katello, both showing 5 subscriptions.  

No consumption or promotion required.
Comment 13 Justin Sherrill 2013-01-23 21:46:53 EST
I am able to reproduce purely with candlepin (using the rails console):


Importing first manifest (We see a single pool is created):

1.8.7 :017 > Resources::Candlepin::Owner.import("TestOrg", '/tmp/3manifests/manifest1.zip', {})
 => "" 
1.8.7 :018 > Resources::Candlepin::Owner.pools("TestOrg").collect{|s| s['id']} 
      => ["8a8d00913c6a3b08013c6a6d079d00bc"] 


Importing second manifest (We see a 2nd pool is created):

1.8.7 :019 > Resources::Candlepin::Owner.import("TestOrg", '/tmp/3manifests/manifest2.zip', {})
 => "" 
1.8.7 :020 > Resources::Candlepin::Owner.pools('TestOrg').collect{|s| s['id']} 
=> ["8a8d00913c6a3b08013c6a6f587a00f3", "8a8d00913c6a3b08013c6a6d079d00bc"] 



Importing third manifest (We see a 2nd pool still exists, and both show up as having a quantity of 5):

1.8.7 :021 > Resources::Candlepin::Owner.import("TestOrg", '/tmp/3manifests/manifest3.zip', {})
 => "" 
1.8.7 :022 > Resources::Candlepin::Owner.pools('TestOrg').collect{|s| s['id']} 
=> ["8a8d00913c6a3b08013c6a6f587a00f3", "8a8d00913c6a3b08013c6a6d079d00bc"] 
1.8.7 :023 > Resources::Candlepin::Owner.pools('TestOrg').collect{|s| s['quantity']}
 => [5, 5]
Comment 14 Justin Sherrill 2013-01-24 09:44:46 EST
FYI also able to reproduce on 0.7.23
Comment 15 Devan Goodwin 2013-01-24 10:31:01 EST
Confirm I can reproduce with Justin's manifests on standalone candlepin. Definitely a bug on our end.
Comment 16 Bryan Kearney 2013-02-19 08:13:56 EST
Moving this to POST as the fix is available in the 0.7.25 build of candlepin. Please move this along once you have brought that build (or later) into use.

The last commit in the patch stream for this was 6805a2c7df244ad2acd6f0bb71e47bf4fc20c089.
Comment 17 Bryan Kearney 2013-06-07 14:19:41 EDT
Moving all POST bugs to ON_QA since we have delivered a puddle with the bugs.
Comment 18 sthirugn@redhat.com 2013-07-16 15:58:12 EDT
Verified in headpin nightly.

Version Tested:
* candlepin-0.8.17-1.el6.noarch
* candlepin-cert-consumer-ibm-x3650-04.ovirt.rhts.eng.bos.redhat.com-1.0-1.noarch
* candlepin-tomcat6-0.8.17-1.el6.noarch
* elasticsearch-0.19.9-7.el6.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-1.el6.noarch
* katello-cli-1.4.2-1.git.123.5415a3c.el6.noarch
* katello-cli-common-1.4.2-1.git.123.5415a3c.el6.noarch
* katello-common-1.4.2-1.git.846.c3e1652.el6.noarch
* katello-configure-1.4.3-1.git.67.f71e590.el6.noarch
* katello-glue-candlepin-1.4.2-1.git.846.c3e1652.el6.noarch
* katello-glue-elasticsearch-1.4.2-1.git.846.c3e1652.el6.noarch
* katello-headpin-1.4.2-1.git.846.c3e1652.el6.noarch
* katello-headpin-all-1.4.2-1.git.846.c3e1652.el6.noarch
* Katello-Katello-Installation-RegisterRHNClassic-1.1-4.noarch
* Katello-Katello-Sanity-ImportKeys-1.2-1.noarch
* katello-repos-1.4.2-1.el6.noarch
* katello-selinux-1.4.3-1.git.4.99dc194.el6.noarch
* thumbslug-0.0.27-1.el6.noarch
* thumbslug-selinux-0.0.27-1.el6.noarch
Comment 22 errata-xmlrpc 2013-10-01 06:54:31 EDT
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/RHEA-2013-1390.html

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