Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #11158] Crash with empty ScheduledDowntime 'ranges' attribute #3938

Closed
icinga-migration opened this issue Feb 15, 2016 · 11 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented Feb 15, 2016

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11158

Created by nE0sIghT on 2016-02-15 08:40:15 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2016-04-22 09:05:04 +00:00)
Target Version: 2.4.8
Last Update: 2016-05-02 13:26:32 +00:00 (in Redmine)

Icinga Version: 2.4.1
Backport?: Not yet backported
Include in Changelog: 1

With attached configuration my icinga instance failing silently with return code 1.
No information provided in config file nor errors presented in icinga output.

The problem block is in conf.d/services/kscp/interfaces/askro.conf

        vars.downtimes = {
                backup = {
                        comment = "reboot"
                        duration = 10m
                        ranges = {
                                monday = "08:00-08:30"
                        }
                }
        }

With that block commented out icinga starts normally.

My OS environment is Oracle EL 7.

Attachments

  • icinga-bug.tar.xz nE0sIghT - 2016-02-15 08:36:42 +00:00 - affected configuration
  • startup.log.bz2 nE0sIghT - 2016-02-15 08:36:46 +00:00 - icinga2 daemon -x debug output

Changesets

2016-04-22 09:00:21 +00:00 by mfriedrich 7442cd9

Fix crash with empty ScheduledDowntime 'ranges' attribute

fixes #11158

2016-05-12 09:08:20 +00:00 by mfriedrich 418636f

Fix crash with empty ScheduledDowntime 'ranges' attribute

fixes #11158
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 22, 2016

Updated by mfriedrich on 2016-02-22 19:12:25 +00:00

  • Category set to libicinga
  • Status changed from New to Feedback
  • Assigned to set to nE0sIghT

Try using a string as key to the "downtimes" dictionary you are referring to in your downtimes.conf

        vars.downtimes["backup"] = {
                        comment = "reboot" 
                        duration = 10m
                        ranges = {
                                monday = "08:00-08:30" 
                        }
        }

apply ScheduledDowntime for (name => downtime in service.vars.downtimes) to Service {
    author = "author"
    comment = "Резервное копирование"
    fixed = false
    duration = 1h

    vars += downtime
}
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Feb 24, 2016

Updated by nE0sIghT on 2016-02-24 09:37:05 +00:00

dnsmichi wrote:

Try using a string as key to the "downtimes" dictionary you are referring to in your downtimes.conf

No changes

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2016

Updated by mfriedrich on 2016-03-04 16:50:46 +00:00

  • Status changed from Feedback to New

  • Assigned to deleted nE0sIghT

    [2016-02-15 10:34:08 +0300] debug/ScheduledDowntime: Applying scheduled downtime '' to object 'BAL-KSCP-PI1!rdbmspi16' for rule in /etc/icinga2/conf.d/downtimes.conf: 1:0-1:82
    [2016-02-15 10:34:08 +0300] debug/ScheduledDowntime: Applying scheduled downtime '' to object 'BAL-KSCP-PI2!rdbmspi16' for rule in /etc/icinga2/conf.d/downtimes.conf: 1:0-1:82

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2016

Updated by mfriedrich on 2016-03-04 16:50:55 +00:00

  • Parent Id set to 11312
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 18, 2016

Updated by mfriedrich on 2016-03-18 13:09:25 +00:00

  • Status changed from New to Feedback
  • Assigned to set to nE0sIghT

Hm, can you try renaming the key in your apply for loop to something different than 'name'?

apply ScheduledDowntime for (downtime_name => downtime in service.vars.downtimes) to Service {
    author = "author" 
    comment = "Резервное копирование" 
    fixed = false
    duration = 1h

    vars += downtime
}
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 21, 2016

Updated by nE0sIghT on 2016-03-21 08:50:28 +00:00

dnsmichi wrote:

Hm, can you try renaming the key in your apply for loop to something different than 'name'?

[...]

Changed to

