Error in nagvis after upgrading Ubuntu to 20.04 (LTS)

We just upgraded our server to ubuntu 20.04 LTS. We did use same checkmk version before and after upgrade.
We now get an error in nagvis. Error seems to be the same in sidebar plugin and when openenig nagvis directly:
Error (Error): Cannot access private property CorePDOHandler::$dsnarray(1) { [0]=> array(2) { ["function"]=> string(15) "nagvisException" ["args"]=> array(1) { [0]=> object(Error)#13 (7) { ["message":protected]=> string(51) "Cannot access private property CorePDOHandler::$dsn" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(89) "/opt/omd/versions/1.6.0p20.cee/share/nagvis/htdocs/server/core/classes/CoreAuthModPDO.php" ["line":protected]=> int(58) ["trace":"Error":private]=> array(3) { [0]=> array(6) { ["file"]=> string(90) "/opt/omd/versions/1.6.0p20.cee/share/nagvis/htdocs/server/core/classes/CoreAuthHandler.php" ["line"]=> int(47) ["function"]=> string(11) "__construct" ["class"]=> string(14) "CoreAuthModPDO" ["type"]=> string(2) "->" ["args"]=> array(0) { } } [1]=> array(6) { ["file"]=> string(82) "/opt/omd/versions/1.6.0p20.cee/share/nagvis/htdocs/server/core/functions/index.php" ["line"]=> int(44) ["function"]=> string(11) "__construct" ["class"]=> string(15) "CoreAuthHandler" ["type"]=> string(2) "->" ["args"]=> array(0) { } } [2]=> array(4) { ["file"]=> string(79) "/opt/omd/versions/1.6.0p20.cee/share/nagvis/htdocs/frontend/nagvis-js/index.php" ["line"]=> int(53) ["args"]=> array(1) { [0]=> string(82) "/opt/omd/versions/1.6.0p20.cee/share/nagvis/htdocs/server/core/functions/index.php" } ["function"]=> string(7) "require" } } ["previous":"Error":private]=> NULL } } } }

Any hints on resolving this?

Thanks
Martin

I checked with one of my 20.04 systems and had no problem with 1.6.0p20 on this machine.
What PHP version do you use in your system? I have the default 7.4 on my machine.

we use the default:
php -v
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright © The PHP Group
Zend Engine v3.4.0, Copyright © Zend Technologies
with Zend OPcache v7.4.3, Copyright ©, by Zend Technologies

That’s the same version as on my system. I have no error if i open an example map.
It looks like something broken with your auth user “DB” on the system.

We are 1 step further.
Apache was using php7.2, even though no 7.2 module was enabled. After uninstalling every existing php7.2 Ubuntu package and rebooting the server (apache restart didn’t work), apache is now using php7.4.

Now we can start nagvis and use “automap” and 2 of 6 custom maps. The other maps throw an error that disappears after half a second and then only a white screen is shown. I catched a screenshot of the error message:
Zwischenablage-4

It looks like this map has some config entries what are found as a problem by NagVis
If you have the enterprise version you can try the 1.6 daily build. This includes a newer Nagvis version.
If this will not help I think only @LaMi can help :slight_smile:

Well, we have cee version, but would like to stay at production release.

I will contact our partner. Maybe they can help or get help from checkmk support team.

Just a quick update, after update to 1.6.0p21 (CEE) problem is still the same. NagvisExceptionHandler throws this in WebUI:

Error: (0) in_array() expects parameter 2 to be array, bool given
URL: /cdp/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=BRZ
File: /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php
Line: 1028
#0 [internal function]: nagvisExceptionErrorHandler()
#1 
/opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php(1028): 
in_array()
#2 
/opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php(488):                 
GlobalMapCfg->checkMapConfigIsValid() 
#3 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/frontend/nagvis-
js/classes/NagVisHeaderMenu.php(164): GlobalMapCfg->readMapConfig()
#4 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/frontend/nagvis- 
js/classes/NagVisHeaderMenu.php(305): NagVisHeaderMenu->getMapList()
#5 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/frontend/nagvis- 
js/classes/NagVisHeaderMenu.php(82): NagVisHeaderMenu->getMacros()
#6 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/frontend/nagvis- 
js/classes/FrontendModMap.php(117): NagVisHeaderMenu->__toString()
#7 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/frontend/nagvis- 
js/classes/FrontendModMap.php(80): FrontendModMap->showViewDialog()
#8 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/server/core/functions/index.php(120): 
FrontendModMap->handleAction()
#9 /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/frontend/nagvis-js/index.php(53): 
require('/opt/omd/versio...')
#10 {main}

In Apache Error.log the following:

[Tue Feb 23 09:19:52.662758 2021] [fcgid:warn] [pid 13308] [client 127.0.0.1:44678] mod_fcgid: 
stderr: PHP Deprecated:  join(): Passing glue string after array is deprecated. Swap the parameters 
in /opt/omd/versions/1.6.0p21.cee/share/nagvis/htdocs/server/core/defines/global.php on line 41, 
referer: http://CHECK-MK-SERVER-IP/cdp/check_mk/side.py

Martin

1.6.0p22 did remove the deprecated message in apache error log.
Is there a way to get nagvisExceptionErrorHandler() to report more than 10 lines in the WebUI?

Regretably I just tried to install the latest version of nagvis on a new install of nagios and I get the same error

I have install version 1.9.25 of Nagvis on a fully patched version of ubuntu 20.04 and get teh message below.


php -v
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
cdm-admin@prventmon001:/usr/local/nagios$


$ sudo apt list --installed | grep php

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libapache2-mod-php7.4/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
libapache2-mod-php/focal,now 2:7.4+75 all [installed]
libphp-phpmailer/focal,now 6.0.6-0.1 all [installed,automatic]
php-cli/focal,now 2:7.4+75 all [installed]
php-common/focal,now 2:75 all [installed,automatic]
php-gd/focal,now 2:7.4+75 all [installed]
php-gmp/focal,now 2:7.4+75 all [installed,automatic]
php-ldap/focal,now 2:7.4+75 all [installed,automatic]
php-mbstring/focal,now 2:7.4+75 all [installed,automatic]
php-mysql/focal,now 2:7.4+75 all [installed,automatic]
php-phpmyadmin-motranslator/focal,now 5.0.0-1 all [installed,automatic]
php-phpseclib/focal,now 2.0.23-2 all [installed,automatic]
php-psr-cache/focal,now 1.0.1-2 all [installed,automatic]
php-psr-container/focal,now 1.0.0-2 all [installed,automatic]
php-psr-log/focal,now 1.1.2-1 all [installed,automatic]
php-snmp/focal,now 2:7.4+75 all [installed,automatic]
php-symfony-cache-contracts/focal,now 1.1.8-1 all [installed,automatic]
php-symfony-cache/focal,now 4.3.8+dfsg-1ubuntu1 all [installed,automatic]
php-symfony-expression-language/focal,now 4.3.8+dfsg-1ubuntu1 all [installed,automatic]
php-symfony-service-contracts/focal,now 1.1.8-1 all [installed,automatic]
php-symfony-var-exporter/focal,now 4.3.8+dfsg-1ubuntu1 all [installed,automatic]
php-twig/focal,now 2.12.5-1 all [installed,automatic]
php-xml/focal,now 2:7.4+75 all [installed]
php7.4-cli/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-common/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-gd/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-gmp/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-json/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-ldap/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-mbstring/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-mysql/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-opcache/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-readline/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-snmp/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4-xml/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 amd64 [installed,automatic]
php7.4/focal-updates,focal-security,now 7.4.3-4ubuntu2.4 all [installed,automatic]
php/focal,now 2:7.4+75 all [installed]


Error (Error): Cannot access private property CorePDOHandler::$dsnarray(1) { [0]=> array(2) { [“function”]=> string(15) “nagvisException” [“args”]=> array(1) { [0]=> object(Error)#14 (7) { [“message”:protected]=> string(51) “Cannot access private property CorePDOHandler::$dsn” [“string”:“Error”:private]=> string(0) “” [“code”:protected]=> int(0) [“file”:protected]=> string(62) “/usr/local/nagvis/share/server/core/classes/CoreAuthModPDO.php” [“line”:protected]=> int(58) [“trace”:“Error”:private]=> array(3) { [0]=> array(5) { [“file”]=> string(63) “/usr/local/nagvis/share/server/core/classes/CoreAuthHandler.php” [“line”]=> int(47) [“function”]=> string(11) “__construct” [“class”]=> string(14) “CoreAuthModPDO” [“type”]=> string(2) “->” } [1]=> array(5) { [“file”]=> string(55) “/usr/local/nagvis/share/server/core/functions/index.php” [“line”]=> int(44) [“function”]=> string(11) “__construct” [“class”]=> string(15) “CoreAuthHandler” [“type”]=> string(2) “->” } [2]=> array(4) { [“file”]=> string(52) “/usr/local/nagvis/share/frontend/nagvis-js/index.php” [“line”]=> int(53) [“args”]=> array(1) { [0]=> string(55) “/usr/local/nagvis/share/server/core/functions/index.php” } [“function”]=> string(7) “require” } } [“previous”:“Error”:private]=> NULL } } } }

Solution:

thanks to Marting.B posting his Apache logs - yeah I should have though of that earlier - I checked mine and found " Could not initialize a database connection: could not find driver" .

I then found the following article https://github.com/NagVis/nagvis/issues/119

This showed that I needed to add a missing dependency “php7.0-sqlite3” I didn’t have “php-sqlite3” loaded so I didn’t need to uninstall it

then I needed to enable the extension in “/etc/php/7.4/apache2/php.ini”
uncomment “extension=pdo_sqlite”

then restart the apache server and all worked

so I fixed my issue by
sudo apt-get install php7.0-sqlite3
sudo vi /etc/php/7.4/apache2/php.ini <== uncomment (line 935: extension=pdo_sqlite)
sudo systemctl restart apache2.service

SO I hope this helps if someone else has the same issue

Hello shane,

thanks for sharing your solution.
Unfortunatly it did not solve our problem.

For Ubuntu 20.04, there is no php7.0-sqlite3. php7.4-sqlite3 is already installed.
I enabled the extension in php.ini, but still get the same error.

As our partner could not solve the problem, i really HOPE it will disappear as soon as we upgrade to 2.0, what is planned for 2nd half of the year.

What PHP modules are installed on your system?
On my standard Ubuntu 20.04 there are the following PHP packages installed and i have no problem with NagVis

root@monitoring:~# dpkg -l | grep php
ii  php-cgi                           2:7.4+75                                   all          server-side, HTML-embedded scripting language (CGI binary) (default)
ii  php-cli                           2:7.4+75                                   all          command-line interpreter for the PHP scripting language (default)
ii  php-common                        2:75                                       all          Common files for PHP packages
ii  php-gd                            2:7.4+75                                   all          GD module for PHP [default]
ii  php-json                          2:7.4+75                                   all          JSON module for PHP [default]
ii  php-pear                          1:1.10.9+submodules+notgz-1ubuntu0.20.04.2 all          PEAR Base System
ii  php-sqlite3                       2:7.4+75                                   all          SQLite3 module for PHP [default]
ii  php-xml                           2:7.4+75                                   all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php7.4-cgi                        7.4.3-4ubuntu2.4                           amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php7.4-cli                        7.4.3-4ubuntu2.4                           amd64        command-line interpreter for the PHP scripting language
ii  php7.4-common                     7.4.3-4ubuntu2.4                           amd64        documentation, examples and common module for PHP
ii  php7.4-gd                         7.4.3-4ubuntu2.4                           amd64        GD module for PHP
ii  php7.4-json                       7.4.3-4ubuntu2.4                           amd64        JSON module for PHP
ii  php7.4-opcache                    7.4.3-4ubuntu2.4                           amd64        Zend OpCache module for PHP
ii  php7.4-readline                   7.4.3-4ubuntu2.4                           amd64        readline module for PHP
ii  php7.4-sqlite3                    7.4.3-4ubuntu2.4                           amd64        SQLite3 module for PHP
ii  php7.4-xml                        7.4.3-4ubuntu2.4                           amd64        DOM, SimpleXML, XML, and XSL module for PHP

Not really a “standard” 20.04. It is a release upgrade from 18.04, as you can see:

ii  libapache2-mod-php                     2:7.4+75                                   all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
rc  libapache2-mod-php7.2                  7.2.24-0ubuntu0.18.04.7                    amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php7.4                  7.4.3-4ubuntu2.4                           amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                             2:75                                       all          Common files for PHP packages
ii  php-db                                 1.9.3-1build1                              all          Database Abstraction Layer
ii  php-gd                                 2:7.4+75                                   all          GD module for PHP [default]
ii  php-json                               2:7.4+75                                   all          JSON module for PHP [default]
ii  php-ldap                               2:7.4+75                                   all          LDAP module for PHP [default]
ii  php-pear                               1:1.10.9+submodules+notgz-1ubuntu0.20.04.2 all          PEAR Base System
ii  php-soap                               2:7.4+75                                   all          SOAP module for PHP [default]
ii  php-sqlite3                            2:7.4+75                                   all          SQLite3 module for PHP [default]
ii  php-xml                                2:7.4+75                                   all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
ii  php-xmlrpc                             2:7.4+75                                   all          XMLRPC-EPI module for PHP [default]
rc  php7.2-bz2                             7.2.24-0ubuntu0.18.04.7                    amd64        bzip2 module for PHP
rc  php7.2-cgi                             7.2.24-0ubuntu0.18.04.7                    amd64        server-side, HTML-embedded scripting language (CGI binary)
rc  php7.2-cli                             7.2.24-0ubuntu0.18.04.7                    amd64        command-line interpreter for the PHP scripting language
rc  php7.2-common                          7.2.24-0ubuntu0.18.04.7                    amd64        documentation, examples and common module for PHP
rc  php7.2-curl                            7.2.24-0ubuntu0.18.04.7                    amd64        CURL module for PHP
rc  php7.2-gd                              7.2.24-0ubuntu0.18.04.7                    amd64        GD module for PHP
rc  php7.2-json                            7.2.24-0ubuntu0.18.04.7                    amd64        JSON module for PHP
rc  php7.2-ldap                            7.2.24-0ubuntu0.18.04.7                    amd64        LDAP module for PHP
rc  php7.2-mbstring                        7.2.24-0ubuntu0.18.04.7                    amd64        MBSTRING module for PHP
rc  php7.2-mysql                           7.2.24-0ubuntu0.18.04.7                    amd64        MySQL module for PHP
rc  php7.2-opcache                         7.2.24-0ubuntu0.18.04.7                    amd64        Zend OpCache module for PHP
rc  php7.2-readline                        7.2.24-0ubuntu0.18.04.7                    amd64        readline module for PHP
rc  php7.2-soap                            7.2.24-0ubuntu0.18.04.7                    amd64        SOAP module for PHP
rc  php7.2-sqlite3                         7.2.24-0ubuntu0.18.04.7                    amd64        SQLite3 module for PHP
rc  php7.2-xml                             7.2.24-0ubuntu0.18.04.7                    amd64        DOM, SimpleXML, WDDX, XML, and XSL module for PHP
rc  php7.2-xmlrpc                          7.2.24-0ubuntu0.18.04.7                    amd64        XMLRPC-EPI module for PHP
rc  php7.2-zip                             7.2.24-0ubuntu0.18.04.7                    amd64        Zip module for PHP
rc  php7.4-bz2                             7.4.3-4ubuntu2.4                           amd64        bzip2 module for PHP
ii  php7.4-cgi                             7.4.3-4ubuntu2.4                           amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php7.4-cli                             7.4.3-4ubuntu2.4                           amd64        command-line interpreter for the PHP scripting language
ii  php7.4-common                          7.4.3-4ubuntu2.4                           amd64        documentation, examples and common module for PHP
rc  php7.4-curl                            7.4.3-4ubuntu2.4                           amd64        CURL module for PHP
ii  php7.4-dev                             7.4.3-4ubuntu2.4                           amd64        Files for PHP7.4 module development
ii  php7.4-gd                              7.4.3-4ubuntu2.4                           amd64        GD module for PHP
ii  php7.4-json                            7.4.3-4ubuntu2.4                           amd64        JSON module for PHP
ii  php7.4-ldap                            7.4.3-4ubuntu2.4                           amd64        LDAP module for PHP
rc  php7.4-mbstring                        7.4.3-4ubuntu2.4                           amd64        MBSTRING module for PHP
rc  php7.4-mysql                           7.4.3-4ubuntu2.4                           amd64        MySQL module for PHP
ii  php7.4-opcache                         7.4.3-4ubuntu2.4                           amd64        Zend OpCache module for PHP
ii  php7.4-readline                        7.4.3-4ubuntu2.4                           amd64        readline module for PHP
ii  php7.4-soap                            7.4.3-4ubuntu2.4                           amd64        SOAP module for PHP
ii  php7.4-sqlite3                         7.4.3-4ubuntu2.4                           amd64        SQLite3 module for PHP
ii  php7.4-xml                             7.4.3-4ubuntu2.4                           amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php7.4-xmlrpc                          7.4.3-4ubuntu2.4                           amd64        XMLRPC-EPI module for PHP
rc  php7.4-zip                             7.4.3-4ubuntu2.4                           amd64        Zip module for PHP
rc  phpmyadmin                             4:4.9.5+dfsg1-2                            all          MySQL web administration tool
ii  pkg-php-tools                          1.38                                       all          various packaging tools and scripts for PHP packages


Not sure if it help but these are the ones on my Now working machine

The biggest difference to my 20.04 system is that “php-cgi” is missing in your system and you have installed the “libapache2-mod-php”
I checked with another 20.04 machine and there is no “mod-php” anymore present.
The site brings it’s own “mod_fcgid.so” and also loads this at startup.

Thanks for your help.
I just installed php-cgi and uninstalled libapache2-mod-php. But still no difference.

I uninstalled every php package that is not marked as dependency for checkmk, there is not much left now:

dpkg -l | grep php | grep ii

ii  libapache2-mod-php7.4                  7.4.3-4ubuntu2.4                           amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                             2:75                                       all          Common files for PHP packages
ii  php-pear                               1:1.10.9+submodules+notgz-1ubuntu0.20.04.2 all          PEAR Base System
ii  php7.4-cgi                             7.4.3-4ubuntu2.4                           amd64        server-side, HTML-embedded scripting language (CGI binary)
ii  php7.4-cli                             7.4.3-4ubuntu2.4                           amd64        command-line interpreter for the PHP scripting language
ii  php7.4-common                          7.4.3-4ubuntu2.4                           amd64        documentation, examples and common module for PHP
ii  php7.4-dev                             7.4.3-4ubuntu2.4                           amd64        Files for PHP7.4 module development
ii  php7.4-gd                              7.4.3-4ubuntu2.4                           amd64        GD module for PHP
ii  php7.4-json                            7.4.3-4ubuntu2.4                           amd64        JSON module for PHP
ii  php7.4-ldap                            7.4.3-4ubuntu2.4                           amd64        LDAP module for PHP
ii  php7.4-opcache                         7.4.3-4ubuntu2.4                           amd64        Zend OpCache module for PHP
ii  php7.4-readline                        7.4.3-4ubuntu2.4                           amd64        readline module for PHP
ii  php7.4-soap                            7.4.3-4ubuntu2.4                           amd64        SOAP module for PHP
ii  php7.4-sqlite3                         7.4.3-4ubuntu2.4                           amd64        SQLite3 module for PHP
ii  php7.4-xml                             7.4.3-4ubuntu2.4                           amd64        DOM, SimpleXML, XML, and XSL module for PHP
ii  php7.4-xmlrpc                          7.4.3-4ubuntu2.4                           amd64        XMLRPC-EPI module for PHP
ii  pkg-php-tools                          1.38                                       all          various packaging tools and scripts for PHP packages

Just found the time to do an update to p24. Still the same behaviour.

(partially) solved the problem.
Updated our test system to checkmk 2.0 with same behaviour.

Found out, that one of our maps seems to be the problem.
I removed all .cfg files under etc/nagvis/maps, including Automap.cfg. After that I could start nagvis and create a new Automap.
Moving cfg files back in place until nagvis stopped working again. One map was causing that no other map or nagvis itself could be opened. I will try to recreate the map in the next week(s).

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.