Bug 1100059 - Activation Keys index page raising ISE
Summary: Activation Keys index page raising ISE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: Nightly
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Partha Aji
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-21 22:49 UTC by Partha Aji
Modified: 2019-09-26 17:40 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:05:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
please see the logs from production.log (11.49 KB, text/plain)
2014-05-30 12:19 UTC, Sachin Ghai
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 5866 0 None None None 2016-04-22 16:36:59 UTC

Description Partha Aji 2014-05-21 22:49:25 UTC
https://<fqdn>/katello/api/v2/activation_keys page is throwing an ise with the following log output

This seems to happen only when there seems to be  activation keys with products assigned to them.

Log Output

Processing by Katello::Api::V2::ActivationKeysController#show as JSON
  Parameters: {"fields"=>"full", "api_version"=>"v2", "id"=>"6"}
  Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/activation_keys/show.json.rabl within katello/api/v2/layouts/resource (343.0ms)
NoMethodError: undefined method `key?' for #<JSON::Ext::Generator::State:0x0000000f2e3920>
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/object/try.rb:36:in `try'
/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/serializers/json.rb:91:in `as_json'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/models/katello/product.rb:185:in `as_json'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:47:in `block in encode'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:77:in `check_for_circular_references'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:46:in `encode'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/json/encoding.rb:31:in `encode'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/core_ext/object/to_json.rb:16:in `to_json'
/opt/rh/ruby193/root/usr/share/gems/gems/json-1.5.5/lib/json/common.rb:216:in `generate'
/opt/rh/ruby193/root/usr/share/gems/gems/json-1.5.5/lib/json/common.rb:216:in `generate'
/opt/rh/ruby193/root/usr/share/gems/gems/json-1.5.5/lib/json/common.rb:352:in `dump'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:240:in `format_json'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:64:in `to_json'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:285:in `cache_results'
/opt/rh/ruby193/root/usr/share/gems/gems/rabl-0.9.0/lib/rabl/engine.rb:39:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/activation_keys/show.json.rabl:1:in `__opt_rh_ruby____root_usr_share_gems_gems_katello_______app_views_katello_api_v__activation_keys_show_json_rabl__4038923587224331950_92770160'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in `block in render'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:125:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/template.rb:143:in `render'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
/opt/rh/ruby193/root/usr/share/gems/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:45:in `render_template'

Comment 2 Partha Aji 2014-05-21 22:51:39 UTC
Created redmine issue http://projects.theforeman.org/issues/5866 from this bug

Comment 3 RHEL Program Management 2014-05-21 23:14:54 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 5 Bryan Kearney 2014-05-23 15:47:18 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/5866 has been closed

Comment 7 Sachin Ghai 2014-05-30 12:16:56 UTC
Verified with sat6 beta snap7 compose2 (Satellite-6.0.3-RHEL-6-20140528.4)

https://fqdn/katello/api/v2/activation_keys page is throwing following error instead of undefined method. And also the created activation_keys are tied to different products.

{"displayMessage":"Either organization ID or environment ID needs to be specified","errors":["Either organization ID or environment ID needs to be specified"]}

Comment 8 Sachin Ghai 2014-05-30 12:19:36 UTC
Created attachment 900794 [details]
please see the logs from production.log

Comment 9 Sachin Ghai 2014-05-30 12:22:49 UTC
@Partha, Please confirm if the steps taken to verify this bz are correct from comments 7 and 8 and if its the expected result.

Comment 10 Partha Aji 2014-06-03 18:45:58 UTC
@Sachin I think you were directly browsing to http://<fqdn>/katello/api/v2/activation_keys with no parameters, which is not the actual page for activation keys index. The correct page in the UI http://<fqdn>/activation_keys. You need to be going there.

The initial description I gave referred to http://<fqdn>/katello/api/v2/activation_keys because http://<fqdn>/activation_keys calls this api url with the requisite parameters. So you can test this 2 ways. 
1) Either do 'hammer activation-key list --organization-id=<id>' OR
2) Just go to the activation_keys page in the UI by selecting from the Content Menu and make sure no errors are raised.

Comment 11 Sachin Ghai 2014-06-04 06:55:04 UTC
thanks Partha..

Verified with sat6 beta snap7 compose2 (Satellite-6.0.3-RHEL-6-20140528.4)

I can list the activation-key as suggested in comment 10. And didn't see any error in logs.

[root@dhcp207-55 ~]# hammer activation-key list --organization-id=1
---|-----------|----------------|-----------------------|-------------
ID | NAME      | CONSUMED       | LIFECYCLE ENVIRONMENT | CONTENT VIEW
---|-----------|----------------|-----------------------|-------------
2  | rhel65_ak | 2 of Unlimited | Dev                   | cv-rhel65-ks
7  | test      | 0 of Unlimited | Dev                   |             
---|-----------|----------------|-----------------------|-------------

Also I navigate to Activation key page via UI and didn't see any error in production.log. As per the defect description, key is tied up with CV/product too.

Comment 12 Bryan Kearney 2014-07-02 14:05:51 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.


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