Error on adding custom fields to a service template


I have a problem with self created commands since the last upgrade of Icinga2. The commands are executed without problems on the hosts that were present before the upgrade. However, on new hosts there is an error message that they cannot be found.

I then tried to recreate the commands with a new name, which worked. However, when I then try to create a new service based on the command and then add fields to the service, I get the following error message when I click on “Deploy”:

Uncaught TypeError: Argument 2 passed to Icinga\Module\Director\Data\Db\DbObjectStore::load() must implement interface Ramsey\Uuid\UuidInterface, null given, called in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php on line 1273 and defined in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObjectStore.php:38
Stack trace:
#0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1273): Icinga\Module\Director\Data\Db\DbObjectStore->load()
#1 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaServiceSet.php(122): Icinga\Module\Director\Data\Db\DbObject::load()
#2 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaServiceSet.php(95): Icinga\Module\Director\Objects\IcingaServiceSet->getServiceObjectsForSet()
#3 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaServiceSet.php(304): Icinga\Module\Director\Objects\IcingaServiceSet->getServiceObjects()
#4 /usr/share/icingaweb2/modules/directo

#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main}

This is my environment:

  • Director version (System - About): master (?)
  • Icinga Web 2 version and modules (System - About): 2.9.5
  • Icinga 2 version (icinga2 --version): r2.13.2-1
  • Operating System and version: Ubuntu 20.04.3 LTS
  • Webserver, PHP versions: Apache/2.4.41, PHP 7.4.3