apply ScheduledDowntime for (nme => downtime in service.vars.downtimes) to Service {

Same failure

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2016

Updated by mfriedrich on 2016-04-22 08:50:23 +00:00

Ok, found it. "ranges" is not assigned and therefore empty. That crashes inside FindNextSegment().

object Host "11158-host" {
 check_command = "dummy"
}

object Service "11158-service" {
 check_command = "dummy"
 host_name = "11158-host"

 vars.downtimes = {
                backup = {
                        comment = "reboot"
                        duration = 10m
                        ranges = {
                                monday = "08:00-08:30"
                        }
                }
        }
}

apply ScheduledDowntime for (name => downtime in service.vars.downtimes) to Service {
    author = "author"
    comment = "Резервное копирование"
    fixed = false
    duration = 1h

    vars += downtime
}

mbmif /usr/local/icinga2/etc/icinga2/tests (master) # lldb -- /usr/local/icinga2/lib/icinga2/sbin/icinga2 daemon
(lldb) target create "/usr/local/icinga2/lib/icinga2/sbin/icinga2"
Current executable set to '/usr/local/icinga2/lib/icinga2/sbin/icinga2' (x86_64).
(lldb) settings set -- target.run-args  "daemon"
(lldb) r
Process 6648 launched: '/usr/local/icinga2/lib/icinga2/sbin/icinga2' (x86_64)
[2016-04-22 10:44:04 +0200] information/cli: Icinga application loader (version: v2.4.7-370-g46ff7bd; debug)
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/icinga2.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/constants.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/zones.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/itl
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/command.conf
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libmethods.dylib'
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/command-icinga.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/timeperiod.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/command-plugins.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/databases.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/hardware.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/icingacli.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/ipmi.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/network-components.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/operating-system.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/virtualization.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/vmware.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/share/icinga2/include/plugins-contrib.d/web.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/api.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/checker.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/command.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/ido-mysql.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/livestatus.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/mainlog.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/notification.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/perfdata.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/features-enabled/statusdata.conf
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libchecker.dylib'
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libcompat.dylib'
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libdb_ido_mysql.dylib'
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'liblivestatus.dylib'
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libnotification.dylib'
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libperfdata.dylib'
[2016-04-22 10:44:04 +0200] information/Utility: Loading library 'libcompat.dylib'
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/api-users.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/app.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/commands.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/downtimes.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/groups.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/hosts.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/ido.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/notifications.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/satellite.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/services.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/templates.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/test.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/timeperiods.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/users.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/conf.d/symlink/test.conf
[2016-04-22 10:44:04 +0200] information/config: []
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/10225.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/10237.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/10766.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/10807.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/10989.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/11158.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/11353.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/11402.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/11483.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/7282.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/7287.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/8183.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/dep.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/dns.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/downtime.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/env.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/fit.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/flapping.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/forum.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/groups.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/long.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/many.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/mw.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/out.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/passive.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/random.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/regex_lowercase.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/rittal.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/this.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/timeout.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/ug.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/tests/utf8.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/zones.d/global-templates/templates.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/zones.d/global-templates/test/hosts/test.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/etc/icinga2/zones.d/global-templates/test/services/foo.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/include.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/include.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/../active.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/checkcommands/mytest.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/comments/mbmif.int.netways.de!procs!mbmif.int.netways.de-1450175944-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/mbmif.int.netways.de!disk %2F!mbmif.int.netways.de-1458726179-1.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/mbmif.int.netways.de!load!mbmif-1461040806-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/mbmif.int.netways.de!load!mbmif-1461124428-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/mbmif.int.netways.de!load!mbmif-1461217669-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/mbmif.int.netways.de!load!mbmif.int.netways.de-1460970991-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/mbmif.int.netways.de!load!mbmif.local-1461312802-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/myhost!ping4!mbmif.int.netways.de-1458728594-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/myhost!ssh!mbmif.int.netways.de-1458736523-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/myprinter!ping4!mbmif.int.netways.de-1458222803-0.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/hosts/shtest.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/include.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/mbmif.int.netways.de-1449759511-0/include.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/mbmif.int.netways.de-1449759585-0/include.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/mbmif.int.netways.de-1449831656-1/include.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/mbmif.int.netways.de-1449759511-0/../active.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/mbmif.int.netways.de-1449759585-0/../active.conf
[2016-04-22 10:44:04 +0200] information/ConfigCompiler: Compiling config file: /usr/local/icinga2/var/lib/icinga2/api/packages/example-cmdb/mbmif.int.netways.de-1449831656-1/../active.conf
[2016-04-22 10:44:04 +0200] information/ConfigItem: Committing config items
[2016-04-22 10:44:04 +0200] information/ApiListener: My API identity: mbmif.int.netways.de
[2016-04-22 10:44:04 +0200] warning/ApplyRule: Apply rule 'satellite-host' (in /usr/local/icinga2/etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 LivestatusListener.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 StatusDataWriter.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 Endpoint.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 3 Zones.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 3 ApiUsers.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 PerfdataWriter.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 Dependency.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 9 Downtimes.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 62 Services.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 3 ServiceGroups.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 3 TimePeriods.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 15 Users.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 4 UserGroups.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 49 Hosts.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 10 HostGroups.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 4 NotificationCommands.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 87 Notifications.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 160 CheckCommands.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 Comment.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 2 ScheduledDowntimes.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2016-04-22 10:44:04 +0200] information/ScriptGlobal: Dumping variables to file '/usr/local/icinga2/var/cache/icinga2/icinga2.vars'
[2016-04-22 10:44:04 +0200] information/ConfigObject: Restoring program state from file '/usr/local/icinga2/var/lib/icinga2/icinga2.state'
[2016-04-22 10:44:04 +0200] information/ConfigObject: Restored 423 objects. Loaded 4 new objects without state.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Triggering Start signal for config items
[2016-04-22 10:44:04 +0200] information/ApiListener: Copying 3 zone configuration files for zone 'global-templates' to '/usr/local/icinga2/var/lib/icinga2/api/zones/global-templates'.
[2016-04-22 10:44:04 +0200] information/ApiListener: Adding new listener on port '5665'
[2016-04-22 10:44:04 +0200] information/DbConnection: Resuming IDO connection: ido-mysql
[2016-04-22 10:44:04 +0200] information/LivestatusListener: Created UNIX socket in '/usr/local/icinga2/var/run/icinga2/cmd/livestatus'.
[2016-04-22 10:44:04 +0200] information/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: '1.14.0')
Assertion failed: (px != 0), function operator->, file /usr/local/include/boost/smart_ptr/intrusive_ptr.hpp, line 174.
[2016-04-22 10:44:04 +0200] information/ConfigItem: Activated all objects.
Process 6648 stopped
* thread #2: tid = 0x6419f1, 0x00007fff92c64f06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
    frame #0: 0x00007fff92c64f06 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff92c64f06 <+10>: jae    0x7fff92c64f10            ; <+20>
    0x7fff92c64f08 <+12>: movq   %rax, %rdi
    0x7fff92c64f0b <+15>: jmp    0x7fff92c5f7cd            ; cerror_nocancel
    0x7fff92c64f10 <+20>: retq
(lldb) up
frame #1: 0x00007fff9cfcd4ec libsystem_pthread.dylib`pthread_kill + 90
libsystem_pthread.dylib`pthread_kill:
    0x7fff9cfcd4ec <+90>:  cmpl   $-0x1, %eax
    0x7fff9cfcd4ef <+93>:  jne    0x7fff9cfcd4f8            ; <+102>
    0x7fff9cfcd4f1 <+95>:  callq  0x7fff9cfce5fe            ; symbol stub for: __error
    0x7fff9cfcd4f6 <+100>: movl   (%rax), %eax
(lldb)
frame #2: 0x00007fff907716e7 libsystem_c.dylib`abort + 129
libsystem_c.dylib`abort:
    0x7fff907716e7 <+129>: movl   $0x2710, %edi             ; imm = 0x2710
    0x7fff907716ec <+134>: callq  0x7fff90798a76            ; symbol stub for: usleep$NOCANCEL
    0x7fff907716f1 <+139>: callq  0x7fff907716f6            ; __abort

libsystem_c.dylib`__abort:
    0x7fff907716f6 <+0>:   pushq  %rbp
(lldb)
frame #3: 0x00007fff90738df8 libsystem_c.dylib`__assert_rtn + 321
libsystem_c.dylib`basename:
    0x7fff90738df8 <+0>: pushq  %rbp
    0x7fff90738df9 <+1>: movq   %rsp, %rbp
    0x7fff90738dfc <+4>: pushq  %r15
    0x7fff90738dfe <+6>: pushq  %r14
(lldb)
frame #4: 0x000000010380eed9 libicinga.dylib`boost::intrusive_ptr::operator->(this=0x000070000007f6b8) const + 73 at intrusive_ptr.hpp:174
   171
   172      T * operator->() const
   173      {
-> 174          BOOST_ASSERT( px != 0 );
   175          return px;
   176      }
   177
