/api/hosts generates an error

Problem:
When trying to invoke GET /api/hosts I get the following error

error
message undefined method `failure’ for #ConfigReport:0x000000001024dd48\nDid you mean? failed

Expected outcome:
API returns a list of Hosts
Foreman and Proxy versions:
3.3.0
Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

can you post the contents of /var/log/foreman/production.log from the time you hit /api/hosts?

2022-08-16T05:22:06 [I|app|1a568453] Parameters: {"apiv"=>"v2"}
2022-08-16T05:22:06 [I|app|1a568453] Rendering api/v2/home/index.json.rabl
2022-08-16T05:22:06 [I|app|1a568453] Rendered api/v2/home/index.json.rabl (Duration: 200.5ms | Allocations: 184954)
2022-08-16T05:22:06 [I|app|1a568453] Completed 200 OK in 210ms (Views: 201.1ms | ActiveRecord: 1.6ms | Allocations: 187974)
2022-08-16T05:22:25 [I|app|ad7a6091] Started GET "/api/hosts" for 10.0.20.110 at 2022-08-16 05:22:25 -0400
2022-08-16T05:22:25 [I|app|ad7a6091] Processing by Api::V2::HostsController#index as JSON
2022-08-16T05:22:25 [I|app|ad7a6091] Parameters: {"apiv"=>"v2"}
2022-08-16T05:22:25 [I|app|ad7a6091] Rendering api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout
2022-08-16T05:22:25 [I|app|ad7a6091] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (Duration: 19.0ms | Allocations: 10464)
2022-08-16T05:22:25 [W|app|ad7a6091] Action failed
2022-08-16T05:22:25 [I|app|ad7a6091] Backtrace for 'Action failed' error (ActionView::Template::Error): undefined method `failure' for #<ConfigReport:0x0000000010417908>
ad7a6091 | Did you mean? failed
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/attribute_methods.rb:432:in `method_missing'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_host_reports-1.0.2/app/models/host_status/host_report_status.rb:24:in `failure'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_host_reports-1.0.2/app/models/host_status/host_report_status.rb:36:in `failure?'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_host_reports-1.0.2/app/models/host_status/host_report_status.rb:109:in `to_global'
ad7a6091 | /usr/share/foreman/app/models/host_status/global.rb:20:in `block in build'
ad7a6091 | /usr/share/foreman/app/models/host_status/global.rb:20:in `map'
ad7a6091 | /usr/share/foreman/app/models/host_status/global.rb:20:in `build'
ad7a6091 | /usr/share/foreman/app/models/host/managed.rb:793:in `global_status_label'
ad7a6091 | /usr/share/foreman/app/views/api/v2/hosts/main.json.rabl:8:in `cached_source_1556310306167566582'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:429:in `eval_source'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:37:in `apply'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/helpers.rb:136:in `object_to_engine'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/partials.rb:15:in `partial_as_engine'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:201:in `extends'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:116:in `block in compile_settings'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `each'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `compile_settings'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:35:in `engines'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/multi_builder.rb:45:in `block in map_engines_to_builders'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/multi_builder.rb:44:in `each'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/multi_builder.rb:44:in `map_engines_to_builders'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/multi_builder.rb:22:in `to_a'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:92:in `to_hash'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:103:in `to_dumpable'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:112:in `to_json'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:50:in `block in render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:385:in `cache_results'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:49:in `render'
ad7a6091 | /usr/share/foreman/config/initializers/rabl_init.rb:49:in `render'
ad7a6091 | /usr/share/foreman/app/views/api/v2/hosts/index.json.rabl:3:in `_293e1da0d7c634ba60728150bfc33776'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/base.rb:274:in `_run'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/template.rb:185:in `block in render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications.rb:182:in `instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/template.rb:385:in `instrument_render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/template.rb:183:in `render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/deface-1.5.3/lib/deface/action_view_extensions.rb:43:in `render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/template_renderer.rb:58:in `block (2 levels) in render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/abstract_renderer.rb:88:in `block in instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications.rb:180:in `block in instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications.rb:180:in `instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/abstract_renderer.rb:87:in `instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/template_renderer.rb:57:in `block in render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/template_renderer.rb:65:in `render_with_layout'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/template_renderer.rb:56:in `render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/template_renderer.rb:13:in `render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/renderer.rb:61:in `render_template_to_object'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/renderer/renderer.rb:29:in `render_to_object'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/rendering.rb:117:in `block in _render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/base.rb:304:in `in_rendering_context'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/rendering.rb:116:in `_render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/streaming.rb:218:in `_render_template'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/rendering.rb:103:in `render_to_body'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/rendering.rb:52:in `render_to_body'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/renderers.rb:142:in `render_to_body'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/abstract_controller/rendering.rb:25:in `render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/rendering.rb:36:in `render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/core_ext/benchmark.rb:14:in `block in ms'
ad7a6091 | /opt/rh/rh-ruby27/root/usr/share/ruby/benchmark.rb:308:in `realtime'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/core_ext/benchmark.rb:14:in `ms'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/instrumentation.rb:44:in `block in render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/instrumentation.rb:43:in `render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/implicit_render.rb:35:in `default_render'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/abstract_controller/base.rb:195:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/rendering.rb:30:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
ad7a6091 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
ad7a6091 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
ad7a6091 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/sweeper.rb:14:in `around'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:139:in `run_callbacks'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/abstract_controller/callbacks.rb:41:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/rescue.rb:22:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications.rb:180:in `block in instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/notifications.rb:180:in `instrument'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/abstract_controller/base.rb:136:in `process'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionview-6.0.4.7/lib/action_view/rendering.rb:39:in `process'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal.rb:190:in `dispatch'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_controller/metal.rb:254:in `dispatch'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/routing/route_set.rb:33:in `serve'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/routing/mapper.rb:18:in `block in <class:Constraints>'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/routing/mapper.rb:48:in `serve'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/journey/router.rb:49:in `block in serve'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/journey/router.rb:32:in `each'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/journey/router.rb:32:in `serve'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/routing/route_set.rb:834:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-dsl-2.4.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/static_dispatcher.rb:66:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/extractor/recorder.rb:137:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
ad7a6091 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.17/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/tempfile_reaper.rb:15:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/etag.rb:27:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/conditional_get.rb:27:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
ad7a6091 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:266:in `context'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/session/abstract/id.rb:260:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/cookies.rb:654:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:101:in `run_callbacks'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.4.7/lib/rails/rack/logger.rb:37:in `call_app'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.4.7/lib/rails/rack/logger.rb:28:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
ad7a6091 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/request_id.rb:27:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/method_override.rb:24:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/runtime.rb:22:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/executor.rb:14:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/static.rb:126:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/sendfile.rb:110:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/ssl.rb:74:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.4.7/lib/action_dispatch/middleware/host_authorization.rb:97:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-6.3.0/lib/secure_headers/middleware.rb:11:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.4.7/lib/rails/engine.rb:527:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.4.7/lib/rails/railtie.rb:190:in `public_send'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/railties-6.0.4.7/lib/rails/railtie.rb:190:in `method_missing'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.6.2/lib/puma/configuration.rb:252:in `call'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.6.2/lib/puma/request.rb:77:in `block in handle_request'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.6.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.6.2/lib/puma/request.rb:76:in `handle_request'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.6.2/lib/puma/server.rb:441:in `process_client'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/puma-5.6.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
ad7a6091 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2022-08-16T05:22:25 [I|app|ad7a6091] Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2022-08-16T05:22:25 [I|app|ad7a6091] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 4.9ms | Allocations: 5996)
2022-08-16T05:22:25 [I|app|ad7a6091] Completed 500 Internal Server Error in 115ms (Views: 9.4ms | ActiveRecord: 22.2ms | Allocations: 48833)
2022-08-16T05:23:28 [I|app|a4324e74] Started POST "/api/hosts/facts" for 127.0.0.1 at 2022-08-16 05:23:28 -0400
2022-08-16T05:23:28 [I|app|a4324e74] Processing by Api::V2::HostsController#facts as JSON
2022-08-16T05:23:28 [I|app|a4324e74] Parameters: {"facts"=>"[FILTERED]", "name"=>"web01.poling.local", "certname"=>"web01.poling.local", "apiv"=>"v2", "host"=>{"certname"=>"web01.poling.local", "name"=>"web01.poling.local"}}
2022-08-16T05:23:28 [I|app|a4324e74] Import facts for 'web01.poling.local' completed. Added: 0, Updated: 4, Deleted 0 facts
2022-08-16T05:23:28 [I|app|a4324e74] Completed 201 Created in 199ms (Views: 11.1ms | ActiveRecord: 72.7ms | Allocations: 44944)
2022-08-16T05:23:28 [I|app|85784b8f] Started GET "/node/web01.poling.local?format=yml" for 127.0.0.1 at 2022-08-16 05:23:28 -0400
2022-08-16T05:23:28 [I|app|85784b8f] Processing by HostsController#externalNodes as YML
2022-08-16T05:23:28 [I|app|85784b8f] Parameters: {"name"=>"web01.poling.local"}
2022-08-16T05:23:28 [I|app|85784b8f] Rendering text template
2022-08-16T05:23:28 [I|app|85784b8f] Rendered text template (Duration: 0.0ms | Allocations: 1)
2022-08-16T05:23:28 [I|app|85784b8f] Completed 200 OK in 95ms (Views: 0.5ms | ActiveRecord: 28.9ms | Allocations: 23893)
2022-08-16T05:23:29 [I|app|0ef4f88c] Started POST "/api/config_reports" for 127.0.0.1 at 2022-08-16 05:23:29 -0400
2022-08-16T05:23:29 [I|app|0ef4f88c] Processing by Api::V2::ConfigReportsController#create as JSON
2022-08-16T05:23:29 [I|app|0ef4f88c] Parameters: {"config_report"=>"[FILTERED]", "apiv"=>"v2"}
2022-08-16T05:23:29 [I|app|0ef4f88c] Scanning report with: Foreman::PuppetReportScanner, ForemanAnsible::AnsibleReportScanner
2022-08-16T05:23:29 [I|app|0ef4f88c] Imported report for web01.poling.local in 71.1 ms, status refreshed in 24.2 ms
2022-08-16T05:23:29 [I|app|0ef4f88c] Rendering api/v2/config_reports/create.json.rabl
2022-08-16T05:23:29 [I|app|0ef4f88c] Rendered api/v2/config_reports/create.json.rabl (Duration: 7.1ms | Allocations: 6877)
2022-08-16T05:23:29 [I|app|0ef4f88c] Completed 201 Created in 128ms (Views: 8.7ms | ActiveRecord: 78.3ms | Allocations: 22448)

production.log (23.9 KB)

Ah, it comes from foreman_host_reports.

Can you try applying the patch from https://github.com/theforeman/foreman_host_reports/pull/33 to your system?

Long-term I recommend to uninstall the plugin completely. We stopped development of this one, you can keep using Foreman core reporting capabilities. Here is how you do it:

After you remove it, you should not see any problems.

1 Like

I tried the patch, but it did not help. So I decided to just get rid of the Hosts Reports plugin - they are not used anyway. Went through the steps - but I get a failure on running.

foreman-installer --no-enable-foreman-plugin-host-reports --no-enable-foreman-proxy-plugin-reports

I get the same 500 Internal Server Error that I have been seeing.

2022-08-16 11:25:05 [DEBUG ] [configure] Foreman_proxy::Settings_file[remote_execution_ssh]: Starting to evaluate the resource (1603 of 1636)
2022-08-16 11:25:05 [DEBUG ] [configure] Foreman_proxy::Settings_file[remote_execution_ssh]: Evaluated in 0.00 seconds
2022-08-16 11:25:05 [DEBUG ] [configure] Class[Foreman_proxy::Service]: Starting to evaluate the resource (1604 of 1636)
2022-08-16 11:25:05 [DEBUG ] [configure] Class[Foreman_proxy::Service]: Evaluated in 0.00 seconds
2022-08-16 11:25:05 [DEBUG ] [configure] /Service[foreman-proxy]: Starting to evaluate the resource (1605 of 1636)
2022-08-16 11:25:05 [DEBUG ] [configure] Executing: '/bin/systemctl is-active -- foreman-proxy'
2022-08-16 11:25:05 [DEBUG ] [configure] Executing: '/bin/systemctl is-enabled -- foreman-proxy'
2022-08-16 11:25:05 [DEBUG ] [configure] /Service[foreman-proxy]: Evaluated in 0.02 seconds
2022-08-16 11:25:05 [DEBUG ] [configure] Class[Foreman_proxy::Service]: Starting to evaluate the resource (1606 of 1636)
2022-08-16 11:25:05 [DEBUG ] [configure] Class[Foreman_proxy::Service]: Evaluated in 0.00 seconds
2022-08-16 11:25:05 [DEBUG ] [configure] Class[Foreman_proxy::Register]: Starting to evaluate the resource (1607 of 1636)
2022-08-16 11:25:05 [DEBUG ] [configure] Class[Foreman_proxy::Register]: Evaluated in 0.00 seconds
2022-08-16 11:25:05 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-foreman01.poling.local]: Starting to evaluate the resource (1608 of 1636)
2022-08-16 11:25:05 [DEBUG ] [configure] Foreman_host[foreman-proxy-foreman01.poling.local](provider=rest_v3): Making get request to https://foreman01.poling.local/api/v2/hosts?search=name%3D%22foreman01.poling.local%22
2022-08-16 11:25:07 [DEBUG ] [configure] Foreman_host[foreman-proxy-foreman01.poling.local](provider=rest_v3): Received response 500 from request to https://foreman01.poling.local/api/v2/hosts?search=name%3D%22foreman01.poling.local%22
2022-08-16 11:25:07 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-foreman01.poling.local]: Could not evaluate: Error making GET request to Foreman at https://foreman01.poling.local/api/v2/hosts: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on foreman01.poling.local for detailed information
2022-08-16 11:25:07 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_host[foreman-proxy-foreman01.poling.local]: Evaluated in 2.28 seconds
2022-08-16 11:25:07 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Datacat_collector[foreman_proxy::enabled_features]: Starting to evaluate the resource (1609 of 1636)
2022-08-16 11:25:07 [DEBUG ] [configure] Datacat_collector[foreman_proxy::enabled_features](provider=datacat_collector): Collected {"features"=>["Discovery", "BMC", "DHCP", "Puppet", "Puppet CA", "Realm", "TFTP", "Logs", "Dynflow", "Ansible", "Openscap", "Script"]}
2022-08-16 11:25:07 [DEBUG ] [configure] Datacat_collector[foreman_proxy::enabled_features](provider=datacat_collector): Selecting source_key features
2022-08-16 11:25:07 [DEBUG ] [configure] Datacat_collector[foreman_proxy::enabled_features](provider=datacat_collector): Now setting field :features
2022-08-16 11:25:07 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Datacat_collector[foreman_proxy::enabled_features]: Evaluated in 0.00 seconds
2022-08-16 11:25:07 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[foreman01.poling.local]: Starting to evaluate the resource (1610 of 1636)
2022-08-16 11:25:07 [DEBUG ] [configure] Foreman_smartproxy[foreman01.poling.local](provider=rest_v3): Making get request to https://foreman01.poling.local/api/v2/smart_proxies?search=name%3D%22foreman01.poling.local%22
2022-08-16 11:25:09 [DEBUG ] [configure] Foreman_smartproxy[foreman01.poling.local](provider=rest_v3): Received response 200 from request to https://foreman01.poling.local/api/v2/smart_proxies?search=name%3D%22foreman01.poling.local%22
2022-08-16 11:25:09 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[foreman01.poling.local]: Evaluated in 2.19 seconds
2022-08-16 11:25:09 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-foreman01.poling.local]: Starting to evaluate the resource (1611 of 1636)
2022-08-16 11:25:09 [INFO  ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-foreman01.poling.local]: Dependency Foreman_host[foreman-proxy-foreman01.poling.local] has failures: true
2022-08-16 11:25:09 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-foreman01.poling.local]: Skipping because of failed dependencies
2022-08-16 11:25:09 [DEBUG ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy_host[foreman-proxy-foreman01.poling.local]: Resource is being skipped, unscheduling all events

Based on this message:

2022-08-16 11:25:07 [DEBUG ] [configure] Foreman_host[foreman-proxy-foreman01.poling.local](provider=rest_v3): Received response 500 from request to https://foreman01.poling.local/api/v2/hosts?search=name%3D%22foreman01.poling.local%22

I am assuming this is all related as I still get an error on GET /api/hosts of:

"undefined method `failure' for #<ConfigReport:0x00000000090dbb88>\nDid you mean?  failed"

