Icingaweb2: Icingaweb2 Fatal Error directly after installation on Ubuntu 18.04

Created on 15 May 2018  Â·  25Comments  Â·  Source: Icinga/icingaweb2

After installing Icinga2+Icingaweb2 and going to /icingaweb2/setup, the fatal error appears:

Fatal error: Uncaught ErrorException: Uncaught ErrorException: session_name(): Cannot change session name when session is active in /usr/share/php/Icinga/Web/Session/PhpSession.php:97 Stack trace: #0 [internal function]: Icinga\Application\ApplicationBootstrap->Icinga\Application{closure}(2, 'session_name():...', '/usr/share/php/...', 97, Array) #1 /usr/share/php/Icinga/Web/Session/PhpSession.php(97): session_name('Icingaweb2') #2 /usr/share/php/Icinga/Web/Session/PhpSession.php(152): Icinga\Web\Session\PhpSession->open() #3 /usr/share/php/Icinga/Web/Controller/ActionController.php(540): Icinga\Web\Session\PhpSession->write() #4 /usr/share/php/Icinga/Web/Controller/ActionController.php(490): Icinga\Web\Controller\ActionController->shutdownSession() #5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(512): Icinga\Web\Controller\ActionController->postDispatch() #6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('errorAction') #7 /usr/share/icingaweb2/library/vendor/Z in /usr/share/icingaweb2/library/vendor/Zend/Controller/Plugin/Broker.php on line 259

icinga2 (version: r2.8.4-1)

ii icingaweb2 2.5.3-1.bionic
ii icingaweb2-common 2.5.3-1.bionic
ii icingaweb2-module-doc 2.5.3-1.bionic
ii icingaweb2-module-monitoring 2.5.3-1.bionic

php 7.2

Steps to Reproduce (for bugs)

  1. wget -O - http://packages.icinga.com/icinga.key | apt-key add -
  2. add-apt-repository 'deb http://packages.icinga.com/ubuntu icinga-bionic main'
  3. apt-get install icingaweb2 libapache2-mod-php icingacli
  4. visit http:///icingaweb2/setup
duplicate

Most helpful comment

It happened to me on Ubuntu with php7.2, updating from Github worked in my case:

cd /usr/share
cp -r icingaweb2 old.icingaweb2
cd icingaweb2
git init
git remote add origin [email protected]:Icinga/icingaweb2.git
git fetch origin
git reset --hard origin/master
git checkout master

All 25 comments

Duplicate of #3185

Got the same problem after my update from Artful to Bionic.
After the upgrade, Icinga still runs with a php7.1 but I didn't have anymore the php7.1-curl package so I have this error when I try to execute a check manually :

icinga2: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL'.

0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php(70): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand))

1 /usr/share/php/Icinga/Web/Form.php(1154): Icinga\Module\Monitoring\Forms\Command\Object\CheckNowCommandForm->onSuccess()

2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(264): Icinga\Web\Form->handleRequest()

3 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(59): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->setupQuickActionForms()

4 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(66): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->showAction()

5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ServiceController->showAction()

6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)

7 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\WebResponse))

8 /usr/share/php/Icinga/Application/Web.php(409): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\WebResponse))

9 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()

10 /usr/share/icingaweb2/public/index.php(7): require_once(String)

11 {main}

After setting my apache to php7.1 to php7.2, I have the same error as @MarcusCaepio

Be carefull when migrating to 18.04 !!!!!!
I'm waiting for the fix now ! :)

Fixed in the master branch and snapshot packages. Version 2.6.0 which includes this fix will be released in roughly one month.

I switched to the bionic snapshot packages, but the error still remains. https://github.com/Icinga/icingaweb2/pull/3315 is not present in the snapshot packages as far as i can see.

Similar for me as well, testing out upgrade from 16.04 to 18.04. After the upgrade, I have to re-enable php for Apache ("a2enmod php7.2"), but now am getting the same error as listed above (session error immediately after logging in).

I updated my icinga.list sources file to use icinga-bionic (instead of icinga-xenial).

apt update shows everything is up to date.

Icinga2 CLI output shows it is currently running 2.8.4-1

Similar problems for me.

Install on Ubuntu 18.04 using the snapshot repositories.

localadmin@nms01:/etc/php/7.2/apache2$ apt-cache policy icinga2
icinga2:
  Installed: 2.8.4+759.geb1f37905.2018.06.18+1.bionic-0
  Candidate: 2.8.4+759.geb1f37905.2018.06.18+1.bionic-0
  Version table:
 *** 2.8.4+759.geb1f37905.2018.06.18+1.bionic-0 500
        500 http://packages.icinga.com/ubuntu icinga-bionic-snapshots/main amd64 Packages
        100 /var/lib/dpkg/status
     2.8.4+759.geb1f37905.2018.06.15+1.bionic-0 500
        500 http://packages.icinga.com/ubuntu icinga-bionic-snapshots/main amd64 Packages
     2.8.4-1.bionic 500
        500 http://packages.icinga.com/ubuntu icinga-bionic/main amd64 Packages
     2.8.1-0ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
