Actions
Bug #13936
closedPHP error from RRD Graphs when attempting a query a newly created empty database
Start date:
Due date:
% Done:
100%
Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:
Description
Attempting to view an RRD graph of a new database that doesn't yet have data results in a PHP error.
Easiest way to make it happen is to reset RRD and then attempt to load a traffic graph for an interface (e.g. WAN) before the script has a chance to run and populate data:
PHP ERROR: Type: 1, File: /usr/local/www/rrd_fetch_json.php, Line: 430, Message: Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /usr/local/www/rrd_fetch_json.php:430 Stack trace: #0 /usr/local/www/rrd_fetch_json.php(430): min(Array) #1 {main}
Once the RRD file has data, it's fine.
Updated by Danilo Zrenjanin about 2 years ago
- Status changed from New to Confirmed
I replicated the issue.
23.01-RC (amd64) built on Wed Feb 08 14:19:05 UTC 2023 FreeBSD 14.0-CURRENT
The error message is the same.
PHP errors PHP ERROR: Type: 1, File: /usr/local/www/rrd_fetch_json.php, Line: 430, Message: Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /usr/local/www/rrd_fetch_json.php:430 Stack trace: #0 /usr/local/www/rrd_fetch_json.php(430): min(Array) #1 {main} thrown @ 2023-02-09 11:14:21
Updated by Lev Prokofev almost 2 years ago
Can replicate on
23.01-RELEASE (amd64) built on Fri Feb 10 20:06:33 UTC 2023 FreeBSD 14.0-CURRENT
@PHP ERROR: Type: 1, File: /usr/local/www/rrd_fetch_json.php, Line: 431, Message: Uncaught ValueError: min(): Argument #1 ($value) must contain at least one element in /usr/local/www/rrd_fetch_json.php:431
Stack trace:
#0 /usr/local/www/rrd_fetch_json.php(431): min(Array)
#1 {main}
thrown@
Is there any workaround?
Updated by Christopher Cope almost 2 years ago
- Status changed from Confirmed to Pull Request Review
Updated by Jim Pingle almost 2 years ago
- Status changed from Pull Request Review to Feedback
- Assignee changed from Jim Pingle to Christopher Cope
- % Done changed from 0 to 100
MR merged
Updated by Danilo Zrenjanin almost 2 years ago
- Status changed from Feedback to Resolved
Tested against:
2.7.0.a.20230420.0600
The patch fixes it. I am marking this ticket resovled.
Actions