Project

General

Profile

Actions

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.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
haproxy
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
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


Related issues

Has duplicate Regression #14097: Upgrade to 23.01: PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /etc/inc/util.incDuplicate

Actions
Actions #1

Updated by Rodrigo Goncalves almost 2 years ago

It is only afecting the Dashboard Widget.

Actions #2

Updated by Marcos M over 1 year ago

  • 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)
Actions #3

Updated by Marcos M over 1 year ago

  • File deleted (PHP_errors.log)
Actions #4

Updated by Marcos M over 1 year ago

  • Tracker changed from Bug to Regression
Actions #5

Updated by Jim Pingle over 1 year 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
Actions #6

Updated by Hans Perera over 1 year 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

Actions #7

Updated by Sebastian Wagner over 1 year 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'>&nbsp;&nbsp;<i>".$clidata['src']."</i>&nbsp;<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.

Actions #8

Updated by Rodrigo Goncalves over 1 year 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.

Actions #9

Updated by Jim Pingle over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Jim Pingle
Actions #10

Updated by Jim Pingle over 1 year 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.

Actions #11

Updated by Danilo Zrenjanin about 1 year ago

  • 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.

Actions

Also available in: Atom PDF