Closed MarkYSA closed 5 years ago
Hi
I seem to have the exact same Issue with my installation, updated icinga2 to 2.11 and now the dashing can't be started. Interestingly it starts on my system when I manually start it in foreground with environment variables.
ICINGA2_API_HOST=localhost ICINGA2_API_PORT=5665 ICINGA2_API_USERNAME=dashing ICINGA2_API_PASSWORD=**** dashing start
/usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/thin/server.rb:107: warning: constant ::Fixnum is deprecated /usr/local/lib/ruby/gems/2.6.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:368: warning: constant ::Fixnum is deprecated First trying to read environment variables Environment variables not found, falling back to configuration file config/icinga2.json Detecting local config file '/usr/share/dashing-icinga2/config/icinga2.local.json'. Using config file '/usr/share/dashing-icinga2/config/icinga2.local.json'. bundler: failed to load command: thin (/usr/local/bin/thin) NoMethodError: undefined method
[]' for nil:NilClass
/usr/share/dashing-icinga2/lib/icinga2.rb:159:in getConfFile' /usr/share/dashing-icinga2/lib/icinga2.rb:89:in
rescue in initialize'
/usr/share/dashing-icinga2/lib/icinga2.rb:84:in initialize' /usr/share/dashing-icinga2/jobs/icinga2.rb:23:in
new'
/usr/share/dashing-icinga2/jobs/icinga2.rb:23:in <top (required)>' /usr/local/lib/ruby/gems/2.6.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in
require'
/usr/local/lib/ruby/gems/2.6.0/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in require_with_backports' /usr/local/lib/ruby/gems/2.6.0/gems/dashing-1.3.7/lib/dashing/app.rb:171:in
block in require_glob'
/usr/local/lib/ruby/gems/2.6.0/gems/dashing-1.3.7/lib/dashing/app.rb:170:in each' /usr/local/lib/ruby/gems/2.6.0/gems/dashing-1.3.7/lib/dashing/app.rb:170:in
require_glob'
/usr/local/lib/ruby/gems/2.6.0/gems/dashing-1.3.7/lib/dashing/app.rb:181:in <top (required)>' /usr/local/lib/ruby/gems/2.6.0/gems/dashing-1.3.7/lib/dashing.rb:3:in
require'
/usr/local/lib/ruby/gems/2.6.0/gems/dashing-1.3.7/lib/dashing.rb:3:in <top (required)>' config.ru:1:in
require'
config.ru:1:in block in <main>' /usr/local/lib/ruby/gems/2.6.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in
instance_eval'
/usr/local/lib/ruby/gems/2.6.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in initialize' config.ru:1:in
new'
config.ru:1:in <main>' /usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in
eval'
/usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in load' /usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:182:in
load_rackup_config'
/usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:72:in start' /usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/thin/runner.rb:200:in
run_command'
/usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/lib/thin/runner.rb:156:in run!' /usr/local/lib/ruby/gems/2.6.0/gems/thin-1.6.4/bin/thin:6:in
<top (required)>'
/usr/local/bin/thin:23:in load' /usr/local/bin/thin:23:in
<top (required)>'`
Seems the version regex returns a null/nil value whereas the call the first/last then fails - from #81. Can you query the REST API manually and extract the /v1/status/IcingaApplication
endpoint and post it here?
curl -k -s -u root:icinga 'https://localhost:5665/v1/status/IcingaApplication?pretty=1'
Thank you for the fast reply!
Output here:
{ "results": [ { "name": "IcingaApplication", "perfdata": [], "status": { "icingaapplication": { "app": { "enable_event_handlers": true, "enable_flapping": true, "enable_host_checks": true, "enable_notifications": true, "enable_perfdata": true, "enable_service_checks": true, "environment": "", "node_name": "hidden", "pid": 28711.0, "program_start": 1570621608.853022, "version": "2.11.0-1" } } } } ] }
Hmm, looks sane and in my tests, this version works as well. Can you both please share the content of the config/
directory? Please replace sensitive credentials.
I see, I made a programming mistake. I haven't coded Ruby for like a year now. The config reading is wrong with the new hard state option and old or local configs. Quickfix for you - add the new 'dashboard' option from the pull configuration file into the local modified version.
Hi.
In log I see the following:
scheduler caught exception: undefined method
first' for nil:NilClass /usr/share/dashing-icinga2/lib/icinga2.rb:603:in
fetchVersion' /usr/share/dashing-icinga2/lib/icinga2.rb:665:inrun' /usr/share/dashing-icinga2/jobs/icinga2.rb:27:in
block in <top (required)>' /usr/local/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:incall' /usr/local/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in
trigger_block' /usr/local/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:204:inblock in trigger' /usr/local/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in
call' /usr/local/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in `block in trigger_job'Your Environment
git diff
): NO