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 #9735] Broken cluster config sync w/o include_zones #3182

Closed
icinga-migration opened this issue Jul 26, 2015 · 3 comments
Closed
Labels
area/api REST API bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

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

Created by mfriedrich on 2015-07-26 15:48:57 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2015-07-26 16:00:05 +00:00)
Target Version: 2.4.0
Last Update: 2015-07-26 16:00:05 +00:00 (in Redmine)

Icinga Version: v2.3.0-384-gfa3d380
Backport?: No
Include in Changelog: 0

History

We've recently implemented include_zones, which adds a ZoneFragment registry for all zones and their registered paths. This gets taken into account by the config update sync in apilistener-sync.cpp - introduced with ccd63b9.

We've then reverted the manual inclusion of "include_zones "_etc", "zones.d" being too annoying on upgrades and re-implemented the internal include of zones.d by reverting the change in cli/daemonutility.cpp only

Problem

The problem is now that "etc", "zones.d" is never registered for the cluster config sync, it only gets read on startup but is never copied to /var/lib/icinga2/api/zones//_etc

Steps to reproduce

Add zone "master" and put the local endpoint into it:

object Endpoint "nbmif.int.netways.de" {
}

object Zone "master" {
    //this is the local node master named  = "master"
    endpoints = [ "nbmif.int.netways.de" ]
}

Put a file called tests.conf into the master config.

nbmif /etc/icinga2/zones.d/master # tree
.
└── [icinga            11]  test.conf

0 directories, 1 file

Restart icinga2.

Expected result

test.conf gets copied into /var/lib/icinga2/api/zones/master/_etc/test.conf - instead the zone directory is empty.

nbmif /etc/icinga2/zones.d/master # ls -la /var/lib/icinga2/api/zones/master/
insgesamt 12K
drwx------. 2 icinga icinga 4,0K 26. Jul 17:05 ./
drwxr-xr-x. 3 icinga icinga 4,0K 26. Jul 17:05 ../
-rw-r--r--. 1 icinga icinga    0 26. Jul 17:05 .authoritative
-rw-r--r--. 1 icinga icinga   17 26. Jul 17:05 .timestamp

Proposed Solution

Allow to call ConfigCompiler::RegisterZone() and statically register the zone before calling GlobRecursive with CollectIncludes inside DaemonUtility's HandleZonesDirRecursive - similar to how ConfigCompiler::HandleIncludeZone() works.

Solution tests

nbmif /etc/icinga2/zones.d/master # tree /var/lib/icinga2/api/zones/
/var/lib/icinga2/api/zones/
└── [icinga          4096]  master
    └── [icinga          4096]  _etc
        └── [icinga            11]  test.conf

2 directories, 1 file

Changesets

2015-07-26 15:57:34 +00:00 by (unknown) 0a1dad0

Fix broken cluster config sync w/ latest api changes

Apart from dropping the requirement of adding 'include_zones "etc", "zones.d"'
on upgrade to 2.4, we've forgotten to register the local zone directory into
the new ZoneFragment tree.

This fix adds a new function to register the local zones.d directory.
After that the config sync works again.

fixes #9735

Parent Task: #9083

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-07-26 15:49:42 +00:00

PS: I'm working on a Vagrant cluster box update, where this error is pretty much visible.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-07-26 15:53:34 +00:00

  • Description updated

@icinga-migration
Copy link
Author

Updated by Anonymous on 2015-07-26 16:00:05 +00:00

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

Applied in changeset 0a1dad0.

@icinga-migration icinga-migration added Urgent bug Something isn't working area/api REST API labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.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/api REST API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant