Project

General

Profile

Bug #23823

subscriptions pages/api errors with 'NoMethodError: undefined method `id' for nil:NilClass'

Added by Stephen Benjamin about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Subscriptions
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1580436

Description of problem:

Customer reported, after upgrade to 6.3.1, his subscription pages erroring with:

2018-05-18 21:00:18 d0f6c16b [app] [I] Started GET "/api/v2/hosts?organization_id=3&page=1&paged=true&per_page=50&search=&sort_by=name&sort_order=ASC" for
2018-05-18 21:00:18 7d017c23 [app] [I] Rendered home/_submenu.html.erb (0.9ms)
2018-05-18 21:00:18 7d017c23 [app] [I] Rendered home/_user_dropdown.html.erb (2.0ms)
2018-05-18 21:00:18 7d017c23 [app] [I] Read fragment views/tabs_and_title_records-4 (0.1ms)
2018-05-18 21:00:18 d0f6c16b [app] [I] Processing by Api::V2::HostsController#index as JSON
2018-05-18 21:00:18 d0f6c16b [app] [I] Parameters: {"organization_id"=>"3", "page"=>"1", "paged"=>"true", "per_page"=>"50", "search"=>"", "sort_by"=>"name", "sort_order"=>
"ASC", "apiv"=>"v2"}
2018-05-18 21:00:18 7d017c23 [app] [I] Rendered home/_organization_dropdown.html.erb (2.9ms)
2018-05-18 21:00:18 d0f6c16b [app] [I] Current user: (administrator)
2018-05-18 21:00:18 d0f6c16b [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)

2018-05-18 21:00:38 d706e273 [app] [E] NoMethodError: undefined method `id' for nil:NilClass | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64.2/app/views/katello/api/v2/subscriptions/base.json.rabl:22:in `block in eval_source' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:152:in `node' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:114:in `block in compile_settings' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:113:in `each' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:113:in `compile_settings' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:58:in `block in to_hash' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:248:in `cache_results' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:49:in `to_hash' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:86:in `to_hash' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:48:in `block in render' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:382:in `cache_results' | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:47:in `render'

Version-Release number of selected component (if applicable):
6.3.1.1

How reproducible:
Unknown


Related issues

Related to Katello - Bug #24892: 3.6 to 3.7 upgrade issue: katello_pools_hypervisor_fk constraint violationClosed

Associated revisions

Revision 8234c3af (diff)
Added by Stephen Benjamin about 3 years ago

refs #23823 - pool hypervisor nullified on host destroy

When a host is destroyed, we should nullify the hypervisor_id in
Katello:Pool.

History

#1 Updated by The Foreman Bot about 3 years ago

  • Assignee set to Stephen Benjamin
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7423 added

#2 Updated by John Mitsch about 3 years ago

  • Legacy Backlogs Release (now unused) set to 338
  • Subject changed from subscriptions pages/api errors with 'NoMethodError: undefined method `id' for nil:NilClass' to subscriptions pages/api errors with 'NoMethodError: undefined method `id' for nil:NilClass'

#3 Updated by Brad Buckingham about 3 years ago

  • Status changed from Ready For Testing to Closed

Moving to closed, since referenced PR is merged. Confirmed that there are no additional changes needed.

#4 Updated by Jonathon Turel almost 3 years ago

  • Related to Bug #24892: 3.6 to 3.7 upgrade issue: katello_pools_hypervisor_fk constraint violation added

Also available in: Atom PDF