Bug #10000

Removing zones crash remote icinga instances

Added by lbetz over 1 year ago. Updated 2 months ago.

Status:NewStart date:08/26/2015
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Cluster
Target version:Backlog
Icinga Version:2.3.9 Backport?:Not yet backported
Package Repository: Include in Changelog:Yes

Description

Remove a zone on the config (master) server hasn't an effect to remote instances with accept_config. The zone is still there in /var/lib/icinga2/api/zones. Please remove it automatically.

signature.asc Magnifier (842 Bytes) lbetz, 08/31/2015 10:21 PM


Related issues

Related to Icinga 2 - Bug #6863: old config in /var/lib/icinga2/api/zones after zone move Closed 08/06/2014
Related to Icinga 2 - Bug #11994: global_templates not working when enabling later New 06/20/2016
Related to Icinga 2 - Bug #12025: Apply rule in zone affects other zones Assigned 06/23/2016
Related to Director - Support #12707: Director destroys Icinga Replication Closed 09/12/2016
Related to Icinga 2 - Bug #11740: .conf file will remain in apifolder if the zonesfolder in... New 05/08/2016

History

#1 Updated by mfriedrich over 1 year ago

  • Related to Bug #6863: old config in /var/lib/icinga2/api/zones after zone move added

#2 Updated by mfriedrich over 1 year ago

  • Status changed from New to Feedback
  • Assignee set to lbetz

Does the zone still exist in your satellite's zones.conf? If so, this isn't a bug.

#3 Updated by lbetz over 1 year ago

No.

#4 Updated by mfriedrich over 1 year ago

  • Status changed from Feedback to New
  • Assignee deleted (lbetz)

#5 Updated by mfriedrich over 1 year ago

  • Category changed from API to Cluster
  • Status changed from New to Assigned
  • Assignee set to mfriedrich

#6 Updated by tgelf about 1 year ago

It would be great if we could prioritize this, it makes it very easy to break a setup right now. Sometimes it's the users fault, sometimes it isn't, but IMO he shouldn't even need to care at all.

Cheers,
Thomas

#7 Updated by mfriedrich about 1 year ago

  • Target version set to Backlog

#8 Updated by mfriedrich about 1 year ago

  • Status changed from Assigned to New
  • Assignee deleted (mfriedrich)
  • Priority changed from Normal to High

#9 Updated by jflach about 1 year ago

I was able to reproduce this:

1. Delete the zone X from /var/lib/icinga2/api/zones/
2. Put something in zones.d/X on the satellite and the master
3. Restart both instances
4. The satellite will complain:

warning/ApiListener: Ignoring config update for zone 'X' because we have an authoritative version of the zone's config.

5. Delete zones.d/X on the satellite and restart

Success! The satellite will continue to think it has the authority over 'X' and ignore any config updates for this zone.

#10 Updated by mfriedrich about 1 year ago

  • Status changed from New to Assigned
  • Assignee set to jflach

@Jean

Please poke me on Friday to look into that together.

#11 Updated by mfriedrich about 1 year ago

Apparently that's more easy to reproduce than I thought.

Put a dummy file into /var/lib/icinga2/api/zones/foo/_etc/test.conf and start Icinga 2.

[2015-12-18 14:53:10 +0100] information/ConfigCompiler: Compiling config file: icinga2b/lib/icinga2/api/zones/foo/_etc/test.conf
[2015-12-18 14:53:10 +0100] information/ConfigCompiler: Compiling config file: icinga2b/lib/icinga2/api/zones/master/_etc/example-cmdb/test.conf
[2015-12-18 14:53:10 +0100] information/ConfigItem: Committing config items
[2015-12-18 14:53:10 +0100] information/ApiListener: My API identity: icinga2b
[2015-12-18 14:53:10 +0100] critical/config: Error: Validation failed for object 'foo' of type 'Host'; Attribute 'zone': Object 'foo' of type 'Zone' does not exist.
Location: in icinga2b/lib/icinga2/api/zones/foo/_etc/test.conf: 1:0-1:16
icinga2b/lib/icinga2/api/zones/foo/_etc/test.conf(1): object Host "foo" { }
                                                      ^^^^^^^^^^^^^^^^^
icinga2b/lib/icinga2/api/zones/foo/_etc/test.conf(2):

[2015-12-18 14:53:10 +0100] critical/config: 1 error

The culprit is that we cannot fix that when including the /var/lib/icinga2/api/zones directory, as the config compiler might not yet have the Zone objects available, a dependency problem.

The maybe fix is to not only delete obsolete files from existing zone directories (oldConfig vs newConfig) but also remove unknown zone configuration directories on config sync. Requires more investigation.

#12 Updated by mfriedrich 11 months ago

  • Parent task set to #11313

#14 Updated by mfriedrich 7 months ago

  • Related to Bug #11994: global_templates not working when enabling later added

#15 Updated by mfriedrich 6 months ago

  • Related to Bug #12025: Apply rule in zone affects other zones added

#16 Updated by tgelf 4 months ago

  • Related to Support #12707: Director destroys Icinga Replication added

#17 Updated by mfriedrich 2 months ago

  • Parent task deleted (#11313)

#18 Updated by mfriedrich 2 months ago

  • Status changed from Assigned to New
  • Assignee deleted (jflach)

#19 Updated by mfriedrich about 1 month ago

  • Related to Bug #11740: .conf file will remain in apifolder if the zonesfolder in zones.d is removed or the last .conf-file is removed from /zones.d/zonefolder. added

Also available in: Atom PDF