localadmin@nms01:/etc/php/7.2/apache2$ apt-cache policy icingaweb2
icingaweb2:
  Installed: 2.5.3.2018.04.30+1.bionic-0
  Candidate: 2.5.3.2018.04.30+1.bionic-0
  Version table:
 *** 2.5.3.2018.04.30+1.bionic-0 500
        500 http://packages.icinga.com/ubuntu icinga-bionic-snapshots/main amd64 Packages
        100 /var/lib/dpkg/status
     2.5.3-1.bionic 500
        500 http://packages.icinga.com/ubuntu icinga-bionic/main amd64 Packages
     2.4.1-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

Receiving this error accessing icingaweb2/setup

Fatal error: Uncaught ErrorException: Uncaught ErrorException: session_name(): Cannot change session name when session is active in /usr/share/php/Icinga/Web/Session/PhpSession.php:97 Stack trace: #0 [internal function]: Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(2, 'session_name():...', '/usr/share/php/...', 97, Array) #1 /usr/share/php/Icinga/Web/Session/PhpSession.php(97): session_name('Icingaweb2') #2 /usr/share/php/Icinga/Web/Session/PhpSession.php(152): Icinga\Web\Session\PhpSession->open() #3 /usr/share/php/Icinga/Web/Controller/ActionController.php(540): Icinga\Web\Session\PhpSession->write() #4 /usr/share/php/Icinga/Web/Controller/ActionController.php(490): Icinga\Web\Controller\ActionController->shutdownSession() #5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(512): Icinga\Web\Controller\ActionController->postDispatch() #6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('errorAction') #7 /usr/share/icingaweb2/library/vendor/Z in /usr/share/icingaweb2/library/vendor/Zend/Controller/Plugin/Broker.php on line 259

What's the workaround? Can we force Icinga2/Icingaweb2 to use PHP7.1 somehow?

Seems like the snapshot packages are outdated. We'll have a look. Thanks for the reports guys.

Hi,
I still have the same problem. How can I fix it ?
Thx 😃

@minas7111 I just temporarily downgraded to php7.1 using the method in this serverfault answer. works great!
https://serverfault.com/a/895912

@louis-lau

Did you run into any issues after downgrading to 7.1? I followed the article you linked, but now am getting a different error when logging in. Restarted the box as well just to make sure any changes took.

 Uncaught Error: Call to undefined function Icinga\Protocol\Ldap\ldap_connect() in /usr/share/php/Icinga/Protocol/Ldap/LdapConnection.php:1198
Stack trace:
#0 /usr/share/php/Icinga/Protocol/Ldap/LdapConnection.php(243): Icinga\Protocol\Ldap\LdapConnection->prepareNewConnection()
#1 /usr/share/php/Icinga/Protocol/Ldap/LdapCapabilities.php(308): Icinga\Protocol\Ldap\LdapConnection->getConnection()
#2 /usr/share/php/Icinga/Protocol/Ldap/LdapConnection.php(258): Icinga\Protocol\Ldap\LdapCapabilities::discoverCapabilities(Object(Icinga\Protocol\Ldap\LdapConnection))
#3 /usr/share/php/Icinga/Authentication/User/LdapUserBackend.php(238): Icinga\Protocol\Ldap\LdapConnection->getCapabilities()
#4 /usr/share/php/Icinga/Repository/Repository.php(346): Icinga\Authentication\User\LdapUserBackend->initializeQueryColumns()
#5 /usr/share/php/Icinga/Repository/Repository.php(299): Icinga\Repository\Repository->getQueryColumns()
#6 /usr/share/php/Icinga/Repository/Repository.php(704): Icinga\Repository\Repository->getBaseTable(

#0 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}()
#1 {main}

If I un-do the changes and go back to 7.2, am back to the original bug/error about not able to change session. If the Icinga team is still on track to have the next update out soon, we may sit tight. Monitoring itself (Icinga backend) is working correctly and sending us alerts when needed, we just can't use the Web portion for visual monitoring, changing hosts/services, setting downtimes, etc.

Hi,

You may be running php7.2 addon packages alongside php7.1.

I had to use the specific php71 packages for every php addon like LDAP,
postgres etc.

It was all a bit messy.

Best regards,

Adam Parker

On Tue, 26 Jun 2018, 15:08 pillbug22, notifications@github.com wrote:

@louis-lau https://github.com/louis-lau

Did you run into any issues after downgrading to 7.1? I followed the
article you linked, but now am getting a different error when logging in.
Restarted the box as well just to make sure any changes took.

Uncaught Error: Call to undefined function Icinga\Protocol\Ldap\ldap_connect() in /usr/share/php/Icinga/Protocol/Ldap/LdapConnection.php:1198
Stack trace:

0 /usr/share/php/Icinga/Protocol/Ldap/LdapConnection.php(243): Icinga\Protocol\Ldap\LdapConnection->prepareNewConnection()

