PHP 8.x Fatal Error when Announcement is set
Opened this issue · 3 comments
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
- Create an announcement in icingaweb2.
- Log out of icingaweb2 and clear cookies and cache.
- Try logging back in.
- Login fails, the above PHP Fatal Error is shown.
Expected behavior
Login should work, the icingaweb2 dashboard should be displayed.
Your Environment
- Icinga Web 2 version and modules (System - About):
Icinga Web 2 Version 2.12.1
Git commit cd2daeb2cb8537c633d343a29eb76c54cd2ebbf2
PHP Version 8.3.3-1+0~20240216.17+debian10~1.gbp87e37b
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
# cat /etc/icingaweb2/announcements.ini
[65ec81ff31c43]
author = "admin"
message = "test"
start = "1709998800"
end = "1709999100"
hash = "098f6bcd4621d373cade4e832627b4f6"
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
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.
I'm afraid you'll have to, at least to get updates. We've stopped building packages for both Debian 10 and Raspbian x32.