Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 827549

Summary: Adding a "bonus pool" to an activation key, then removing parent pool, causes errors
Product: Red Hat Satellite Reporter: Chris Pelland <cpelland>
Component: Content ManagementAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED ERRATA QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: cpelland, hhovsepy, jlaska, kbidarka, mmccune, omaciel, sachua, tomckay
Target Milestone: UnspecifiedKeywords: Triaged, ZStream
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
If users add a bonus pool to an activation key and remove a parent pool, users will have an error message: "undefined method 'productName' for nil:NilClass" when viewing the activation key and selecting "Applied Subscriptions" tab. With this update, an activation key will now validate pools when loaded which removes the error message.
Story Points: ---
Clone Of: 807291 Environment:
Last Closed: 2012-07-10 07:24:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 807291    
Bug Blocks: 817634    

Description Chris Pelland 2012-06-01 18:13:12 UTC
+++ This bug was initially created as a clone of Bug #807291 +++

Description of problem:

While creating an activation key I added a bonus pool to it (an available subscription created by consumption of a physical subscription). I then removed the system with the physical subscription, thus effectively eliminating the bonus pool. Viewing the activation key and selecting "Applied Subscriptions" tab throws error:

undefined method `productName' for nil:NilClass

Started GET "/katello/activation_keys/1/applied_subscriptions" for 10.11.230.24 at Tue Mar 27 08:48:24 -0400 2012
  Processing by ActivationKeysController#applied_subscriptions as HTML
  Parameters: {"id"=>"1"}
Setting locale: en
Setting current user thread-local variable to admin
Checking  params  for activation_keys/applied_subscriptions
Authorizing admin for activation_keys/applied_subscriptions
Resource GET request: /candlepin/owners/ACME_Corporation/pools?
Processing response: 200
Setting current user thread-local variable to nil
undefined method `productName' for nil:NilClass
undefined method `productName' for nil:NilClass
#<NoMethodError: undefined method `productName' for nil:NilClass>
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/whiny_nil.rb:48:in `method_missing'
/home/tomckay/code/katello/src/app/controllers/activation_keys_controller.rb:323:in `pools_hash'
/home/tomckay/code/katello/src/app/controllers/activation_keys_controller.rb:322:in `each'
/home/tomckay/code/katello/src/app/controllers/activation_keys_controller.rb:322:in `pools_hash'
/home/tomckay/code/katello/src/app/controllers/activation_keys_controller.rb:315:in `retrieve_applied_pools'
/home/tomckay/code/katello/src/app/controllers/activation_keys_controller.rb:84:in `applied_subscriptions'

--- Additional comment from jlaska on 2012-04-18 10:21:06 EDT ---

Hi Tom, what's the customer impact of this issue?  Is this a common scenario?  Does the presence of the 'nil:NilClass' failure introduce any non-recoverable issues?

--- Additional comment from mmccune on 2012-04-18 11:43:05 EDT ---

moving to 1.0.z

--- Additional comment from tomckay on 2012-04-30 12:48:47 EDT ---

Hopefully not common. 1.0.z would be good

--- Additional comment from tomckay on 2012-05-02 09:27:36 EDT ---

  Branch: refs/heads/master
  Home:   https://github.com/Katello/katello
  Commit: 29d5d46ca6b4a96c2b410b6f765b72c1732fc941
      https://github.com/Katello/katello/commit/29d5d46ca6b4a96c2b410b6f765b72c1732fc941
  Author: Tom McKay <thomasmckay>
  Date:   2012-05-01 (Tue, 01 May 2012)

Subscription pools are checked for validity before the activation key can be accessed.

Comment 4 sachua 2012-06-13 05:37:44 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
If users add a bonus pool to an activation key and remove a parent pool, users will have an error message: "undefined method 'productName' for nil:NilClass" when viewing the activation key and selecting "Applied Subscriptions" tab. With this update, an activation key will now validate pools when loaded which removes the error message.

Comment 5 Kedar Bidarkar 2012-06-21 09:46:33 UTC
No errors seen with the latest puddle 2012-06-18.1

I would list out the steps followed here.

a) import a subscription manifest
b) synced rhel6.2 content
c) registerd and subscribed a system 
d) which consumed a physical type subscription and created a bonus pool which had 4 virtual type subscriptions.
e) Added this virtual type subscription to the activation key via, Available subscriptions
f) Moved to Applied Subscriptions tab to check for the presence of the virtual subscriptions
g) Removed the physical system , which actually created the bonus pool
h) Moved to the Applied Subscription under Activation keys section, to check for erros.

FOUND NO ERRORS.

It just displays : "There are no more subscriptions available."

Comment 7 errata-xmlrpc 2012-07-10 07:24:54 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-2012-1062.html