Project

General

Profile

Bug #5978

after adding the first host, when clicking any host under "all hosts" a back-end error occurs

Added by Thomas McKay over 6 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web UI
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1102382
Description of problem:
A back-end error is occurring when trying to view any of the hosts registered to the Satellite.

Version-Release number of selected component (if applicable):
foreman-1.6.0.13-1.el6sat.noarch
foreman-compute-1.6.0.13-1.el6sat.noarch
foreman-gce-1.6.0.13-1.el6sat.noarch
foreman-libvirt-1.6.0.13-1.el6sat.noarch
foreman-ovirt-1.6.0.13-1.el6sat.noarch
foreman-postgresql-1.6.0.13-1.el6sat.noarch
foreman-proxy-1.6.0.6-1.el6sat.noarch
foreman-vmware-1.6.0.13-1.el6sat.noarch
katello-1.5.0-25.el6sat.noarch
katello-ca-1.0-1.noarch
katello-certs-tools-1.5.5-1.el6sat.noarch
katello-installer-0.0.44-1.el6sat.noarch
pulp-katello-plugins-0.3-1.el6sat.noarch
ruby193-rubygem-foreman_bootdisk-2.0.6-1.1.el6sat.noarch
ruby193-rubygem-foreman_discovery-1.3.0-0.1.rc2.el6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.5-2.el6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.0.4-1.el6sat.noarch
ruby193-rubygem-foreman-tasks-0.5.7-2.el6sat.noarch
ruby193-rubygem-katello-1.5.0-50.el6sat.noarch
rubygem-hammer_cli_foreman-0.1.1-5.el6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.el6sat.noarch
rubygem-hammer_cli_katello-0.0.4-4.el6sat.noarch

How reproducible:
Unknown

Steps to Reproduce:
1. Register a host to the system with puppet (sign cert, etc)
2. Visit all hosts page
3. Click the satellite itself, or your registered host

Actual results:
A back-end error occurs:
NoMethodError
undefined method `association_class' for nil:NilClass
app/views/hosts/show.html.erb:20:in `_app_views_hosts_show_html_erb___29573875474748083_92045900'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

Processing by HostsController#show as HTML
Parameters: {"id"=>"client-10.ejacobs.local"}
Deface: 1 overrides found for 'hosts/show'
Deface: 'add_system_link_to_host' matched 1 times with 'td:first'
Rendered hosts/show.html.erb within layouts/application (26.7ms)
Operation FAILED: undefined method `association_class' for nil:NilClass
Rendered common/500.html.erb within layouts/application (4.6ms)
Rendered layouts/base.html.erb (1.1ms)
Completed 500 Internal Server Error in 53ms (Views: 10.3ms | ActiveRecord: 2.1ms)

Expected results:
The host "show" page should be displayed.

Additional info:

Associated revisions

Revision b5941847 (diff)
Added by Partha Aji over 6 years ago

Fixes #5978 - Included content host in Host::Managed

Host::Managed extends Host::Base, but for some reason
probably due to server caching the change to Host::Base
is not geting reflected in the sub class causing the dreaded
Operation FAILED: undefined method `association_class' for nil:NilClass

irb(main):015:0> Host::Base.reflections.keys.grep /content_host/
=> [:content_host]
irb(main):016:0> Host.reflections.keys.grep /content_host/
=> []
irb(main):017:0> Host::Managed.reflections.keys.grep /content_host/
=> []
Even something like a reset_column_information didnt do the trick.
This happens only in production, could not reproduce in my Dev
Environment.

This commit fixes this by forcing the inclusion of
HostBaseExtensions in both subclass and super class.

Revision 4e02420c
Added by Partha Aji over 6 years ago

Merge pull request #4174 from parthaa/host-reload-hack

Fixes #5978 - Included content host in Host::Managed

History

#1 Updated by Thomas McKay over 6 years ago

  • Assignee set to Thomas McKay
  • Target version set to 45
  • Triaged set to No

#2 Updated by Partha Aji over 6 years ago

  • Assignee changed from Thomas McKay to Partha Aji

#3 Updated by Partha Aji over 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset katello|commit:b5941847f0285b720853c60a1f1504dd6978d359.

#4 Updated by Eric Helms over 6 years ago

  • Triaged changed from No to Yes

#5 Updated by Eric Helms about 6 years ago

  • Legacy Backlogs Release (now unused) set to 13

Also available in: Atom PDF