Bug #6215
closedNoMethodError: undefined method `key?' on accessing content-host's index page after registering system via rhsm
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1109134
Description of problem:
I registered two systems one after another via rhsm and with activation-key.
The activation-key was updated with two subscriptions (custom rhel65 and rhcommon tools)
After registering systems one after another, I installed katello-agent on both of them. Later, I just go to content-host via UI and found a long traceback in production.log:
Completed 200 OK in 1744ms (Views: 8.9ms | ActiveRecord: 3.3ms)
Processing by Katello::Api::V1::CandlepinProxiesController#get as JSON
Parameters: {"api_version"=>"v1", "id"=>"9888760e-312a-4014-add9-4b9efb2edf77", "candlepin_proxy"=>{}}
Completed 200 OK in 383ms (Views: 0.7ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V1::CandlepinProxiesController#get as JSON
Parameters: {"serials"=>"2016062176823966984,6648498048205453864", "api_version"=>"v1", "id"=>"9888760e-312a-4014-add9-4b9efb2edf77", "candlepin_proxy"=>{}}
Completed 200 OK in 363ms (Views: 0.6ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V1::CandlepinProxiesController#get as JSON
Parameters: {"api_version"=>"v1", "id"=>"9888760e-312a-4014-add9-4b9efb2edf77", "candlepin_proxy"=>{}}
Completed 200 OK in 179ms (Views: 0.7ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V1::CandlepinProxiesController#get as JSON
Parameters: {"api_version"=>"v1", "id"=>"9888760e-312a-4014-add9-4b9efb2edf77", "candlepin_proxy"=>{}}
Completed 200 OK in 356ms (Views: 0.7ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V1::CandlepinProxiesController#get as JSON
Parameters: {"api_version"=>"v1", "id"=>"9888760e-312a-4014-add9-4b9efb2edf77", "candlepin_proxy"=>{}}
Completed 200 OK in 173ms (Views: 0.7ms | ActiveRecord: 0.0ms)
Processing by Katello::Api::V1::CandlepinProxiesController#enabled_repos as JSON
Parameters: {"enabled_repos"=>{"repos"=>[{"baseurl"=>["https://dhcp207-55.lab.eng.pnq.redhat.com/pulp/repos/ACME_Corporation/dev/cv-rhel65-ks/custom/RHEL6/RHEL65_x86_64"], "repositoryid"=>"ACME_Corporation_RHEL6_RHEL65_x86_64"}, {"baseurl"=>["https://dhcp207-55.lab.eng.pnq.redhat.com/pulp/repos/ACME_Corporation/dev/cv-rhel65-ks/custom/Sat6Tools/rhcommon"], "repositoryid"=>"ACME_Corporation_Sat6Tools_rhcommon"}]}, "api_version"=>"v1", "id"=>"9888760e-312a-4014-add9-4b9efb2edf77", "candlepin_proxy"=>{"enabled_repos"=>{"repos"=>[{"baseurl"=>["https://dhcp207-55.lab.eng.pnq.redhat.com/pulp/repos/ACME_Corporation/dev/cv-rhel65-ks/custom/RHEL6/RHEL65_x86_64"], "repositoryid"=>"ACME_Corporation_RHEL6_RHEL65_x86_64"}, {"baseurl"=>["https://dhcp207-55.lab.eng.pnq.redhat.com/pulp/repos/ACME_Corporation/dev/cv-rhel65-ks/custom/Sat6Tools/rhcommon"], "repositoryid"=>"ACME_Corporation_Sat6Tools_rhcommon"}]}}}
Completed 200 OK in 1463ms (Views: 1.1ms | ActiveRecord: 5.5ms)
Processing by Katello::Api::V2::SystemsController#index as JSON
Parameters: {"organization_id"=>"1", "page"=>"1", "search"=>"", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/systems/index.json.rabl within katello/api/v2/layouts/collection (3195.8ms)
NoMethodError: undefined method `key?' for #<JSON::Ext::Generator::State:0x0000000de7c720>
/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'
Version-Release number of selected component (if applicable):
sat6 beta snap9 compose2
How reproducible:
always
Steps to Reproduce:
1. created an activation-key and updated it with custom rhel65_x64 + rhcommon tools
2. register two hosts via rhsm and with created activation-key in step1
3. installed katello-agent on both system
4. go to content-host page, no registered hos was listed,
Actual results:
Firebug raises a Network Error 500 ISE
production.log was filled with:
NoMethodError: undefined method `key?' for #<JSON::Ext::Generator::State:0x0000000de7c720>
Expected results:
content-host should be listed on UI, without error in production.log
Additional info: