After Icingaweb 2 was upgraded from 2.8.2 to 2.9.3 on an Ubuntu 20.04 machine, the user interface would not show up anymore. Instead a big PHP error was displayed:
Fatal error: Uncaught Error: Class 'Locale' not found in /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php:122 Stack trace: #0 /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php(87): ipl\I18n\Locale->parseLocale() #1 /usr/share/php/Icinga/Application/Web.php(514): ipl\I18n\Locale->getPreferred() #2 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(730): Icinga\Application\Web->detectLocale() #3 /usr/share/php/Icinga/Application/Web.php(105): Icinga\Application\ApplicationBootstrap->setupInternationalization() #4 /usr/share/php/Icinga/Application/ApplicationBootstrap.php(416): Icinga\Application\Web->bootstrap() #5 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\ApplicationBootstrap::start() #6 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...') #7 {main} thrown in /usr/share/icinga-php/ipl/vendor/ipl/i18n/src/Locale.php on line 122
By looking at the error message more closely, you can spot the i18n keyword in the stack trace path. This is short for internationalization (same way K8s is short for Kubernetes). Is this PHP package installed? Let's check:
root@icingaweb:~# dpkg -l|grep php7.4
ii libapache2-mod-php7.4 7.4.3-4ubuntu2.6 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php7.4 7.4.3-4ubuntu2.6 all server-side, HTML-embedded scripting language (metapackage)
ii php7.4-cli 7.4.3-4ubuntu2.6 amd64 command-line interpreter for the PHP scripting language
ii php7.4-common 7.4.3-4ubuntu2.6 amd64 documentation, examples and common module for PHP
ii php7.4-curl 7.4.3-4ubuntu2.6 amd64 CURL module for PHP
ii php7.4-fpm 7.4.3-4ubuntu2.6 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary)
ii php7.4-json 7.4.3-4ubuntu2.6 amd64 JSON module for PHP
ii php7.4-ldap 7.4.3-4ubuntu2.6 amd64 LDAP module for PHP
ii php7.4-mbstring 7.4.3-4ubuntu2.6 amd64 MBSTRING module for PHP
ii php7.4-mysql 7.4.3-4ubuntu2.6 amd64 MySQL module for PHP
ii php7.4-opcache 7.4.3-4ubuntu2.6 amd64 Zend OpCache module for PHP
ii php7.4-readline 7.4.3-4ubuntu2.6 amd64 readline module for PHP
ii php7.4-soap 7.4.3-4ubuntu2.6 amd64 SOAP module for PHP
Nope, the php7.4-intl package is missing. Let's install that:
root@icingaweb:~# apt-get install php7.4-intl
Followed by a restart of PHP-FPM.
Note: If your Icingaweb2 installation is using PHP as Apache module mod_php, restart Apache2 instead.
root@icingaweb:~# systemctl restart php7.4-fpm
Now the user interface showed up again, but the Dashboard showed yet another PHP error:
This time another class "DOMImplementation" was not found:
Fatal error: Uncaught Error: Class 'DOMImplementation' not found in /usr/share/php/Icinga/Chart/SVGRenderer.php:127\nStack trace:\n#0 /usr/share/php/Icinga/Chart/SVGRenderer.php(231): Icinga\\Chart\\SVGRenderer->createRootDocument()\n#1 /usr/share/php/Icinga/Chart/Chart.php(127): Icinga\\Chart\\SVGRenderer->render()\n#2 /usr/share/php/Icinga/Web/Widget/Chart/InlinePie.php(245): Icinga\\Chart\\Chart->render()\n#3 /usr/share/icingaweb2/modules/monitoring/application/views/helpers/Perfdata.php(67): Icinga\\Web\\Widget\\Chart\\InlinePie->render()\n#4 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(345): Zend_View_Helper_Perfdata->perfdata()\n#5 /usr/share/php/Icinga/Web/View.php(251): Zend_View_Abstract->__call()\n#6 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/list/services.phtml(117): Icinga\\Web\\View->__call()\n#7 /usr/share/php/Icinga/Web/View.php(235): include('/usr/share/icin...')\n#8 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\\Web\\View...',
According to an issue reported back in 2017, this has to do with yet another missing PHP module, php-xml this time. Let's install that one, too:
root@icingaweb:~# apt-get install php7.4-xml
root@icingaweb:~# systemctl restart php7.4-fpm
After the PHP-FPM restart the errors were gone and the Icingaweb2 UI worked fine again.
Interesting though, that this has worked prior to the Icingaweb2 package upgrade.
plao from wrote on Aug 10th, 2022:
Thanks a lot!
zy from wrote on Jul 25th, 2022:
Thank you, helped us alot today.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder