[icinga-users] Director-API recognize error but syncronize it anyway

Jean-Denis Gebhardt jd at der-jd.de
Mon Jan 23 12:23:23 CET 2017


I reacently played arround with the Director-API.
Push a host -> works as expected.
Push a host with nonesense -> works kind of unexpected.

curl -H 'Accept: application/json' -u "$ICU:$ICP" 
'https://<icingahost>/icingaweb2/director/host' -d '{"object_name": 
"test.example.de", "object_type": "object", "display_name": 
"test.example.de", "address": "", "imports": 
["generic-director-host", "blubber"]}' -X POST -D -
HTTP/1.1 500 Internal Server Error
Date: Mon, 09 Jan 2017 16:57:07 GMT
Server: Apache/2.4.10 (Debian)
Content-Length: 58
Connection: close
Content-Type: application/json

   "error": "Failed to load icinga_host \"blubber\""

curl -H 'Accept: application/json'  -u "$ICU:$ICP" 
-L -D -
HTTP/1.1 200 OK
Date: Mon, 09 Jan 2017 16:58:34 GMT
Server: Apache/2.4.10 (Debian)
Vary: Accept-Encoding
Content-Length: 174
Connection: close
Content-Type: application/json
   "address": "",
   "display_name": "test.example.de",
   "object_name": "test.example.de",
   "object_type": "object"

API returns a error. The API and webfrontend is telling me, that the 
faulty part (imports) was not synced.
After a testdeployment the effectiv host-configuration object reveals 
that the error was pushed anyways.

Can somone explain me that behaviour. Is it a bug? I would expect to see 
the faulty part as error when quering the host-object.


More information about the icinga-users mailing list