Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Froxlor\PhpHelper #1103

Closed
ralffrey opened this issue Feb 28, 2023 · 9 comments
Closed
Assignees
Milestone

Comments

@ralffrey
Copy link

The daily Cron Message is:
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Froxlor\PhpHelper::sizeReadable() must be of the type int, float given, called in /var/www/html/froxlor/lib/Froxlor/Cron/Traffic/ReportsCron.php on line 102 and defined in /var/www/html/froxlor/lib/Froxlor/PhpHelper.php:333
Stack trace:
#0 /var/www/html/froxlor/lib/Froxlor/Cron/Traffic/ReportsCron.php(102): Froxlor\PhpHelper::sizeReadable()
#1 /var/www/html/froxlor/lib/Froxlor/Cli/MasterCron.php(134): Froxlor\Cron\Traffic\ReportsCron::run()
#2 /var/www/html/froxlor/vendor/symfony/console/Command/Command.php(298): Froxlor\Cli\MasterCron->execute()
#3 /var/www/html/froxlor/vendor/symfony/console/Application.php(1024): Symfony\Component\Console\Command\Command->run()
#4 /var/www/html/froxlor/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#5 /var/www/html/froxlor/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#6 /var/www/html/froxlor/bin/froxlor-cli(64): Symfony\Component\Conso in /var/www/html/froxlor/lib/Froxlor/PhpHelper.php on line 333

Probably since the last PHP update

System information

  • Froxlor version: 2.0.12-1
  • Web server: apache2
  • DNS server: hosted
  • POP/IMAP server: Dovecot
  • SMTP server: postfix
  • FTP server: proftpd
  • OS/Version: Debian GNU/Linux 11 (bullseye)
  • PHP Version: 7.4.33

my english is bad - sorry

@d00p d00p self-assigned this Feb 28, 2023
@d00p d00p added this to the 2.0.x milestone Feb 28, 2023
@d00p d00p closed this as completed in bf7d22a Feb 28, 2023
@ralffrey
Copy link
Author

ralffrey commented Mar 1, 2023

Thank you, now the new error message:
(Danke, nun ist die neue Fehlermeldung:)

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Froxlor\PhpHelper::sizeReadable() must be of the type int, float given, called in /var/www/html/froxlor/lib/Froxlor/Cron/Traffic/ReportsCron.php on line 270 and defined in /var/www/html/froxlor/lib/Froxlor/PhpHelper.php:333
Stack trace:
#0 /var/www/html/froxlor/lib/Froxlor/Cron/Traffic/ReportsCron.php(270): Froxlor\PhpHelper::sizeReadable()
#1 /var/www/html/froxlor/lib/Froxlor/Cli/MasterCron.php(134): Froxlor\Cron\Traffic\ReportsCron::run()
#2 /var/www/html/froxlor/vendor/symfony/console/Command/Command.php(298): Froxlor\Cli\MasterCron->execute()
#3 /var/www/html/froxlor/vendor/symfony/console/Application.php(1024): Symfony\Component\Console\Command\Command->run()
#4 /var/www/html/froxlor/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#5 /var/www/html/froxlor/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#6 /var/www/html/froxlor/bin/froxlor-cli(64): Symfony\Component\Conso in /var/www/html/froxlor/lib/Froxlor/PhpHelper.php on line 333

Should I open a new topic or will this be reopened?
(Soll ich eine neue Thema aufmachen oder wird das hier wieder aufgemacht?)

best regards
(beste Grüße)
Ralf

@d00p d00p reopened this Mar 1, 2023
@d00p
Copy link
Member

d00p commented Mar 1, 2023

