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 #12556] Config validation shouldnt allow 'endpoints = [ "" ]' #4572

Closed
icinga-migration opened this issue Aug 26, 2016 · 6 comments
Labels
area/configuration DSL, parser, compiler, error handling bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

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

Created by p0nts on 2016-08-26 07:39:51 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-08-26 08:38:20 +00:00)
Target Version: 2.6.0
Last Update: 2016-08-30 11:51:27 +00:00 (in Redmine)

Icinga Version: 2.5.3
Include in Changelog: 1

Debugged this with shroud over IRC this morning.

09:30 [ p0nts] so to minimalise the ticket, config validation shouldnt validate endpoints [ "" ]
09:30 [ shroud] p0nts: that is correct
09:31 [ shroud] p0nts: this will most likely also fail in other cases, where you specify objects names in an array - for example for groups

root@asa006:/home/stefan# /etc/init.d/icinga2 checkconfig
[....] checking Icinga2 configuration
Segmentation fault
[FAIL] checking Icinga2 configuration. Check '/var/log/icinga2/startup.log' for details. ... failed!

root@asa006:/home/stefan# cat /var/log/icinga2/startup.log
Segmentation fault

# Managed by Puppet

include "constants.conf"
include 
include 

object FileLogger "main-log" {
  severity = "information"
  path = LocalStateDir + "/log/icinga2/icinga2.log"
}

object Endpoint "asa006.intern" {
  host = "asa006.intern"
  port = 5665
  log_duration = 0s
}




object Zone "ha-cluster" {
  endpoints = [ "" ]
}

object Zone "asa006.intern" {
  parent = "ha-cluster"
  endpoints = [ "asa006.intern" ]
}

object Zone "global-templates" {
  global = true
}

object ApiListener "api" {
  cert_path = SysconfDir + "/icinga2/pki/asa006.intern.crt"
  key_path = SysconfDir + "/icinga2/pki/asa006.intern.key"
  ca_path = SysconfDir + "/icinga2/pki/ca.crt"
  accept_commands = true
  accept_config = true
}

Changesets

2016-08-26 08:36:53 +00:00 by gbeutner dac0ff9

Improve config validation for arrays of object names

fixes #12556

2016-08-29 10:20:50 +00:00 by gbeutner 4d4364d

Improve config validation for arrays of object names

fixes #12556
@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-08-26 08:37:59 +00:00

  • Subject changed from config validation shouldnt validate 'endpoints [ "" ]' to Config validation shouldnt allow 'endpoints = [ "" ]'
  • Category set to Configuration
  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 2.6.0
  • Icinga Version changed from version: r2.5.3 to 2

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-08-26 08:38:20 +00:00

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

Applied in changeset dac0ff9.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-08-26 08:39:53 +00:00

acheron:~ gunnar$ icinga2a daemon -C
information/cli: Icinga application loader (version: v2.5.3-30-g4f46e59; debug)
information/cli: Loading configuration file(s).
information/ConfigItem: Committing config item(s).
information/ApiListener: My API identity: i2a.acheron.beutner.name
critical/config: Error: Validation failed for object 'x' of type 'Host'; Attribute 'groups': Object '' of type 'HostGroup' does not exist.
Location: in /Users/gunnar/i2/etc-a/icinga2/conf.d/test.conf: 4:3-4:17
/Users/gunnar/i2/etc-a/icinga2/conf.d/test.conf(2):   import "generic-host"
/Users/gunnar/i2/etc-a/icinga2/conf.d/test.conf(3):
/Users/gunnar/i2/etc-a/icinga2/conf.d/test.conf(4):   groups = [ "" ]
                                                      ^^^^^^^^^^^^^^^
/Users/gunnar/i2/etc-a/icinga2/conf.d/test.conf(5): }
/Users/gunnar/i2/etc-a/icinga2/conf.d/test.conf(6):

critical/config: 1 error
acheron:~ gunnar$

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-08-29 10:18:44 +00:00

  • Target Version changed from 2.6.0 to 2.5.4

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-08-29 10:23:15 +00:00

  • Backport? changed from Not yet backported to Already backported

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-30 11:51:28 +00:00

  • Target Version changed from 2.5.4 to 2.6.0
  • Backport? changed from Already backported to __

@icinga-migration icinga-migration added bug Something isn't working area/configuration DSL, parser, compiler, error handling labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.6.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant