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 204 forks source link

Uncaught error when trying to modify service details in icingadb-web overview ("findservice" instead of "edit") #2768

Open bangerer opened 1 year ago

bangerer commented 1 year ago

Hi Icinga team!

Expected Behavior

In icingadb-web -> Overview -> Services, on the details page of a service, there's a section called "Actions" and a link called "Modify". (Assuming Director is installed and permissions for Director usage are granted).

The link itself looks like this: https://_myserver.com_/icingaweb2/director/host/findservice?name=_myhost_&service=_myservice_

Clicking on that should take one to the corresponding "Edit service" page. Which is the case for editing host details when clicking the "Modify" link on a host details page: https://_myserver.com_/icingaweb2/director/host/edit?name=_myhost_

Current Behavior

Instead, clicking the "Modify" link on a service details page yields: Uncaught Error: Call to a member function select() on null in /usr/share/icingaweb2/modules/director/library/Director/Monitoring.php:141

(Full stacktrace see below.)

Possible Solution

Changing the link target to something like this would solve the issue: https://_myserver.com_/icingaweb2/director/host/servicesetservice?uuid=_myuuid_&service=_myservice_&set=_myserviceset_

Steps to Reproduce

  1. Have icingadb-web and director installed and full permissions in both modules granted for your icingaweb2 user.
  2. Visit https://_myserver.com_/icingaweb2/icingadb/service?name=_myservice_&host.name=_myhost_
  3. Find the link "Modify" round about the middle of the page and click it.

Your Environment

Additional context

Full stacktrace:

Uncaught Error: Call to a member function select() on null in /usr/share/icingaweb2/modules/director/library/Director/Monitoring.php:141
Stack trace:
#0 /usr/share/icingaweb2/modules/director/library/Director/Monitoring.php(41): Icinga\Module\Director\Monitoring->prepareServiceKeyColumnQuery()
#1 /usr/share/icingaweb2/modules/director/library/Director/Monitoring.php(78): Icinga\Module\Director\Monitoring->hasService()
#2 /usr/share/icingaweb2/modules/director/application/controllers/HostController.php(37): Icinga\Module\Director\Monitoring->authCanEditService()
#3 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ActionController.php(57): Icinga\Module\Director\Controllers\HostController->checkDirectorPermissions()
#4 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(64): Icinga\Module\Director\Web\Controller\ActionController->init()
#5 /usr/share/php/Icinga/Web/Controller/ActionController.php(170): Icinga\Module\Director\Web\Controller\ObjectCont

Hope this helps! - Greetings, Barney

WhoAmI0501 commented 1 year ago

This is also happening on my setup... i cannot edit any service. Very annoying.

phil-or commented 1 year ago

Same problem here.