Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
413 stars 203 forks source link

Deleted object leads to stacktrace in Activity Log #1199

Open netzwerkgoettin opened 7 years ago

netzwerkgoettin commented 7 years ago

In Activity Log, also deleted objects are a link which should lead to history/ object diff. But when I click on this link, I get a stacktrace. This is an example stacktrace of a deleted user:

#0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1081): Icinga\Module\Director\Data\Db\DbObject->loadFromDb()
#1 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(2316): Icinga\Module\Director\Data\Db\DbObject::load('<username>', Object(Icinga\Module\Director\Db))
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(345): Icinga\Module\Director\Objects\IcingaObject::loadByType('user', '<username>', Object(Icinga\Module\Director\Db))
#3 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(328): Icinga\Module\Director\Web\Controller\ObjectController->loadObject()
#4 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(62): Icinga\Module\Director\Web\Controller\ObjectController->eventuallyLoadObject()
#5 /usr/share/icingaweb2/library/Icinga/Web/Controller/ActionController.php(152): Icinga\Module\Director\Web\Controller\ObjectController->init()
#6 /usr/share/icingaweb2/library/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/icingaweb2/library/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#9 /usr/share/icingaweb2/library/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#10 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/icin...')
#11 {main}

This happens for hosts, services and users - but not for all. It seems to depend on the object's creation date, but I'm unsure about that - I'll let you know if I can identify more.

Cheers, Marianne

Expected Behavior

It should show me the diff.

Current Behavior

It doesn't.

Your Environment

Thomas-Gelf commented 7 years ago

Guess it depends on whether you click "somewhere" in the row or on the link "in" the row, pointing to the object?

netzwerkgoettin commented 7 years ago

Aaah. The failing ones get underlines when hovering them; when I click the underlined text, it stacktraces, when I click somewhere around, I get the diff...?

Thomas-Gelf commented 7 years ago

Yep. So, the row always points to the diff and should always work. The link points to the object and currently fails for objects which no longer exist. It's a feature, but definitively confusing. One option could be pointing to a "discovery" page that would first check whether the object is still reachable, redirecting you if so. Another one would be to completely drop the link pointing directly to the object.

netzwerkgoettin commented 7 years ago

I would suggest to simply drop the link. Diff with possibility to restore should be enough for a deleted object.

Thomas-Gelf commented 7 years ago

Sure... just - it might be a pretty old activity, and you might have had restored/deleted/restored it a couple of times. So, you never know ;-)

Thomas-Gelf commented 7 years ago

Guess I'll drop the link for every kind of action