Bug #14236
closedPHP Error when viewing Traffic Graphs in ``iftop`` mode
100%
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
Updated by Jim Pingle over 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.
Updated by Jim Pingle over 1 year ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
Applied in changeset 2eb25975691c95ea86c0df0a60c16bb9a70d4067.
Updated by Jim Pingle over 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.
Updated by Jordan G over 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.
Updated by aleksei prokofiev over 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
Updated by Danilo Zrenjanin over 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.
Updated by Jim Pingle over 1 year ago
- Related to Regression #14500: PHP Error when viewing Traffic Graphs in ``iftop`` mode added