Open sol1-matt opened 3 years ago
We can delete the services, sync rules and import sources and recreate them and the problem reoccurs.
It could be a straight up database problem but I couldn't find doc's on how the tables link together for import_ or service.
SQL that shows what occurs when trying to recreate the icinga service, checks etc, would likely help identify the what the root source of the problem is and allow us to create a reproducible test case.
Hi, I'm using Director Automation with simple CMDB table to check certain websites ( and their certs and evetual regex ) .. Isn't your problem in Sync rule?
I have Sync rule Test with:
Object Type: Host Update Policy: Replace Purge: Yes
You cannot create already created hosts, thats why "Update Policy: Replace".
@majales I don't think it is a problem in the sync rule I setup
I have multiple import sources and service sync rules setup and the problem only occurs on some of them
Some recent testing has shown the same add single service sync rule behaves differently depending on the host the rule adds the services too. ie I change just the host and rule work.
I've also found that a add single service sync rule that previously was working stopped working without any changes being made to the rules for the parent host or the service itself.
once a how 'breaks' I haven't found a way to make them work again. Haven't tried deleting and re-adding the host though.
I haven't figured out what triggers the problem yet which makes it hard to provide a reproducible test case.
When I ran into this problem today I was able to work around it by deleting all the services that were generated by the sync rule. Then it would run OK once, failing if you ran it a second time.
I've similar problem, if a object is once created then it doesn't matter what "Update Policy" I take - Merge, Replace or Ignore, I get ever:
`Oops, an error occurred!
Exception while syncing Icinga\Module\Director\Objects\IcingaHostGroup Atlassian - JIRA-Confluence-Service Desk: Trying to recreate icinga_hostgroup ("Atlassian - JIRA-Confluence-Service Desk") (Sync.php:946)
Only on "Update only" it does nothing... So if I want to make a new import from REST API of Assets (Atlassian) I need EVER DELETE all imported objects and then I can import them again...
I use: Director: V1.11 Icinga2: V2.14.2 Icingaweb2: 2.12 on RHEL 8.9
Expected Behavior
Sync rule for service should run with out error.
Current Behavior
Director web UI
The first run of the service sync rule works The second run of the service sync rule throws an error.
/icingaweb2/director/syncrule?id=3079
This Sync Rule failed when last checked at 2020-11-26 01:16:50: Exception while syncing Icinga\Module\Director\Objects\IcingaService paneda_02fe3771-f33c-4753-8f30-8caa1ca5584d: Trying to recreate icinga_service ("{"host_id":"1455","object_name":"paneda_02fe3771-f33c-4753-8f30-8caa1ca5584d"}")
running check for changes it shows
Icingacli director
When running the sync from the cli it returns a different result
Additional info
This only happens on some hosts, a sizable number of hosts but not all of them. It is possible to take the sync rules and point them at a newly created host or a different host created from automation and they sync rules function correctly.
The error message has been insufficient to determine why this may be occurring.
This has been tested using the built in director import source REST API and a separate import source module for importing generic web/json api's based on then netbox import module. Both import types have the same problem.
Possible Solution
Any suggestions on how to better debug this would be appreciated.
Steps to Reproduce (for bugs)
Your Environment
icinga2 --version
): r2.12.1-1