SQL error message trying to add a service to a service set in icinga director

icinga2 --version

icinga2 - The Icinga 2 network monitoring daemon (version: 2.13.1-1)

Copyright (c) 2012-2021 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: CentOS Stream
Platform version: 8
Kernel: Linux
Kernel version: 4.18.0-348.el8.x86_64
Architecture: x86_64

Build information:
Compiler: GNU 8.4.1
Build host: runner-hh8q3bz2-project-507-concurrent-0
OpenSSL version: OpenSSL 1.1.1k FIPS 25 Mar 2021

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid

Icinga Web 2 2.9.4
Git Commit d208d1ccfef86606984739e6357138c459146134
PHP Version 7.4.25
MODULE VERSION
director master
doc 2.9.4
incubator 0.7.0
monitoring 2.9.4
setup 2.9.4

PHP-Version 7.4.25
PHP Integer 64bit

Description of error:

A single service set was created and deployed. Trying to add services to that service set result in the following error message:

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘icinga_service_set.uuid’ in ‘field list’, query was: SELECT icinga_service_set.uuid FROM icinga_service_set WHERE (object_name = ‘Basic for Linux Server’)

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute()
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute()
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query()
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(816): Zend_Db_Adapter_Pdo_Abstract->query()
#4 /usr/share/icingaweb2/modules/director/library/Director/Db/Branch/UuidLookup.php(88): Zend_Db_Adapter_Abstract->fetchOne()
#5 /usr/share/icingaweb2/modules/director/library/Director/Db/Branch/UuidLookup.php(64): Icinga\Module\Director\Db\Branch\UuidLookup::fetchOptionalUuid()
#6 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(74): Icinga\Module\Director\Db\Branch\UuidLookup::findUuidForKey()
#7 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(43): Icinga\Module\Director\Controllers\ServiceController->loadOptionalSet()
#8 /usr/share/php/Icinga/Web/Controller/ActionController.php(165): Icinga\Module\Director\Controllers\ServiceController->init()
#9 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(59): Icinga\Web\Controller\ActionController->__construct()
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch()
#11 /usr/share/php/Icinga/Application/Web.php(304): Zend_Controller_Front->dispatch()
#12 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\Web->dispatch()
#13 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#14 {main}

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘icinga_service_set.uuid’ in ‘field list’

#0 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement/Pdo.php(219): PDOStatement->execute()
#1 /usr/share/icingaweb2/library/vendor/Zend/Db/Statement.php(297): Zend_Db_Statement_Pdo->_execute()
#2 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(470): Zend_Db_Statement->execute()
#3 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query()
#4 /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/Abstract.php(816): Zend_Db_Adapter_Pdo_Abstract->query()
#5 /usr/share/icingaweb2/modules/director/library/Director/Db/Branch/UuidLookup.php(88): Zend_Db_Adapter_Abstract->fetchOne()
#6 /usr/share/icingaweb2/modules/director/library/Director/Db/Branch/UuidLookup.php(64): Icinga\Module\Director\Db\Branch\UuidLookup::fetchOptionalUuid()
#7 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(74): Icinga\Module\Director\Db\Branch\UuidLookup::findUuidForKey()
#8 /usr/share/icingaweb2/modules/director/application/controllers/ServiceController.php(43): Icinga\Module\Director\Controllers\ServiceController->loadOptionalSet()
#9 /usr/share/php/Icinga/Web/Controller/ActionController.php(165): Icinga\Module\Director\Controllers\ServiceController->init()
#10 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(59): Icinga\Web\Controller\ActionController->__construct()
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch()
#12 /usr/share/php/Icinga/Application/Web.php(304): Zend_Controller_Front->dispatch()
#13 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\Web->dispatch()
#14 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#15 {main}

There is no column “uuid” in the mysql database nor in the mysql.sql files for installation.

Hi,

I’ll see you are using the master branch. This is not always a good idea. E.g. the devs are pushing some changes to Git where still missing something like DB schema upgrades etc…
In your case it looks like you haven’t upgrade the DB, because of missing a table. The error message indicates this

The DB schemas are saved under /usr/share/icingaweb2/modules/director/schema

Hi Stevie,

thanks for your comment. I installed dnf install https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm and followed the installation steps on Installation - Icinga 2.

Can you please tell me where to find a newer/better version which is not “testing” or “snapshot”?

In /usr/share/icingaweb2/modules/director/schema/mysql.sql there is no “uuid” column defined in table “service_set”.

Are you sure you’ve installed the director via rpm? What I know there doesn’t exist one. Isn’t it possible you download and install the director from GitHub? Because in the installation instruction there you’ll find commands to change the version

Tried again before I wrote the comment above:

dnf install https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm
dnf config-manager --set-enabled powertools
dnf install ‘dnf-command(config-manager)’
dnf install epel-release
dnf install nagios-plugins-all

All statements stated that there is nothing to do as everything is already installed. As far as I can remember I used icingaweb2-module-director-1.8.1.tar.gz.

But I struggled with the installation process in the beginning and it could be possible that I did something different. I’m new to Icinga and if there is an alternative way I would be happy to do things differently.

After your hint with Gitlab I found a fix that looks like it addresses my issue (GitHub - Icinga/icingaweb2-module-director at fix/serviceset-uuid). I will try to update my director installation.

Thanks for your help so far, Klaus

Just applied the mentioned fix and the uuid column in the icinga_service_set table will be added. But the when entering the service set section I got a lot of messages that the uuid column in other tables is missing. As it is not urgent for me and I see that a fix is on the way I will wait for the next release.

Thanks again for your help!

If you download the file for version 1.8.1(the latest stable version) it should usallay not possible to be on the master branch :wink:

If it was a fresh installation and you couln’t wait for the mentioned fix, you could reinstall the director in the mentioned way from the docs. In this case you have to recreate the DB with the correct schema.

For the future: If you download and install software from Git, be aware from master-branches. Better to install stable releases if available. This is not a “icinga thing”, it’s a Git thing :wink:

Thanks a lot for the hint. As I’m no developer any more the “Git things” are not my favorite part :wink:
Right now I’m working on a different issue and maybe I have to open another topic. As said - Icinga is not very intuitiv and it needs a lot of work to master it. Therefore your help is highly appreciated!