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

Hostgroup using assign for Host with groups = null segfault #5288

Closed
robrankin opened this issue May 25, 2017 · 5 comments
Closed

Hostgroup using assign for Host with groups = null segfault #5288

robrankin opened this issue May 25, 2017 · 5 comments
Assignees
Labels
area/configuration DSL, parser, compiler, error handling bug Something isn't working
Milestone

Comments

@robrankin
Copy link

Hostgroup objects that use assign where for Host objects that are apparently incorrectly created with groups = null causes a segfault.

I suspect the groups = null isn't valid syntax, however this was created by the Terraform Icinga2 Provider. I'll report a bug to Terraform as well.

Config validation also segfaults as seen below.

Expected Behavior

No segfault. Perhaps an error message on start? Maybe the API should also produce an error that the syntax isn't valid?

Current Behavior

Segfault produced:

icinga2[4514]: segfault at 20 ip 00007fd004ae0fb1 sp 00007fd0057ed2c0 error 4 in libbase.so.2.6.3[7fd004a6f000+167000]

Steps to Reproduce (for bugs)

Create the following config files. Icinga2 segfaults on start.

object Host "something" {
        address = "192.168.1.1"
        check_command = "hostalive"
        groups = null
        vars = {
                something = "blart"
        }
}
object HostGroup "somethinggroup"  {
  display_name = "something"

  assign where host.vars.something == "blart"
}

Your Environment


Copyright (c) 2012-2017 Icinga Development Team (https://www.icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Application information:
  Installation root: /usr
  Sysconf directory: /etc
  Run directory: /run
  Local state directory: /var
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Modified attributes path: /var/lib/icinga2/modified-attributes.conf
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /run/icinga2/icinga2.pid

System information:
  Platform: CentOS Linux
  Platform version: 7 (Core)
  Kernel: Linux
  Kernel version: 3.10.0-327.36.3.el7.x86_64
  Architecture: x86_64

Build information:
  Compiler: GNU 4.8.5
  Build host: unknown
  • Operating System and version: CentOS Linux release 7.2.1511 (Core)
  • Enabled features (icinga2 feature list):
Disabled features: gelf graphite influxdb livestatus opentsdb perfdata syslog
Enabled features: api checker command compatlog debuglog ido-mysql mainlog notification statusdata
  • Icinga Web 2 version and modules (System - About): monitoring - 2.4.1
  • Config validation (icinga2 daemon -C):
information/cli: Icinga application loader (version: v2.6.3)
information/cli: Loading configuration file(s).
information/ConfigItem: Committing config item(s).
information/ApiListener: My API identity: apihostname
Segmentation fault
@robrankin
Copy link
Author

Terraform issue reference: Terraform Issue #14819

@koppel
Copy link

koppel commented Feb 22, 2018

Is this still broken? When trying to use this with the example syntax, I'm getting:

Error: Error applying plan:

1 error(s) occurred:

* module.app.icinga2_host.host: 1 error(s) occurred:

* icinga2_host.host: Validation failed for object ‘<redacted>’ of type 'Host'; Attribute 'groups': Attribute must not be empty. Location: in /var/lib/icinga2/api/packages/_api/<redacted>/conf.d/hosts/<redacted>.conf: 7:2-7:14

And if I try to add: groups = [ "test-group" ], I get:

$ terraform apply

Error: module.app.icinga2_host.host: : invalid or unknown key: groups

@lrsmith
Copy link

lrsmith commented Mar 9, 2018

This is still broken and an underlying issue with go-icinga2-api library. I am working on a patch to that ( https://github.com/lrsmith/go-icinga2-api/tree/pr3_create_host_with_group_bug ) and will propaget it forward to the icigna2 provider.

@lrsmith
Copy link

lrsmith commented Mar 9, 2018

This has been patched in go-icinga2-api so it no longer passed nil, but will pass an empty list.

@dnsmichi
Copy link
Contributor

dnsmichi commented Mar 9, 2018

@koppel please create a new issue, this seems to be a different problem.

It would be helpful to see the exact API call/URL, as we don't have any Terraform setups around to test :)

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

Successfully merging a pull request may close this issue.

5 participants