Looking at the /foreman/production.log I see the same errors as before.

2022-08-16T13:07:09 [I|app|43833443] Completed 200 OK in 35ms (Views: 8.4ms | ActiveRecord: 12.1ms | Allocations: 8474)
2022-08-16T13:07:09 [I|app|60dad880]   Rendered dashboard/_status_chart_widget.html.erb (Duration: 57.1ms | Allocations: 17536)
2022-08-16T13:07:09 [I|app|60dad880] Completed 200 OK in 120ms (Views: 33.5ms | ActiveRecord: 71.5ms | Allocations: 37097)
2022-08-16T13:07:09 [I|app|7cd6c128]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-6.0.2/app/views/foreman_tasks/tasks/dashboard/_latest_tasks_in_error_warning.html.erb (Duration: 29.7ms | Allocations: 17616)
2022-08-16T13:07:09 [I|app|7cd6c128] Completed 200 OK in 51ms (Views: 31.9ms | ActiveRecord: 5.5ms | Allocations: 24463)
2022-08-16T13:07:18 [I|app|d2fb9f4b] Started GET "/api/hosts" for 10.0.20.110 at 2022-08-16 13:07:18 -0400
2022-08-16T13:07:18 [I|app|d2fb9f4b] Processing by Api::V2::HostsController#index as JSON
2022-08-16T13:07:18 [I|app|d2fb9f4b]   Parameters: {"apiv"=>"v2"}
2022-08-16T13:07:18 [I|app|d2fb9f4b]   Rendering api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout
2022-08-16T13:07:18 [I|app|d2fb9f4b]   Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (Duration: 32.1ms | Allocations: 4851)
2022-08-16T13:07:18 [W|app|d2fb9f4b] Action failed
2022-08-16T13:07:18 [I|app|d2fb9f4b] Backtrace for 'Action failed' error (ActionView::Template::Error): undefined method `failure' for #<ConfigReport:0x00000000090dbb88>
 d2fb9f4b | Did you mean?  failed
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/attribute_methods.rb:432:in `method_missing'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_host_reports-1.0.2/app/models/host_status/host_report_status.rb:24:in `failure'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_host_reports-1.0.2/app/models/host_status/host_report_status.rb:36:in `failure?'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_host_reports-1.0.2/app/models/host_status/host_report_status.rb:109:in `to_global'
 d2fb9f4b | /usr/share/foreman/app/models/host_status/global.rb:20:in `block in build'
 d2fb9f4b | /usr/share/foreman/app/models/host_status/global.rb:20:in `map'
 d2fb9f4b | /usr/share/foreman/app/models/host_status/global.rb:20:in `build'
 d2fb9f4b | /usr/share/foreman/app/models/host/managed.rb:793:in `global_status_label'
 d2fb9f4b | /usr/share/foreman/app/views/api/v2/hosts/main.json.rabl:8:in `cached_source_3423863680930699800'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:429:in `eval_source'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/engine.rb:37:in `apply'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/helpers.rb:136:in `object_to_engine'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/partials.rb:15:in `partial_as_engine'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:201:in `extends'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:116:in `block in compile_settings'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `each'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:115:in `compile_settings'
 d2fb9f4b | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.14.3/lib/rabl/builder.rb:35:in `engines'

I ran

yum remove tfm-rubygem-foreman_host_reports

in an attempt to get rid of the host reports - but have a feeling that i am missing something in the clean ip process. Is there another process I should use to clear out all remnants of this plugin?

I meant clean up process - not clean ip process :grin:

Just follow the link, it describes to perform some database down migrations and then refreshing statuses. That is really all you need to do. You also need to uninstall smart proxy plugins, that is the installer command, but you can do it manually using yum too.

Ok - My bad - I missed a key step as I went through this. Restart Services. The steps in that link and a reboot fixed my issue - Thank you for the support on this. Very much appreciated.