1 /usr/share/php/Icinga/Protocol/Ldap/LdapCapabilities.php(308): Icinga\Protocol\Ldap\LdapConnection->getConnection()

2 /usr/share/php/Icinga/Protocol/Ldap/LdapConnection.php(258): Icinga\Protocol\Ldap\LdapCapabilities::discoverCapabilities(Object(Icinga\Protocol\Ldap\LdapConnection))

3 /usr/share/php/Icinga/Authentication/User/LdapUserBackend.php(238): Icinga\Protocol\Ldap\LdapConnection->getCapabilities()

4 /usr/share/php/Icinga/Repository/Repository.php(346): Icinga\Authentication\User\LdapUserBackend->initializeQueryColumns()

5 /usr/share/php/Icinga/Repository/Repository.php(299): Icinga\Repository\Repository->getQueryColumns()

6 /usr/share/php/Icinga/Repository/Repository.php(704): Icinga\Repository\Repository->getBaseTable(

0 [internal function]: Icinga\Application\Web->Icinga\Application{closure}()

1 {main}

If I un-do the changes and go back to 7.2, am back to the original
bug/error about not able to change session. If the Icinga team is still on
track to have the next update out soon, we may sit tight. Monitoring itself
(Icinga backend) is working correctly and sending us alerts when needed, we
just can't use the Web portion for visual monitoring, changing
hosts/services, setting downtimes, etc.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Icinga/icingaweb2/issues/3459#issuecomment-400322121,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJSwwrnS6Vraw2aWWbWaQmR2Ob8Mw_Owks5uAkBTgaJpZM4T_W4V
.

@pillbug22 I did this as well:

apt install php7.1-ldap php7.1-intl php7.1-dom php7.1-gd php7.1-Imagick php7.1-curl

That makes sense - I didn't check the list of extras installed with the ServerFault article.

I added the ones you listed here and am now able to login. Thanks for the kick in the pants. If I run into any other errors along the way, will try to match up installed mods against what was installed with IcingaWeb.

Thinking about being proactive, is there an easy way to pull the list of extra modules currently installed so I could compare installed 7.1 modules against installed 7.2 modules?

Hello is the problem solved in php 7.2 ? I still get the error
Fatal error: Uncaught ErrorException: Uncaught ErrorException: session_name().....

my setup
icinga2 - The Icinga 2 network monitoring daemon (version: v2.8.4-814-gebd9d45a9)

Copyright (c) 2012-2018 Icinga Development Team (https://www.icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://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.

Application information:
Installation root: /usr
Sysconf directory: /etc
Run directory: /run
Local state directory: /var
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

System information:
Platform: Ubuntu
Platform version: 18.04 LTS (Bionic Beaver)
Kernel: Linux
Kernel version: 4.15.0-23-generic
Architecture: x86_64

Build information:
Compiler: GNU 7.3.0
Build host: 061f6ff64726

php -v
PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul 4 2018 16:55:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.7-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies

icingaweb2 Version (2.5.3.2018.04.30+1.bionic-0).

@pillbug22 seeing as the last comment was a week ago, no commits mention this issue yet, and you're getting the exact same error. I'd say no, it's probably not solved yet :P.

You could try downgrading to php7.1 like us as a temporary solution.

---- EDIT
I'm sorry, I meant @hansju

Isn't the new release of icinga (and icingaweb(?) Coming these days? Milestone of icinga2 2.9 due is tomorrow

You're right, did some looking and it looks like it's been fixed as of icingaweb release 2.6. Which should be the next release, but as of now it's still not fixed.

Milestone of icinga2 2.9 due is tomorrow

Updated to next week, thanks for the reminder.

please some news about this bug
tnx

Guys, you may have to remove your snapshot packages and then reinstall them. We had a bug in our build server which did not include the commit id in snapshot 2.5.3.2018.04.30+1.bionic-0 or alike and thus is always newer than our current snapshots.

It happened to me on Ubuntu with php7.2, updating from Github worked in my case:

cd /usr/share
cp -r icingaweb2 old.icingaweb2
cd icingaweb2
git init
git remote add origin [email protected]:Icinga/icingaweb2.git
git fetch origin
git reset --hard origin/master
git checkout master

The above by @pini-girit worked for me, with the slight change of using the https version of the remote by changing git remote add origin [email protected]:Icinga/icingaweb2.git to git remote add origin https://github.com/Icinga/icingaweb2.git

Experienced the same issue. The previous step worked for me. @pniel-cohen worked from me. used
git remote add origin https://github.com/Icinga/icingaweb2.git

thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

icinga-migration picture icinga-migration  Â·  6Comments

mateusz-gozdek-sociomantic picture mateusz-gozdek-sociomantic  Â·  4Comments

Christiaan-Liebenberg picture Christiaan-Liebenberg  Â·  7Comments

theFeu picture theFeu  Â·  4Comments

josy1024 picture josy1024  Â·  8Comments