Monitoring graph > NTP produces error
-
When I go to the monitoring graphs, then select "NTP", when I update the graph I get this error:
Error: SyntaxError: Unexpected token W in JSON at position 1
Additionally, there's a crash report (I've submitted two over two days, IPs below)
v4: 73.171.116.x
v6 WAN: 2001:558:6036:61:xx:xI don't think it would come from the v6 LAN, but if you can't find from the v6 WAN, let me know and I'll provide the LAN address.
I did not have this issue with 2.3.1, so not sure if something changed in the RRD data between versions, or if there's a new issue.
-
Code needs protection around:
$obj[$ds_key_right_adjusted]['min'] = min($stats); $obj[$ds_key_right_adjusted]['max'] = max($stats); $obj[$ds_key_right_adjusted]['avg'] = array_sum($stats) / count($stats); $obj[$ds_key_right_adjusted]['values'] = $data; $obj[$ds_key_right_adjusted]['raw'] = $raw_data;
and:
$obj[$ds_key_left_adjusted]['min'] = min($stats); $obj[$ds_key_left_adjusted]['max'] = max($stats); $obj[$ds_key_left_adjusted]['avg'] = array_sum($stats) / count($stats); $obj[$ds_key_left_adjusted]['values'] = $data; $obj[$ds_key_left_adjusted]['raw'] = $raw_data;
in /usr/local/www/rrd_fetch_json.php
A quick workaround would be:
if(count($stats)) { // the block... }
Around blocks at lines 316-320 and 607-611.
This causes graphs without stats to be blank but gets rid of the nasty crash. I am sure someone could come up with a better fix.
-
Thanks guys! This is fixed and will be in 2.3.2: https://github.com/pfsense/FreeBSD-ports/commit/4c3d8e6bdef27b5c601954b63f8a165247f77425