[resolved] Db connection issue when i try to update user preference

i try to update the Default page size from 25 to 500 and i have the error message

Fatal error
: Uncaught ErrorException: Uncaught LogicException: Please check if a db instance exists at all in /usr/share/php/Icinga/Common/Database.php:28 Stack trace: #0 /usr/share/php/Icinga/Application/ProvidedHook/DbMigration.php(21): Icinga\Application\ProvidedHook\DbMigration->getWebDb() #1 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(293): Icinga\Application\ProvidedHook\DbMigration->getDb() #2 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(172): Icinga\Application\Hook\DbMigrationHook->load() #3 /usr/share/php/Icinga/Application/MigrationManager.php(306): Icinga\Application\Hook\DbMigrationHook->getMigrations() #4 /usr/share/php/Icinga/Application/MigrationManager.php(56): Icinga\Application\MigrationManager->load() #5 /usr/share/php/Icinga/Application/MigrationManager.php(106): Icinga\Application\MigrationManager->getPendingMigrations() #6 /usr/share/php/Icinga/Application/MigrationManager.php(69): Icinga\Application\MigrationManager->count() #7 /usr/share/php/Icinga/Application/MigrationManager.php(74): Icinga\Application\MigrationManager->hasPendingMigrations() #8 /usr/share/icingaweb2/application/controllers/ErrorController.php(99): Icinga\Application\MigrationManager->hasMigrations() #9 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Controllers\ErrorController->errorAction() #10 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch() #11 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch() #12 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch() #13 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch() #14 /usr/share/icingaweb2/public/index.php(4): require_once(‘…’) #15 {main} Next Zend_Controller_Exception: Please check if a db instance exists at all#0 /usr/share/php/Icinga/Application/ProvidedHook/DbMigration.php(21): Icinga\Application\ProvidedHook\DbMigration->getWebDb() #1 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(293): Icinga\Application\ProvidedHook\DbMigration->getDb() #2 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(172): Icinga\Application\Hook\DbMigrationHook->load() #3 /usr/share/php/Icinga/Application/MigrationManager.php(306): Icinga\Application\Hook\DbMigrationHook->getMigrations() #4 /usr/share/php/Icinga/Application/MigrationManager.php(56): Icinga\Application\MigrationManager->load() #5 /usr/share/php/Icinga/Application/MigrationManager.php(106): Icinga\Application\MigrationManager->getPendingMigrations() #6 /usr/share/php/Icinga/Application/MigrationManager.php(69): Icinga\Application\MigrationManager->count() #7 /usr/share/php/Icinga/Application/MigrationManager.php(74): Icinga\Application\MigrationManager->hasPendingMigrations() #8 /usr/share/icingaweb2/application/controllers/ErrorController.php(99): Icinga\Application\MigrationManager->hasMigrations() #9 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Controllers\ErrorController->errorAction() #10 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch() #11 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch() #12 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch() #13 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch() #14 /usr/share/icingaweb2/public/index.php(4): require_once(‘…’) #15 {main} in /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Plugin/Broker.php:335 Stack trace: #0 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(965): Zend_Controller_Plugin_Broker->postDispatch() #1 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch() #2 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch() #3 /usr/share/icingaweb2/public/index.php(4): require_once(‘…’) #4 {main} thrown in /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Plugin/Broker.php:335 Stack trace: #0 [internal function]: Icinga\Application\Web->Icinga\Application{closure}() #1 {main} Next Zend_Controller_Exception: Uncaught LogicException: Please check if a db instance exists at all in /usr/share/php/Icinga/Common/Database.php:28 Stack trace: #0 /usr/share/php/Icinga/Application/ProvidedHook/DbMigration.php(21): Icinga\Application\ProvidedHook\DbMigration->getWebDb() #1 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(293): Icinga\Application\ProvidedHook\DbMigration->getDb() #2 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(172): Icinga\Application\Hook\DbMigrationHook->load() #3 /usr/share/php/Icinga/Application/MigrationManager.php(306): Icinga\Application\Hook\DbMigrationHook->getMigrations() #4 /usr/share/php/Icinga/Application/MigrationManager.php(56): Icinga\Application\MigrationManager->load() #5 /usr/share/php/Icinga/Application/MigrationManager.php(106): Icinga\Application\MigrationManager->getPendingMigrations() #6 /usr/share/php/Icinga/Application/MigrationManager.php(69): Icinga\Application\MigrationManager->count() #7 /usr/share/php/Icinga/Application/MigrationManager.php(74): Icinga\Application\MigrationManager->hasPendingMigrations() #8 /usr/share/icingaweb2/application/controllers/ErrorController.php(99): Icinga\Application\MigrationManager->hasMigrations() #9 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Controllers\ErrorController->errorAction() #10 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch() #11 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch() #12 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch() #13 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch() #14 /usr/share/icingaweb2/public/index.php(4): require_once(‘…’) #15 {main} Next Zend_Controller_Exception: Please check if a db instance exists at all#0 /usr/share/php/Icinga/Application/ProvidedHook/DbMigration.php(21): Icinga\Application\ProvidedHook\DbMigration->getWebDb() #1 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(293): Icinga\Application\ProvidedHook\DbMigration->getDb() #2 /usr/share/php/Icinga/Application/Hook/DbMigrationHook.php(172): Icinga\Application\Hook\DbMigrationHook->load() #3 /usr/share/php/Icinga/Application/MigrationManager.php(306): Icinga\Application\Hook\DbMigrationHook->getMigrations() #4 /usr/share/php/Icinga/Application/MigrationManager.php(56): Icinga\Application\MigrationManager->load() #5 /usr/share/php/Icinga/Application/MigrationManager.php(106): Icinga\Application\MigrationManager->getPendingMigrations() #6 /usr/share/php/Icinga/Application/MigrationManager.php(69): Icinga\Application\MigrationManager->count() #7 /usr/share/php/Icinga/Application/MigrationManager.php(74): Icinga\Application\MigrationManager->hasPendingMigrations() #8 /usr/share/icingaweb2/application/controllers/ErrorController.php(99): Icinga\Application\MigrationManager->hasMigrations() #9 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Controllers\ErrorController->errorAction() #10 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch() #11 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch() #12 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch() #13 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch() #14 /usr/share/icingaweb2/public/index.php(4): require_once(‘…’) #15 {main} in /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Plugin/Broker.php:335 Stack trace: #0 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(965): Zend_Controller_Plugin_Broker->postDispatch() #1 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch() #2 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch() #3 /usr/share/icingaweb2/public/index.php(4): require_once(‘…’) #4 {main} thrown#0 [internal function]: Icinga\Application\Web->Icinga\Application{closure}() #1 {main} in /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Plugin/Broker.php:262 Stack trace: #0 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(923): Zend_Controller_Plugin_Broker->routeShutdown() #1 /usr/share/php/Icinga/Application/Web.php(461): Zend_Controller_Front->dispatch() #2 [internal function]: Icinga\Application\Web->Icinga\Application{closure}() #3 {main} thrown in
/usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Plugin/Broker.php
on line
262

  • Icinga Web 2 Version 2.12.2 (git commit : 7f9217b0521f19f770ad59ca17d7d4b3514e54e5
  • Used modules and their versions (System - About) :
    doc 2.12.2
    migrate 2.12.2
    monitoring 2.12.2
    setup 2.12.2
    test 0.0.0
    translation 2.12.2
    icinga/icinga-php-library 0.14.1
    icinga/icinga-php-thirdparty 0.12.1
  • Web browser used firefox / chrome
  • Icinga 2 version used (icinga2 --version)
    icinga2 - The Icinga 2 network monitoring daemon (version: r2.14.5-1)

Copyright (c) 2012-2025 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: Debian GNU/Linux
Platform version: 12 (bookworm)
Kernel: Linux
Kernel version: 6.1.0-22-amd64
Architecture: x86_64

Build information:
Compiler: GNU 12.2.0
Build host: runner-hh8q3bz2-project-575-concurrent-0
OpenSSL version: OpenSSL 3.0.15 3 Sep 2024

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

  • PHP version used (php --version)
    PHP 8.2.26 (cli) (built: Nov 25 2024 17:21:51) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.2.26, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.26, Copyright (c), by Zend Technologies
  • Server operating system and version
    No LSB modules are available.
    Distributor ID: Debian
    Description: Debian GNU/Linux 12 (bookworm)
    Release: 12
    Codename: bookworm

db :
[auth]
type = “db”
db = “pgsql”
host = “pg1”
port = “5437”
dbname = “auth”
username = “icingaauth”
password = “qqch”
charset = “UTF8”
use_ssl = “1”

[ido]
type = “db”
db = “pgsql”
host = “pg1”
port = “5437”
dbname = “icinga2”
username = “ido”
password = “qqch”
charset = “UTF8”
use_ssl = “1”

(db not accessble from wan)

i use postgresql and seems no code for postgresql in
/usr/share/php/Icinga/Common/Database.php

thank you for your help

auto reply:

need to add /etc/icingaweb2/config.ini
config_resource = “”

need to match with the tittle definition of the db description connection in /etc/icingaweb2/resources.ini

in /etc/icingaweb2/authentication.ini
[icingaweb2]
backend = “db”
resource = “”