Did you update to latest git main? The line 270 (see bf7d22a#diff-1235cb1c90c7cabb68d19cc26c6196f1841a83a630a66e17b48c19ceb6addf48L272) uses the variable $t which (see bf7d22a#diff-1235cb1c90c7cabb68d19cc26c6196f1841a83a630a66e17b48c19ceb6addf48R266) is cast to an integer. I wonder how one gets float values from integer byte values at all. Never ran into this issue

@ralffrey
Copy link
Author

ralffrey commented Mar 1, 2023

yes, I have used the two files.
Now still in line 270 (and following) changed:
sizeReadable($t to sizeReadable((int)$t
now everything seems to be OK.

This seems to have started after the last PHP update. So after the update here:
apticron report [Sun, 19 Feb 2023 06:55:11 +0100] ========================================================================

apticron has detected that some packages need upgrading on:

m6s14.vlinux.de 
[ 83.151.27.176 ]

The following packages are currently pending an upgrade:

froxlor 2.0.12-1
libapache2-mod-php7.4 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
libapache2-mod-php8.2 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php7.4-bz2 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-cli 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-common 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-curl 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-gd 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-intl 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-json 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-ldap 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-mbstring 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-mysql 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-opcache 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-phpdbg 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-readline 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-soap 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-tidy 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-xml 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php7.4-xmlrpc 1:7.4.33-5+0~20230214.77+debian11~1.gbpa1ea7f
php8.2-bcmath 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-bz2 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-cli 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-common 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-curl 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-gd 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-gmp 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-imap 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-mbstring 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-mysql 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-opcache 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-phpdbg 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-readline 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-soap 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-xml 8.2.3-1+0~20230214.16+debian11~1.gbpd66462
php8.2-zip 8.2.3-1+0~20230214.16+debian11~1.gbpd66462

========================================================================

Package Details:

apt-listchanges: Changelogs werden gelesen...
apt-listchanges: Changelogs

@d00p
Copy link
Member

d00p commented Mar 1, 2023

Now still in line 270 (and following) changed:
sizeReadable($t to sizeReadable((int)$t
now everything seems to be OK.

That does not make sense, $t is typecasted to int already and not changed before usage

@ralffrey
Copy link
Author

ralffrey commented Mar 1, 2023

I am not a PHP professional
The cron now generates e.g. 2 emails again as follows:

Von: Froxlor-Administrator
Gesendet: Mittwoch, 1. März 2023 09:08
An: Frey
Betreff: Sie erreichen bald Ihr Speicherplatz-Limit

Hallo Ralf Frey,

Sie haben bereits -394383360.00 B von Ihren insgesamt -100663296.00 B Speicherplatz verbraucht.
Dies sind mehr als 90%.

Vielen Dank,
Ihr Administrator

AND

Von: Froxlor-Administrator
Gesendet: Mittwoch, 1. März 2023 09:08
An: Froxlor-Administrator
Betreff: Trafficreport 02/23 for Froxlor-Administrator

Trafficreport 02/23 for Froxlor-Administrator

Loginname Traffic used (Percent) | Traffic available
user1 -1828435968.00 B ( 114.9 % ) -2147483648.00 B
user2 1.39 MiB ( 0.1 % ) 1.00 GiB
user3 21.20 MiB ( 2.1 % ) 1.00 GiB
user4 -1846438912.00 B ( 62.8 % ) -2147483648.00 B
user5 188.00 KiB ( 0.0 % ) 1.00 GiB
user6 3.43 MiB ( 0.3 % ) 1.00 GiB
user7 0.00 B ( 0.0 % ) -2147483648.00 B
user8 18.57 MiB ( 1.8 % ) 1.00 GiB
user9 8.71 MiB ( 0.9 % ) 1.00 GiB
user10 0.00 B ( 0.0 % ) -2147483648.00 B
user11 353.41 MiB ( - ) unlimited
user12 0.00 B ( - ) unlimited
user13 3.00 MiB ( - ) 0

admin -1432170496.00 B ( - ) unlimited

@d00p
Copy link
Member

d00p commented Mar 1, 2023

negative werte? Das sollte aber schonmal gar nicht sein :) Schau doch mal bei uns im Discord vorbei, dann können wir da gemeinsam mal genau drüberschauen und hoffentlich die Ursache finden

@ralffrey
Copy link
Author

ralffrey commented Mar 1, 2023

Wie schaut man am Discord vorbei?

@d00p
Copy link
Member

d00p commented Mar 1, 2023

https://discord.froxlor.org aufrufen :)

@d00p
Copy link
Member

d00p commented Mar 15, 2023

Cause: 32bit php
Works with not forcing the value to be integer (because numbers > PHP_INT_MAX are passed as float), see ae6ee95#diff-12127d7f8ff98985a34ecb92e3d0d51b29f96b24ebe1691245a32d4f60b23e44

@d00p d00p closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants