Foreman 1.16, Katello 3.5 and foreman_monitoring 0.1.1 permissions on hosts view

Hi all,

I’m having an issue with Foreman 1.16, Katello 3.5 and a freshly installed foreman_monitoring plugin 0.1.1 when attempting to view hosts within the GUI.

Prior to installing the monitoring plugin this was working as expected allowing me to view, list and create hosts. Since installing and configuring the foreman_monitoring plugin via yum install tfm-rubygem-foreman_monitoring every time I view the hosts page I get the following dump: https://snag.gy/rfSPYW.jpg

Upon further inspection of the /var/log/foreman/production.log I can see the following errors:

    2018-01-17 10:20:21 580ba4fc [app] [I] Started GET "/hosts" for 192.168.52.35 at 2018-01-17 10:20:21 +1100
    2018-01-17 10:20:21 580ba4fc [app] [I] Processing by HostsController#index as HTML
    2018-01-17 10:20:21 580ba4fc [app] [I] Current user: RullerA (administrator)
    2018-01-17 10:20:21 580ba4fc [app] [D] Setting current user thread-local variable to RullerA
    2018-01-17 10:20:21 580ba4fc [app] [D] Setting current organization thread-local variable to XXXX
    2018-01-17 10:20:21 580ba4fc [app] [D] Setting current location thread-local variable to none
    2018-01-17 10:20:21 580ba4fc [app] [W] Action failed
     | SystemStackError: stack level too deep
     | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:462:in `convert_value_to_parameters'
     | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:456:in `convert_hashes_to_parameters'
     | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:351:in `[]'
     | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/hash_with_indifferent_access.rb:69:in `default'
     | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:351:in `[]'
     | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:351:in `[]'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_monitoring-0.1.1/app/controllers/concerns/foreman_monitoring/hosts_controller_extensions.rb:129:in `action_permission'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.5.0.1/app/controllers/katello/concerns/hosts_controller_extensions.rb:57:in `action_permission_with_katello'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_monitoring-0.1.1/app/controllers/concerns/foreman_monitoring/hosts_controller_extensions.rb:135:in `action_permission'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.5.0.1/app/controllers/katello/concerns/hosts_controller_extensions.rb:57:in `action_permission_with_katello'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_monitoring-0.1.1/app/controllers/concerns/foreman_monitoring/hosts_controller_extensions.rb:135:in `action_permission'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.5.0.1/app/controllers/katello/concerns/hosts_controller_extensions.rb:57:in `action_permission_with_katello'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_monitoring-0.1.1/app/controllers/concerns/foreman_monitoring/hosts_controller_extensions.rb:135:in `action_permission'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.5.0.1/app/controllers/katello/concerns/hosts_controller_extensions.rb:57:in `action_permission_with_katello'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_monitoring-0.1.1/app/controllers/concerns/foreman_monitoring/hosts_controller_extensions.rb:135:in `action_permission'
     | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.5.0.1/app/controllers/katello/concerns/hosts_controller_extensions.rb:57:in `action_permission_with_katello'

I can view the hosts list via the hammer CLI and the API but not via the web GUI. I haven’t been able to find any related posts on this issue either.

I’ve also configured the monitoring plugin with Icinga2 and can confirm this is working as expected with no errors in the foreman/icinga logs and downtime requests being sent.

I’ll continue to debug this and update if I find anything…

Thanks!
Andrew

I think https://github.com/theforeman/foreman_monitoring/commit/f596308d778fa15ddc4f886e467da036a32bd5df would fix the issue: it however not included that n the 1.16 release. @TimoGoebel will probably know more

Thanks for the hint @iNecas . I can confirm that all other functionality related to the implementation of foreman_monitoring works normally. I have been able to assign monitoring profiles via hostgroups, and had those settings inherited by hosts, resulting in hosts being added successfully to icinga2 via icinga director.

Its it possibly worth generating a patch from that commit and applying it to see if it resolves the issue?

1 Like

I confirmed that that change was in my version however I notice that 10 days ago there was this commit to revert that change…

I have applied the changes as part of this commit : https://github.com/theforeman/foreman_monitoring/commit/a5713143b396db0638901a178535599e0411a8e2

And can confirm this has resolved the issue i was seeing. Thanks again to @iNecas for the hint and @TimoGoebel for the fix and awesome module!

1 Like

Updating foreman_monitoring to 0.1.2 would also have fixed this.

2 Likes