Open neubi4 opened 7 years ago
After some debugging it is related to #1094. Any idea how we can fix this? Maybe there is the need for an new cli command like "applyrules".
Problem still exists with Director v1.4.2 (issue present coming from 1.3.2 and 1.4.0) and Icinga2 2.8 on Ubuntu 16.04.3. IcingaWeb2 Versions are 2.5 on one system and 2.4.2 on another.
Also you can't access services via the Directors activity log. The diff log is displayed normally, but if you click on the created service you get the following error message and stacktrace:
Failed to load icinga_service for host_id IS NULL AND service_set_id IS NULL AND object_name = 'Hardware-Status' AND object_type = 'template'
0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1101): Icinga\Module\Director\Data\Db\DbObject->loadFromDb()
1 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(252): Icinga\Module\Director\Data\Db\DbObject::load(Array, Object(Icinga\Module\Director\Db))
2 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(328): Icinga\Module\Director\Controllers\ServiceController->loadObject()
3 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(62): Icinga\Module\Director\Web\Controller\ObjectController->eventuallyLoadObject()
4 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(43): Icinga\Module\Director\Web\Controller\ObjectController->init()
5 /usr/share/php/Icinga/Web/Controller/ActionController.php(152): Icinga\Module\Director\Controllers\ServiceController->init()
6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(59): Icinga\Web\Controller\ActionController->__construct(Object(Icinga\Web\Request), Object(Icinga\Web\Response), Array)
7 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
8 /usr/share/php/Icinga/Application/Web.php(407): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
9 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
10 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
11 {main}
icingacli director service exists Hardware-Status
Service 'Hardware-Status' does not exist
icingacli director service show Hardware-Status
ERROR: Icinga\Exception\NotFoundError in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php:610 with message: Failed to load icinga_service for host_id IS NULL AND service_set_id IS NULL AND object_name = 'Hardware-Status' AND object_type = 'template'
With IcingaWeb2 2.5.0 the errors/the problem disappeared after applying the schema upgrade to 2.5.0
Under IcingaWEb2 2.4.2 the issue is still present
the issue is still present ERROR: Icinga\Exception\NotFoundError in /usr/local/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php:610 with message: Failed to load icinga_service for host_id IS NULL AND service_set_id IS NULL AND object_name = 'check-fund-rating-10m-service' AND object_type = 'template'
icinga2: v2.8.1 director: v1.4.3
@Thomas-Gelf
Any news on this topic? The problem exists using director API as well: on my attempt to GET my Apply service:
json response: {'error': \"Failed to load icinga_service for host_id IS NULL AND service_set_id IS NULL AND object_name = 'apt_apply_api' AND object_type = 'template'\"}
icinga2: v.2.6.2 director: v.1.6.0
It seems that you need to define the hostname as follow:
icingacli director service exists --host <host_name> <service_name>
I guess that the icingacli command is not very clear ;)
@santuari Thanks!
Expected Behavior
Given this service in the database:
$ icingacli director service exists disk-agent
sould find the servicedisk-agent
Current Behavior
It does not find the apply service, because it looks like it now only searches for
object_type = 'template'
Context
We are running icinga and icingaweb2 with director in containers. On container startup we run a script wich check if our default services are already in the database, if not create them, else we compare the database result to our given service and update it if necessary.
This check is done via
icingacli director service exists $service_name
. It worked fine in v1.3.2, but its now broken in v1.4.0 because it only looks for object_type template and does not find our apply services.Sample service:
Your Environment
icinga2 --version
): r2.7.1-1