Bug 887113 - Katello adds subscriptions twice
Summary: Katello adds subscriptions twice
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: candlepin
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Brad Buckingham
QA Contact: sthirugn@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: sam13-tracker 887255 896248
TreeView+ depends on / blocked
 
Reported: 2012-12-14 03:43 UTC by Scott McCarty
Modified: 2013-10-01 10:54 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
: 887255 896248 (view as bug list)
Environment:
Last Closed: 2013-10-01 10:54:31 UTC
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2013:1390 0 normal SHIPPED_LIVE Release 1.3 of Subscription Asset Manager 2013-10-01 14:43:14 UTC

Description Scott McCarty 2012-12-14 03:43:17 UTC
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-14 03:44:23 UTC
Created attachment 663320 [details]
Screen shot of first set 15 of attachements

Comment 2 Scott McCarty 2012-12-14 03:45:15 UTC
Created attachment 663323 [details]
Screen shot of second set 15 of attachements

Comment 3 Scott McCarty 2012-12-14 03:52:46 UTC
Created attachment 663324 [details]
Katello Debug

Comment 7 Lukas Zapletal 2013-01-18 17:21:18 UTC
I am unable to reproduce, can you please send me all three manifests you tried this with?

Comment 8 Scott McCarty 2013-01-23 15:17:18 UTC
Created attachment 685987 [details]
First manifest with 15 subs

Comment 9 Scott McCarty 2013-01-23 15:17:58 UTC
Created attachment 685988 [details]
Second manifest with bundle of 15 subs and 5 subs

Comment 10 Scott McCarty 2013-01-23 15:18:47 UTC
Created attachment 685989 [details]
Third manifest with 5 subs removed, back at 15 subs

Comment 12 Justin Sherrill 2013-01-24 02:36:14 UTC
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-24 02:46:53 UTC
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 14:44:46 UTC
FYI also able to reproduce on 0.7.23

Comment 15 Devan Goodwin 2013-01-24 15:31:01 UTC
Confirm I can reproduce with Justin's manifests on standalone candlepin. Definitely a bug on our end.

Comment 16 Bryan Kearney 2013-02-19 13:13:56 UTC
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 18:19:41 UTC
Moving all POST bugs to ON_QA since we have delivered a puddle with the bugs.

Comment 18 sthirugn@redhat.com 2013-07-16 19:58:12 UTC
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 10:54:31 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/RHEA-2013-1390.html


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