Foreman GUI fails on puppet client failure
I have a Solaris server and I recently added to his puppet.conf "report=true"
I had a problem with my time manifest and for some reason my ntp service on the server got into maintenance mode.
The thing is that it made my Foreman interface not operational . The minute I did "svcadm clear network/ntp" and restarted puppet
forman interface got back to work.
Here is the error log I got in production.log
ActionView::TemplateError (can't convert true into String) on line #11 of vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb: 8: 9: <tr class="record <%= tr_class %>" id="<%= element_row_id(:action => :list, :id => record.id) %>"> 10: <% active_scaffold_config.list.columns.each do |column| %> 11: <% column_value = get_column_value(record, column) -%> 12: 13: <td class="<%= column_class(column, column_value) %>" > 14: <%= record.authorized_for?(:action => :read, :column => column.name) ? render_list_column(column_value, column, record) : '' %> app/helpers/hosts_helper.rb:7:in `last_report_column' vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb:11 vendor/plugins/active_scaffold/frontends/default/views/_list_record.html.erb:10 vendor/plugins/active_scaffold/frontends/default/views/_list.html.erb:24 vendor/plugins/active_scaffold/frontends/default/views/list.html.erb:30 Rendering /usr/share/puppet/rack/foreman/public/500.html (500 Internal Server Error)
I think that no client error from all kinds should damage foreman ....
#2 Updated by Moty Lavi almost 10 years ago
I don't have the store option ....
The issue started when ntp service did not manage to update time from server (gap was too long) so it put himself into maintenance mode.
I've got the message:
Failed to retrieve current state of resource: Unmanageable state 'maintenance' on service network/ntp
It looks like my manifest has problems dealing with this type of state.... but still I don't know how it affect foreman...
I don't fully understand "the good and bad report" ....
I can also try to reproduce this ....
#3 Updated by Moty Lavi almost 10 years ago
I reproduce the error (crashed foreman gui)
I change network/ntp to maintenance mode and got the same error.
I also added store option to my reports so attached are a good yaml and a bad one...
Hope it will help
#4 Updated by Ohad Levy almost 10 years ago
- Assignee changed from Ohad Levy to Moty Lavi
can you confirm if the following solves the bug?
diff --git a/app/models/host.rb b/app/models/host.rb index 4502808..d9cfe0c 100644 --- a/app/models/host.rb +++ b/app/models/host.rb @@ -124,7 +124,7 @@ class Host < Puppet::Rails::Host end def no_report - last_report.nil? or last_report < Time.now - 33.minutes + last_report.nil? or (last_report < (Time.now - 33.minutes)) end