Foreman Monitoring plugin fails to start - Error: no implicit conversion of String into Hash

Problem:

I have installed the Foreman Monitoring Plugin and Foreman Proxy Monitoring Plugin but the Smart-Proxy is not able to load the module and shuts it down with the error:

Disabling all modules in the group ['monitoring'] due to a failure in one of them: no implicit conversion of String into Hash

Expected outcome:

Module Starts and can speak to Icinga2

Foreman and Proxy versions:

3.11.1

Foreman and Proxy plugin versions:

Plugin is version 0.3.0? Installed via the foreman-installer

Distribution and version:

RHEL 8.10
Kernel 4.18.0-553.16.1.el8_10.x86_64

Other relevant data:

Proxy Logs:
proxy.log (584.5 KB)

monitoring_icinga2.yml

# Collect Monitoring information via Icinga 2 API
:enabled: true

# The FQDN or IP address of the Icinga 2 server (if using IP address also set verify_ssl to false)
:server: 10.0.1.178
# The CA certificate used by Icinga 2 (typically located on the server at /etc/icinga2/pki/ca.crt)
:api_cacert: /etc/foreman-proxy/monitoring/ca.crt
# The port of Icinga 2 API (default is 5665)
:api_port: 5665
# The name of API User
:api_user: foreman
# The certificate issued on the client_cn attribute of the API User and the corresponding key
#:api_usercert: /etc/foreman-proxy/monitoring/foreman.crt
#:api_userkey: /etc/foreman-proxy/monitoring/foreman.key
# The password from the password attribute of the API User (if not using certificates)
:api_password: foreman
# SSL Verfification mode (boolean value)
:verify_ssl: false

Error Message:

Disabling all modules in the group [‘monitoring’] due to a failure in one of them: no implicit conversion of String into Hash

Backtrace

no implicit conversion of String into Hash: /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:273:in merge' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:273:in load_settings’ /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:263:in load_plugin_settings' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:80:in load_plugin_settings’ /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:167:in each' /usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:167:in initialize_plugins’ /usr/share/foreman-proxy/lib/launcher.rb:129:in launch' /usr/share/foreman-proxy/bin/smart-proxy:6:in ’

I’m still having this issue. Configured the Proxy per the documentation but when I go to restart the foreman-proxy daemon It fails to start. Seeing this error in the proxy.log

2024-09-05T20:09:35  [I] Starting Task: Initial Services Import.
2024-09-05T20:09:35  [E] Error during startup, terminating
2024-09-05T20:09:35  [W] Error details for Error during startup, terminating: <RuntimeError>: can't add a new key into hash during iteration
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb:85:in `block in symbolize_keys_deep!'
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb:83:in `each_key'
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb:83:in `symbolize_keys_deep!'
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb:23:in `block in upload'
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/monitoring_icinga2_common.rb:18:in `with_event_counter'
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb:22:in `upload'
/usr/share/gems/gems/smart_proxy_monitoring-0.3.0/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb:71:in `block in do_start'
/usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'

What am I missing?

Here is my settings file

# Collect Monitoring information via Icinga 2 API
:enabled: true

# The FQDN or IP address of the Icinga 2 server (if using IP address also set verify_ssl to false)
:server: 10.0.1.178
# The CA certificate used by Icinga 2 (typically located on the server at /etc/icinga2/pki/ca.crt)
:api_cacert: /etc/foreman-proxy/monitoring/ca.crt
# The port of Icinga 2 API (default is 5665)
:api_port: 5665
# The name of API User
:api_user: foreman
# The certificate issued on the client_cn attribute of the API User and the corresponding key
#:api_usercert: /etc/foreman-proxy/monitoring/foreman.crt
#:api_userkey: /etc/foreman-proxy/monitoring/foreman.key
# The password from the password attribute of the API User (if not using certificates)
:api_password: boogerbutt
# SSL Verfification mode (boolean value)
:verify_ssl: false

As usual a google search led me to the solution. :slight_smile: