Project

General

Profile

Actions

Bug #14236

closed

PHP Error when viewing Traffic Graphs in ``iftop`` mode

Added by Steve Wheeler about 1 year ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Traffic Graphs
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:

Description

When monitoring traffic graphs which use iftop.

[05-Apr-2023 09:22:27 America/New_York] PHP Fatal error:  Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /etc/inc/util.inc:2146
Stack trace:
#0 /etc/inc/util.inc(2146): round('', 2)
#1 /usr/local/pfSense/include/www/bandwidth_by_ip.inc(172): format_number('', 2)
#2 /usr/local/www/bandwidth_by_ip.php(36): printBandwidth('opt2', 'remote', 'in', '', 'iftop')
#3 {main}
  thrown in /etc/inc/util.inc on line 2146

See:
https://forum.netgate.com/topic/179274/traffic-graph-php-error
and
https://forum.netgate.com/topic/178906/php-fatal-error-uncaught-typeerror-round-argument-1-num-must-be-of-type-int-float


Related issues

Related to Regression #14500: PHP Error when viewing Traffic Graphs in ``iftop`` modeResolvedJim Pingle

Actions
Actions #1

Updated by Jim Pingle about 1 year ago

  • Subject changed from PHP Error: /etc/inc/util.inc:2146 to PHP Error when viewing Traffic Graphs in ``iftop`` mode
  • Category changed from Web Interface to Traffic Graphs
  • Status changed from New to In Progress
  • Assignee set to Jim Pingle

I haven't managed to reproduce this yet but I can see how it might happen.

I've got a fix ready, and it seems to at least behave equivalently on the system I'm trying to reproduce it on.

Actions #2

Updated by Jim Pingle about 1 year ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle about 1 year ago

The original reporter on the forum states that the patch appears to have fixed the problem. Data still displays properly and there have been no errors since applying the patch.

I'll leave this open for a bit so we can confirm it's OK in snapshots, but it is likely good to be closed at any time.

Actions #4

Updated by Jordan G about 1 year ago

Applied above changeset via patches package, running 23.05.a.20230407.0116; when viewing traffic graphs, selecting iftop mode and then navigating back to the dashboard, no longer triggers a php error.

Actions #5

Updated by aleksei prokofiev about 1 year ago

I can’t reproduce issue

Version    23.01-RELEASE (amd64)
built on Fri Feb 10 20:06:33 UTC 2023
FreeBSD 14.0-CURRENT

Actions #6

Updated by Danilo Zrenjanin about 1 year ago

  • Status changed from Feedback to Resolved

I couldn't reproduce it too. But according to the forum, it's fixed.

I am marking this ticket resolved.

Actions #7

Updated by Jim Pingle 10 months ago

  • Affected Version set to 2.7.0
Actions #8

Updated by Jim Pingle 10 months ago

  • Related to Regression #14500: PHP Error when viewing Traffic Graphs in ``iftop`` mode added
Actions

Also available in: Atom PDF