(lldb)
frame #5: 0x000000010397429d libicinga.dylib`icinga::range_begin(x=) + 13 at dictionary.hpp:130
   127
   128  inline Dictionary::Iterator range_begin(Dictionary::Ptr x)
   129  {
-> 130      return x->Begin();
   131  }
   132
   133  inline Dictionary::Iterator range_end(Dictionary::Ptr x)
(lldb)
frame #6: 0x000000010398274d libicinga.dylib`boost::range_iterator, void>::type boost::range_adl_barrier::begin >(r=0x000070000007fca8) + 45 at begin.hpp:102
   99   #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
   100      using namespace range_detail;
   101  #endif
-> 102      return range_begin( r );
   103  }
   104
   105  template< class T >
(lldb)
frame #7: 0x0000000103971845 libicinga.dylib`boost::foreach_detail_::auto_any, mpl_::bool_ >::type> boost::foreach_detail_::begin, mpl_::bool_ >(col=0x000070000007fc58, (null)=0x0000000000000000, (null)=0x0000000000000000) + 37 at foreach.hpp:673
   670      typedef BOOST_DEDUCED_TYPENAME type2type::type type;
   671      typedef BOOST_DEDUCED_TYPENAME foreach_iterator::type iterator;
   672      return auto_any::type>(
-> 673          iterator(boost::begin(BOOST_FOREACH_DEREFOF((auto_any_cast(col))))));
   674  }
   675
   676  #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
(lldb)
frame #8: 0x0000000103b283a7 libicinga.dylib`icinga::ScheduledDowntime::FindNextSegment(this=0x000000010462f870) + 775 at scheduleddowntime.cpp:141
   138      double now = Utility::GetTime();
   139
   140      ObjectLock olock(ranges);
-> 141      BOOST_FOREACH(const Dictionary::Pair& kv, ranges) {
   142          Log(LogDebug, "ScheduledDowntime")
   143              << "Evaluating segment: " << kv.first << ": " << kv.second << " at ";
   144
(lldb) p ranges
(Ptr) $0 = {
  px = 0x0000000000000000
}
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2016

Updated by mfriedrich on 2016-04-22 08:56:34 +00:00

The thing is, the configuration is wrong. Setting the ScheduledDowntime ranges must happen differently. I've added an advanced example checking for the variables being set and with their proper type.

object Host "11158-host" {
 check_command = "dummy"
}

object Service "11158-service" {
 check_command = "dummy"
 host_name = "11158-host"

 vars.downtimes = {
                backup = {
                        comment = "reboot"
                        duration = 10m
                        ranges = {
                                monday = "08:00-08:30"
                        }
                }
        }
}

apply ScheduledDowntime for (name => downtime in service.vars.downtimes) to Service {
    author = "author"
    comment = "Резервное копирование"
    fixed = false
    duration = 1h

    //vars += downtime //doesn't do anything, scheduleddowntimes do nothing with custom attributes

    if (typeof(downtime.ranges) == Dictionary) {
      ranges = downtime.ranges
    }

    if (downtime.duration) {
      duration = downtime.duration
    }

    if (downtime.comment) {
      comment = downtime.comment
    }
}

This generates the following downtime object:

# cat '/usr/local/icinga2/var/lib/icinga2/api/packages/_api/mbmif.int.netways.de-1442309540-1/conf.d/downtimes/11158-host!11158-service!mbmif.local-1461315245-0.conf'
object Downtime "mbmif.local-1461315245-0" ignore_on_error {
    author = "author"
    comment = "reboot"
    config_owner = "11158-host!11158-service!backup"
    duration = 600.000000
    end_time = 1461565800.000000
    fixed = false
    host_name = "11158-host"
    scheduled_by = "11158-host!11158-service!backup"
    service_name = "11158-service"
    start_time = 1461564000.000000
    triggered_by = ""
    version = 1461315245.491726
}

I'll fix the crash though.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2016

Updated by mfriedrich on 2016-04-22 09:01:08 +00:00

  • Subject changed from Icinga 2 silently fails with specific ScheduledDowntime configuration to Crash with empty ScheduledDowntime 'ranges' attribute
  • Status changed from Feedback to Assigned
  • Assigned to changed from nE0sIghT to mfriedrich
  • Target Version set to 2.4.8
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 22, 2016

Updated by mfriedrich on 2016-04-22 09:05:04 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 7442cd9.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented May 2, 2016

Updated by mfriedrich on 2016-05-02 13:26:33 +00:00

  • Parent Id deleted 11312

@icinga-migration icinga-migration added this to the 2.4.8 milestone Jan 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.