Icinga / icingaweb2

A lightweight and extensible web interface to keep an eye on your environment. Analyse problems and act on them.
https://icinga.com/get-started/
GNU General Public License v2.0
806 stars 279 forks source link

PHP 8.x Fatal Error when Announcement is set #5194

Closed niemalsnever closed 1 month ago

niemalsnever commented 7 months ago

Describe the bug

Login fails after an announcement is set in IcingaWeb2, when using PHP-FPM 8.2 or 8.3, works with PHP-FPM 7.4. The following PHP Fatal Error is shown at login:

Fatal error
: Uncaught TypeError: setcookie(): Argument #3 ($expires_or_options) must be of type array|int, float given in /usr/share/icingaweb2/library/Icinga/Web/Response.php:421 Stack trace: #0 /usr/share/icingaweb2/library/Icinga/Web/Response.php(421): setcookie() #1 /usr/share/icingaweb2/library/Icinga/Web/Response.php(440): Icinga\Web\Response->sendCookies() #2 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Response/Abstract.php(768): Icinga\Web\Response->sendHeaders() #3 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(992): Zend_Controller_Response_Abstract->sendResponse() #4 /usr/share/icingaweb2/library/Icinga/Application/Web.php(461): Zend_Controller_Front->dispatch() #5 [internal function]: Icinga\Application\Web->Icinga\Application\{closure}() #6 {main} thrown in
/usr/share/icingaweb2/library/Icinga/Web/Response.php
on line
421

If /etc/icingaweb2/announcements.ini is removed, the login works again.

To Reproduce

  1. Create an announcement in icingaweb2.
  2. Log out of icingaweb2 and clear cookies and cache.
  3. Try logging back in.
  4. Login fails, the above PHP Fatal Error is shown.

Expected behavior

Login should work, the icingaweb2 dashboard should be displayed.

Your Environment

Loaded Libraries icinga/icinga-php-thirdparty 0.12.1 icinga/icinga-php-library 0.13.1 Loaded Modules director 1.11.1 doc 2.12.1 fileshipper 1.2.0 incubator 0.21.0 monitoring 2.12.1 x509 1.3.2

* Web browser used: Mozilla Firefox 123.0
* Icinga 2 version used (`icinga2 --version`): 2.13.6-1
* PHP version used (`php --version`): 8.3.3-1+0\~20240216.17+debian10\~1.gbp87e37b
* Server operating system and version: Raspbian Buster
* Webserver: nginx/1.14.2

## Additional context
```bash
# cat /etc/icingaweb2/announcements.ini
[65ec81ff31c43]
author = "admin"
message = "test"
start = "1709998800"
end = "1709999100"
hash = "098f6bcd4621d373cade4e832627b4f6"
moreamazingnick commented 6 months ago

can you reproduce this issue with another browser for example chrome? is your OS a 32bit or 64 bit os? if it is buster 32bit / arm can you try again with the 64 OS. here is a link to a post that might help installing a 64 bit OS. https://community.icinga.com/t/icinga-web-2-history-is-empty-with-no-items-found/13164/5

niemalsnever commented 6 months ago

can you reproduce this issue with another browser for example chrome?

Yes, I can reproduce it in Chrome and Edge. Though I fail to understand how a Fatal PHP Error, which occurs on the server should be client/browser dependent.

is your OS a 32bit or 64 bit os? if it is buster 32bit / arm can you try again with the 64 OS. here is a link to a post that might help installing a 64 bit OS. https://community.icinga.com/t/icinga-web-2-history-is-empty-with-no-items-found/13164/5

It's 32bit. Since I don't want to reinstall my entire system, I cannot easily upgrade to a 64bit OS.

Al2Klimov commented 3 months ago

I'm afraid you'll have to, at least to get updates. We've stopped building packages for both Debian 10 and Raspbian x32.

nilmerg commented 1 month ago

This is clearly related to the OS being 32bit. Fixing this exact problem might be easy, but you'll run into other issues for sure. One has already been mentioned.

So, plan an upgrade to 64bit ;)