Bug 271662 - net-mgmt/icingaweb2: missing php{xx}-fileinfo dependency (for mime_content_type)
Summary: net-mgmt/icingaweb2: missing php{xx}-fileinfo dependency (for mime_content_type)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jochen Neumeister
URL:
Keywords:
Depends on:
Blocks: 273780
  Show dependency treegraph
 
Reported: 2023-05-26 22:06 UTC by Riccardo Torrini
Modified: 2023-10-03 08:00 UTC (History)
3 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 Riccardo Torrini 2023-05-26 22:06:17 UTC
[error] 53158#100708: *1007107 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function Icinga\Web\Controller\mime_content_type() in /usr/local/www/icingaweb2/library/Icinga/Web/Controller/StaticController.php:82

php function "mime_content_type()" is included into sysutils/php{xx}-fileinfo

how to reproduce:
# php -r 'echo mime_content_type("/etc/motd.template") . "\n";'
PHP Fatal error:  Uncaught Error: Call to undefined function mime_content_type() in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code on line 1

how to fix:
# pkg install php81-fileinfo
# php -r 'echo mime_content_type("/etc/motd.template") . "\n";'
text/plain

proposed fix (add "fileinfo" on line 20 of Makefile, between dom and gd):
--- /usr/ports/net-mgmt/icingaweb2/Makefile.orig        2023-05-13 18:40:19.077005000 +0200
+++ /usr/ports/net-mgmt/icingaweb2/Makefile     2023-05-27 00:01:28.321871000 +0200
@@ -16,9 +16,9 @@
                icinga-php-thirdparty${PHP_PKGNAMESUFFIX}>=0.11.0:net-mgmt/icinga-php-thirdparty@${PHP_FLAVOR} \
                icingaweb2-module-incubator${PHP_PKGNAMESUFFIX}>=0.18.0:net-mgmt/icingaweb2-module-incubator@${PHP_FLAVOR}
 
 USES=          php:build,web,flavors shebangfix
-USE_PHP=       bcmath bitset ctype curl dom gd gettext iconv ldap \
+USE_PHP=       bcmath bitset ctype curl dom fileinfo gd gettext iconv ldap \
                mbstring mcrypt memcache memcached opcache pdo \
                pdo_sqlite posix session simplexml soap sockets sqlite3 xml \
                zlib
Comment 1 Riccardo Torrini 2023-06-13 20:07:10 UTC
2023/06/13 10:00:19 [error] 35226#212048: *1925473 FastCGI sent in stderr: "PHP message: PHP 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

Found this morning, after an icinga2 update and restart.
Added php81-filter to fix this one.
Should I update my proposed patch to include also this?
Comment 2 Riccardo Torrini 2023-06-13 20:21:01 UTC
proposed fix 2 (include fix 1)
add "fileinfo" and "filter" on line 20 of Makefile, between dom and gd:

--- /usr/ports/net-mgmt/icingaweb2/Makefile.orig        2023-05-13 18:40:19.077005000 +0200
+++ /usr/ports/net-mgmt/icingaweb2/Makefile     2023-06-13 22:12:27.633857000 +0200
@@ -16,9 +16,9 @@
                icinga-php-thirdparty${PHP_PKGNAMESUFFIX}>=0.11.0:net-mgmt/icinga-php-thirdparty@${PHP_FLAVOR} \
                icingaweb2-module-incubator${PHP_PKGNAMESUFFIX}>=0.18.0:net-mgmt/icingaweb2-module-incubator@${PHP_FLAVOR}
 
 USES=          php:build,web,flavors shebangfix
-USE_PHP=       bcmath bitset ctype curl dom gd gettext iconv ldap \
+USE_PHP=       bcmath bitset ctype curl dom fileinfo filter gd gettext iconv ldap \
                mbstring mcrypt memcache memcached opcache pdo \
                pdo_sqlite posix session simplexml soap sockets sqlite3 xml \
                zlib
Comment 3 Florian Smeets freebsd_committer freebsd_triage 2023-06-16 23:33:29 UTC
(In reply to Riccardo Torrini from comment #2)
@Riccardo Thanks. I just ran into the same thing. I had already figured php81-filter out, but was still missing fileinfo. My monitoring is working again.
Comment 4 Denis Shaposhnikov 2023-06-18 12:06:43 UTC
I've got the same thing. Thanks for a quick fix.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-10-03 07:56:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4d94db2cfb7de05761b2df16c1e619cd31cabd83

commit 4d94db2cfb7de05761b2df16c1e619cd31cabd83
Author:     Palle Girgensohn <girgen@FreeBSD.org>
AuthorDate: 2023-09-28 13:43:10 +0000
Commit:     Palle Girgensohn <girgen@FreeBSD.org>
CommitDate: 2023-10-03 07:56:21 +0000

    net-mgmt/icingaweb2: fix problems running the application

    Icingaweb failed with stack traces when being accessed due to missing
    php module dependencies:
      mime_content_type requires fileinfo.
      Cron\filter_var requires filter.

    Also, icingaweb fails at access, missing Locale class, if built without
    the NLS option. Remove the NLS options, since it seems broken.

    PR:     271662

 net-mgmt/icingaweb2/Makefile | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
Comment 6 Palle Girgensohn freebsd_committer freebsd_triage 2023-10-03 07:59:21 UTC
Committed. Thanks!