Bug 807291 - Adding a "bonus pool" to an activation key, then removing parent pool, causes errors
Adding a "bonus pool" to an activation key, then removing parent pool, causes...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
6.0.0
Unspecified Unspecified
unspecified Severity high (vote)
: Unspecified
: --
Assigned To: Tom McKay
Kedar Bidarkar
: Triaged, ZStream
Depends On:
Blocks: 817634 827549
  Show dependency treegraph
 
Reported: 2012-03-27 08:55 EDT by Tom McKay
Modified: 2014-09-18 12:42 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Viewing an activation key's "Application Subscriptions" subtab resulted in an error: "undefined method 'productName'" System removal with a consumed physical subscription from the activation key caused this error. This fix checks subscription pools for validity prior to accessing the activation key.
Story Points: ---
Clone Of:
: 817634 827549 (view as bug list)
Environment:
Last Closed: 2012-12-04 14:44:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom McKay 2012-03-27 08:55:51 EDT
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'
Comment 1 James Laska 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?
Comment 2 Mike McCune 2012-04-18 11:43:05 EDT
moving to 1.0.z
Comment 3 Tom McKay 2012-04-30 12:48:47 EDT
Hopefully not common. 1.0.z would be good
Comment 4 Tom McKay 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@redhat.com>
  Date:   2012-05-01 (Tue, 01 May 2012)

Subscription pools are checked for validity before the activation key can be accessed.
Comment 7 Kedar Bidarkar 2012-09-21 04:38:12 EDT
To 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 now shows

"There are no more subscriptions available." and no error is thrown now.
Comment 9 errata-xmlrpc 2012-12-04 14:44:06 EST
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/RHSA-2012-1543.html

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