Bug 273780 - net-mgmt/icingaweb2: fatal error: call to undefined function Cron\filter_var() in AbstractField.php:290
Summary: net-mgmt/icingaweb2: fatal error: call to undefined function Cron\filter_var(...
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Jochen Neumeister
URL:
Keywords: crash
: 273781 (view as bug list)
Depends on: 275720 271662
Blocks:
  Show dependency treegraph
 
Reported: 2023-09-14 12:58 UTC by itwrx
Modified: 2023-12-12 12:37 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (joneum)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description itwrx 2023-09-14 12:58:07 UTC
Freshly created Jail with 13.2p3 having installed icingaweb2-php82 running: 


root@web:/usr/local/www/icingaweb2 # cd /usr/local/www/icingaweb2 && ./bin/icingacli setup config webserver nginx \
? --path=/icingaweb2 --root=/usr/local/www/icingaweb2/public --config=/usr/local/etc/icingaweb2 \
? --file=/tmp/nginx.conf

Results in

Fatal error: Uncaught Error: Call to undefined function Cron\filter_var() in /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php:290
Stack trace:
#0 /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php(230): Cron\AbstractField->validate('*/3')
#1 /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php(212): Cron\CronExpression->setPart(3, '*/3')
#2 /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php(187): Cron\CronExpression->setExpression('0 0 1 */3 *')
#3 /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php(91): Cron\CronExpression->__construct('0 0 1 */3 *')
#4 /usr/local/www/icingaweb2/icinga-php/library/vendor/ipl/scheduler/src/register_cron_aliases.php(10): Cron\CronExpression::registerAlias('@quarterly', '0 0 1 */3 *')
#5 /usr/local/www/icingaweb2/icinga-php/library/vendor/composer/autoload_real.php(41): require('/usr/local/www/...')
#6 /usr/local/www/icingaweb2/icinga-php/library/vendor/composer/autoload_real.php(45): {closure}('8e4ccce73649a2b...', '/usr/local/www/...')
#7 /usr/local/www/icingaweb2/icinga-php/library/vendor/autoload.php(25): ComposerAutoloaderInit4b54b89637b513998e2a3c6fdc91f8cc::getLoader()
#8 /usr/local/www/icingaweb2/library/Icinga/Application/Libraries/Library.php(177): require_once('/usr/local/www/...')
#9 /usr/local/www/icingaweb2/library/Icinga/Application/ApplicationBootstrap.php(543): Icinga\Application\Libraries\Library->registerAutoloader()
#10 /usr/local/www/icingaweb2/library/Icinga/Application/Cli.php(41): Icinga\Application\ApplicationBootstrap->loadLibraries()
#11 /usr/local/www/icingaweb2/library/Icinga/Application/ApplicationBootstrap.php(416): Icinga\Application\Cli->bootstrap()
#12 /usr/local/www/icingaweb2/bin/icingacli(7): Icinga\Application\ApplicationBootstrap::start()
#13 {main}
  thrown in /usr/local/www/icingaweb2/icinga-php/library/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php on line 290
Comment 1 Graham Perrin 2023-09-14 13:02:16 UTC
*** Bug 273781 has been marked as a duplicate of this bug. ***
Comment 2 Palle Girgensohn freebsd_committer freebsd_triage 2023-09-28 12:29:33 UTC
I have the same problem.

Did you build with php 8.2?
icingaweb2 is does not support PHP-8.2 until version 2.12 [https://github.com/Icinga/icingaweb2/releases]

I trying downgrade to PHP-8.1 to see it that works.
Comment 3 Palle Girgensohn freebsd_committer freebsd_triage 2023-10-03 08:00:26 UTC
See if the just pushed fix from PR#271662 helps.
Comment 4 Tilman Keskinoz freebsd_committer freebsd_triage 2023-11-24 09:15:43 UTC
Still a problem with fix from 271662. So looks like some other dependency is missing :-(
Comment 5 Palle Girgensohn freebsd_committer freebsd_triage 2023-11-24 10:11:57 UTC
I just installed

pkg install icingaweb2-php82
pkg install nginx

and then

cd /usr/local/www/icingaweb2
# ./bin/icingacli setup config webserver nginx --path=/icingaweb2 --root=/usr/local/www/icingaweb2/public --config=/usr/local/etc/icingaweb2 --file=/tmp/nginx.conf
#

no problem. What is happening for you? Which version did you install?

# pkg info -Ix icinga
icinga-php-library-php82-0.12.0 Icinga PHP library
icinga-php-thirdparty-php82-0.11.0 Icinga PHP thirdparty
icingaweb2-module-incubator-php82-0.20.0 Incubator provides bleeding-edge libraries
icingaweb2-php82-2.12.0        Next generation web interface for Icinga 1 and 2
Comment 6 Tilman Keskinoz freebsd_committer freebsd_triage 2023-11-24 10:27:17 UTC
%  pkg info -Ix icinga
icinga-php-library-php81-0.12.0 Icinga PHP library
icinga-php-thirdparty-php81-0.11.0 Icinga PHP thirdparty
icinga2-2.14.0_2               Monitoring and management system for hosts, services and networks
icingaweb2-module-incubator-php81-0.20.0 Incubator provides bleeding-edge libraries
icingaweb2-php81-2.12.0        Next generation web interface for Icinga 1 and 2

Hm, tried again and now it is again my previous error: 

PHP Fatal error:  Uncaught Error: Class "Zend_Controller_Request_Http" not found in /usr/local/www/icingaweb2/library/Icinga/Web/Request.php:14

So yes maybe this one is fixed and I should open a new one.
Comment 7 Palle Girgensohn freebsd_committer freebsd_triage 2023-11-24 10:44:52 UTC
(In reply to Tilman Keskinoz from comment #6)
What happens if you instead install for php82?
Comment 8 Tilman Keskinoz freebsd_committer freebsd_triage 2023-11-24 10:52:42 UTC
same error message. (tried php83 also)
Comment 9 Palle Girgensohn freebsd_committer freebsd_triage 2023-11-24 16:13:59 UTC
(In reply to Tilman Keskinoz from comment #8)
did you build php with ZEND options? Perhaps this is a problem with the PHP package?

I can't reproduce the exact problem you're describing, but if I just try to interpret that class, /usr/local/www/icingaweb2/library/Icinga/Web/Request.php, it fails with the same error. The Zend_Controller_Request_Http class seems not to exist. I don't if it should really in that context either, with no environment set up.

You mentioned you started with a fresh jail. Nothing installed or configured out of the ordinary?

How do you install your packages. From which repo? OR from source?
Comment 10 Tilman Keskinoz freebsd_committer freebsd_triage 2023-11-24 16:54:26 UTC
hah, I am not the only one -> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=275289 
Also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274653 might fix it..*trying*
Comment 11 Palle Girgensohn freebsd_committer freebsd_triage 2023-11-24 16:58:23 UTC
How do you install your packages. From which repo? OR from source?
Comment 12 Tilman Keskinoz freebsd_committer freebsd_triage 2023-11-24 17:01:11 UTC
I use official binary packages.

Manually doing the upgrade of icinga-php-thirdparty to 0.12.0, icingaweb is working again, though I get the same problems as in the PR.
Comment 13 O. Hartmann 2023-12-12 12:37:39 UTC
Recently I tried to evade the most recent problems via setting up an alternative Icingaweb2 instance, this time using FreeBSD 14.0-RELEASE-p2 from the official sites as well as the official FreeBSD packages repository designated "latest" for FBSD 14.0.

Several icingaweb2 modules depend on a more recent version of port
icinga-php-library-php82-0.12.0, for instance 

icingaweb2-module-icingadb-php82

which is supposed the successor of icinga2 inherent module monitoring. Other modules, like grafana, x509, depend in the vain of the new "latest" modules on the more recent

icinga-php-library-php82-0.13.0 variant. But this important module isn't present!

Moreover, a fresh installation of icingaweb2 with official repositories and usage of pkg repo "latest" renders the icingaweb2 installation corrupt, I checked this on at least two new installations (always using an existing icinga2 master/DB installation - without icingadb!).
Ebabling/disabling modules renders the left-hand menu column unusable showing up an error like

[...]
Deprecated: Creation of dynamic property ipl\Sql\Config::$type is deprecated in 
/usr/local/www/icingaweb2/icinga-php/library/vendor/ipl/sql/src/Config.php on line 32 

Which also shows up on a variant of occassion during normal use of the icingaweb2 interface.