Weird error since updating

Hi,

I have an odd issue since upgrading to 1.8.5. When I log in as the admin user, I get a 500 IS error. When I login as japan_admin (an admin user I created), I get:

Notice how it cuts off before the end. I’m looking in /var/log/hestia to see if I can find any errors using:

tail -n20 -f *.log

…but when the 500 IS error comes up, no errors do - so I’m not sure how to dig further?

Cheers

Andy

Ah ok - got an error now:

==> nginx-error.log <==
2023/08/17 14:25:32 [error] 864#0: *8 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in /usr/local/hestia/web/inc/main.php:368
Stack trace:
#0 /usr/local/hestia/web/inc/main.php(368): number_format()
#1 /usr/local/hestia/web/templates/pages/list_user.php(261): humanize_usage_size()
#2 /usr/local/hestia/web/inc/main.php(202): include(‘…’)
#3 /usr/local/hestia/web/list/user/index.php(33): render_page()
#4 {main}
thrown in /usr/local/hestia/web/inc/main.php on line 368” while reading upstream, client: 81.174.134.33, server: _, request: “GET /list/user/ HTTP/2.0”, upstream: “fastcgi://unix:/run/hestia-php.sock:”, host: “brian2022.newbyhost.com:9183”, referrer: “https://brian2022.newbyhost.com:9183/login/

==> nginx-access.log <==
81.174.134.33 - - [17/Aug/2023:14:25:32 +0900] GET /list/user/ HTTP/2.0 “200” 5133 “https://brian2022.newbyhost.com:9183/login/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36” “-”

I’m not really sure what caused it, but this fix in /usr/local/hestia/web/inc/main.php seems to do it:

function humanize_usage_size($usage, $round = 2) {
	if ($usage == "unlimited") {
		return "∞";
	}

	if ($usage < 1) {
		$usage = "0";
	}

This part:

	if ($usage < 1) {
		$usage = "0";
	}

I added some debugging in, and it seems somewhere something was not returning a number - which was causing:

2023/08/17 14:35:33 [error] 864#0: *33 FastCGI sent in stderr: "PHP message: DEBUG!!!: ‘9’
; PHP message: DEBUG!!!: ‘9’
; PHP message: DEBUG!!!: ‘’
; PHP message: PHP Fatal error: Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in /usr/local/hestia/web/inc/main.php:375

I think I can see where it was having issues:

For some reason the DNS zones has nothing in it ?

I’ve made a PR for this, as it keeps breaking on every update :frowning:

There are a few tweaks in that repo, but I can’t work out how to only submit the one change in main.php!

Cheers

Andy