Regression #14024
openPHP error in HAProxy Widget with Show Client Traffic enabled
100%
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
Related issues
Updated by Rodrigo Goncalves 3 months ago
It is only afecting the Dashboard Widget.
Updated by Jim Pingle 3 months ago
- Has duplicate Regression #14097: Upgrade to 23.01: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /etc/inc/util.inc added
Updated by Hans Perera 2 months ago
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
Updated by Sebastian Wagner about 2 months ago
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.
Updated by Rodrigo Goncalves about 2 months ago
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.
Updated by Jim Pingle 3 days ago
- Status changed from New to In Progress
- Assignee set to Jim Pingle
Updated by Jim Pingle 3 days ago
- 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.