Regression #14024
closed
PHP error in HAProxy Widget with Show Client Traffic enabled
Added by Rodrigo Goncalves almost 2 years ago.
Updated about 1 year ago.
Affected Plus Version:
23.01
Affected Architecture:
All
Description
After updating to pfsense plus 23.01 the haproxy dashboard widget is broken when acessing the pfsense web gui behind via the reverse proxy.
It works fine if acessing the web gui with it's ip address.
[23-Feb-2023 19:30:10 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /etc/inc/util.inc:2126
Stack trace:
#0 /usr/local/www/widgets/widgets/haproxy.widget.php(218): format_bytes('<NEVER>')
#1 /usr/local/www/index.php(430): include('/usr/local/www/...')
#2 {main}
thrown in /etc/inc/util.inc on line 2126
[23-Feb-2023 19:32:29 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /etc/inc/util.inc:2126
Stack trace:
#0 /usr/local/www/widgets/widgets/haproxy.widget.php(218): format_bytes('<NEVER>')
#1 /usr/local/www/index.php(430): include('/usr/local/www/...')
#2 {main}
thrown in /etc/inc/util.inc on line 2126
It is only afecting the Dashboard Widget.
- Subject changed from HAProxy broken after update to pfsense plus 23.01 to PHP error with HAproxy
- Description updated (diff)
- Affected Architecture All added
- Affected Architecture deleted (
amd64)
- File deleted (
PHP_errors.log)
- Tracker changed from Bug to Regression
- Has duplicate Regression #14097: Upgrade to 23.01: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /etc/inc/util.inc added
I have the same issue but only affecting one of my deployments. As a workaround you can disable the haproxy service temporarily, this will allow you to reload the front dashboard and then you can remove haproxy widget
As a workaround, I change the file like this:
--- /usr/local/www/widgets/widgets/haproxy.widget.php.bak 2023-04-06 18:05:57.343886000 +0200
+++ /usr/local/www/widgets/widgets/haproxy.widget.php 2023-04-06 18:13:45.464869000 +0200
@@ -215,7 +215,7 @@
print "<tr><td class=\"listlr\"><div class='text-success'> <i>".$clidata['src']."</i> <a href=\"diag_dns.php?host=".$clidata['srcip']."\" title=\"Reverse Resolve with DNS\">".$log."</a></div></td>";
if ($show_clients_traffic == "YES") {
$clientstraffic[0] = format_bytes($clidata['session_datareq']);
- $clientstraffic[1] = format_bytes($clidata['session_datares']);
+ $clientstraffic[1] = format_bytes(($clidata['session_datares'] == '<NEVER>') ? 0 : $clidata['session_datares']);
print "<td class=\"listlr\" colspan=\"3\"><div class='text-success'>".$clidata['age']." / ".$clientstraffic[0]." / ".$clientstraffic[1]."</div></td></tr>";
} else {
print "<td class=\"listlr\" colspan=\"3\"><div class='text-success'>".$clidata['age']." / ".$clidata['sessid']."</div></td></tr>";
I don't know if the default value 0 is correct, but it makes the page working, preventing the constant error messages/mails.
Sebastian Wagner wrote in #note-7:
As a workaround, I change the file like this:
[...]
I don't know if the default value 0 is correct, but it makes the page working, preventing the constant error messages/mails.
It indeed fixed the issue for me.
- Status changed from New to In Progress
- Assignee set to Jim Pingle
- Subject changed from PHP error with HAproxy to PHP error in HAProxy Widget with Show Client Traffic enabled
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
Pushed a fix for the widget error and also fixed some broken logic in the widget that was working by accident. New versions of the haproxy and haproxy-devel package are building now for 23.05 and 23.01.
- Status changed from Feedback to Resolved
I couldn't reproduce this issue.
Tested against:
haproxy-devel net 0.63_1
haproxy net 0.63_1
I am marking this bug report as resolved.
Also available in: Atom
PDF