Project

General

Profile

Actions

Regression #14024

closed
RG JP

PHP error in HAProxy Widget with Show Client Traffic enabled

Regression #14024: PHP error in HAProxy Widget with Show Client Traffic enabled

Added by Rodrigo Goncalves over 3 years ago. Updated almost 3 years 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 1 (0 open1 closed)

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

Actions

RG Updated by Rodrigo Goncalves over 3 years ago Actions #1

It is only afecting the Dashboard Widget.

MM Updated by Marcos M over 3 years ago Actions #2

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

MM Updated by Marcos M over 3 years ago Actions #3

  • File deleted (PHP_errors.log)

MM Updated by Marcos M over 3 years ago Actions #4

  • Tracker changed from Bug to Regression

JP Updated by Jim Pingle over 3 years ago Actions #5

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

HP Updated by Hans Perera over 3 years ago Actions #6

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

SW Updated by Sebastian Wagner over 3 years ago Actions #7

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.

RG Updated by Rodrigo Goncalves over 3 years ago Actions #8

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.

JP Updated by Jim Pingle over 3 years ago Actions #9

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

JP Updated by Jim Pingle over 3 years ago Actions #10

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

DZ Updated by Danilo Zrenjanin almost 3 years ago Actions #11

  • 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