Issue with icingaweb2 under Ubuntu 18.04 (probably )after update

Hello ,
Today i discovered that my icinga monitoring system stoped working , when getting into Icingaweb2 portal , i get following error shown below , on icinga log there is no error error exist.
I assume that recent apt update and upgrade did affect but i don’t know how to point it
any idea ? please advice
Thanks

Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /usr/share/php/Icinga/Data/Db/DbConnection.php:196 Stack trace: #0 /usr/share/php/Icinga/Data/Db/DbConnection.php(76): Icinga\Data\Db\DbConnection->connect() #1 /usr/share/php/Icinga/Data/ResourceFactory.php(103): Icinga\Data\Db\DbConnection->__construct(Object(Icinga\Data\ConfigObject)) #2 /usr/share/php/Icinga/Data/ResourceFactory.php(136): Icinga\Data\ResourceFactory::createResource(Object(Icinga\Data\ConfigObject)) #3 /usr/share/php/Icinga/Authentication/User/UserBackend.php(210): Icinga\Data\ResourceFactory::create('icingaweb_db') #4 /usr/share/php/Icinga/Authentication/AuthChain.php(241): Icinga\Authentication\User\UserBackend::create('icingaweb2', Object(Icinga\Data\ConfigObject)) #5 /usr/share/php/Icinga/Authentication/Auth.php(272): Icinga\Authentication\AuthChain->valid() #6 /usr/share/php/Icinga/Authentication/Auth.php(93): Icinga\Authentication\Auth->authExternal() #7 /usr/share/php/Icinga/Application/Web.php(333): Icinga\Authen in /usr/share/php/Icinga/Data/Db/DbConnection.php on line 196

icinga log

    [2019-03-31 14:12:52 +0300] information/FileLogger: 'main-log' started.
[2019-03-31 14:12:52 +0300] information/ApiListener: 'api' started.
[2019-03-31 14:12:52 +0300] information/ApiListener: Copying 6 zone configuration files for zone 'director-global' to '/var/lib/icinga2/api/zones/director-global'.
[2019-03-31 14:12:52 +0300] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones/director-global' (0 Bytes). Received timestamp '2019-03-31 14:12:52 +0300' (1554030772.529128), Current timestamp '2019-03-31 14:12:37 +0300' (1554030757.391176).
[2019-03-31 14:12:52 +0300] information/ApiListener: Copying 1 zone configuration files for zone 'gfn-srv-mon01' to '/var/lib/icinga2/api/zones/gfn-srv-mon01'.
[2019-03-31 14:12:52 +0300] information/ApiListener: Applying configuration file update for path '/var/lib/icinga2/api/zones/gfn-srv-mon01' (0 Bytes). Received timestamp '2019-03-31 14:12:52 +0300' (1554030772.529500), Current timestamp '2019-03-31 14:12:37 +0300' (1554030757.391503).
[2019-03-31 14:12:52 +0300] information/ApiListener: Started new listener on '[0.0.0.0]:5665'
[2019-03-31 14:12:52 +0300] information/GraphiteWriter: 'graphite' started.
[2019-03-31 14:12:52 +0300] information/NotificationComponent: 'notification' started.
[2019-03-31 14:12:52 +0300] information/ExternalCommandListener: 'command' started.
[2019-03-31 14:12:52 +0300] information/CheckerComponent: 'checker' started.
[2019-03-31 14:12:52 +0300] information/GraphiteWriter: Finished reconnecting to Graphite in 0.000121117 second(s).
[2019-03-31 14:12:52 +0300] information/DbConnection: 'ido-mysql' started.
[2019-03-31 14:12:52 +0300] information/PerfdataWriter: 'perfdata' started.
[2019-03-31 14:12:52 +0300] information/ConfigItem: Activated all objects.
[2019-03-31 14:12:52 +0300] information/cli: Closing console log.
[2019-03-31 14:12:52 +0300] information/DbConnection: Resuming IDO connection: ido-mysql
[2019-03-31 14:12:52 +0300] information/IdoMysqlConnection: 'ido-mysql' resumed.
[2019-03-31 14:12:52 +0300] information/IdoMysqlConnection: MySQL IDO instance id: 1 (schema version: '1.14.3')
[2019-03-31 14:12:52 +0300] information/IdoMysqlConnection: Finished reconnecting to MySQL IDO database in 0.045332 second(s).
[2019-03-31 14:13:02 +0300] information/WorkQueue: #6 (ApiListener, SyncQueue) items: 0, rate:  0/s (0/min 0/5min 0/15min);
[2019-03-31 14:13:02 +0300] information/WorkQueue: #5 (ApiListener, RelayQueue) items: 0, rate: 0.683333/s (41/min 41/5min 41/15min);
[2019-03-31 14:13:02 +0300] information/WorkQueue: #7 (GraphiteWriter, graphite) items: 0, rate: 0.05/s (3/min 3/5min 3/15min);
[2019-03-31 14:13:02 +0300] information/WorkQueue: #8 (IdoMysqlConnection, ido-mysql) items: 0, rate: 0.416667/s (25/min 25/5min 25/15min);

Hi
What version of IcingaWeb2 are you running and what is the PHP version you have on the server ?
Also when you did the apt upgrade did you remember to also do the DB scheme upgrade ? ( or at least check if you need to do that ? )

Regards

2 Likes

Googling this error leads to many topics, I’d say this is PHP and MySQL driver related. Likely something changed between PHP 5.6 and 7.x on Ubuntu related packages.

Verify that the MySQL PDO packages are properly installed and not removed/broken on upgrades.

Cheers,
Michael

Hi there.

I had the same issue today with Ubuntu 20.04 and I realized that the default PHP version was 8.1 which seems not be compatible with Icinga Director.

I changed it by executing

sudo update-alternatives --config php

and selecting PHP 7.4.

After that, the service started up again.

I hope this helps.