New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When viewing graphs, a byref error can be seen in the error logs #3104
Comments
Are you sure that you have the latest from the 1.2.x branch? I only ask as I am sure there was a pull request that fixed this issue. The commit looks right just wondering if the files are properly updated. |
The previous and similar issue I had was #3053 but things worked again after that was committed. thunderstorm /var/www/cacti.reub.net/htdocs # git status and thunderstorm /var/www/cacti.reub.net/htdocs # git pull That was taken now so I'm assuming that confirms I am up to date? An md5sum of the graph_json.php file locally and pulled from the server matches too. |
OK, cool. Must have been missed but I thought it was included, we will take a look. |
I've looked at the function definition and that hasn't changed in 4 years. Can you verify the version of PHP you are using? |
Wait, no it's me, I had my repo checked out to release/1.2.2 for some reason. I've now reset to the 1.2.x branch and can see the problem is because of the NULL value being passed on parameter 5. PHP doesn't allow you to pass in null, you must just not specify it. The workaround is to either remove the null value or pass a variable initialised to an array. Can you try removing the null value and see if that cures your problem? This was likely introduced as part of cfb0733 and then corrected to the proper element in d5f9867 |
Again, forget that, you can't skip a parameter so you'd have to pass either array(), try this: diff --git a/graph_json.php b/graph_json.php
index 25930ff6..6c5b7f5d 100644
--- a/graph_json.php
+++ b/graph_json.php
@@ -155,7 +155,8 @@ if (!isset_request_var('image_format')) {
$graph_data_array['image_format'] = $gtype;
if ($config['poller_id'] == 1 || read_config_option('storage_location')) {
- $output = rrdtool_function_graph(get_request_var('local_graph_id'), $rra_id, $graph_data_array, '', null, $_SESSION['sess_user_id']);
+ $xport_meta = array();
+ $output = rrdtool_function_graph(get_request_var('local_graph_id'), $rra_id, $graph_data_array, '', $xport_meta, $_SESSION['sess_user_id']);
ob_end_clean();
} else { |
So, I analysed this type of function call and the parameters used and produced the following table. I see about 10 calls that are invalid right now as they try to pass null for the xport_meta parameter. NOTE: This table is wide so you'll have to scroll sideways to see it all on GitHub.
|
Attaching an excel file that has the above table. I used the following command to generate this:
|
@ddb4github since you supplied a fix that was partially to do with this, can you just double check that you can't see an issue with my fix? |
The error is gone for me now so it looks to be fine. I am seeing a partial blank page on Tree view (top navigation loads fine but the body is blank - both Chrome and Edge) but that's possibly unrelated to this fix as it has been flaky for a while. I'll do further testing and try isolate the problem and open a separate issue if required. |
OK, cool. Let us know on the other one if you do find a bug. |
Hello. I just upgraded Cacti to 1.2.8 and I am now unable to see my graphs via tree view. I'm getting the same error shown above: CMDPHP Validation Error, Variable:thumbnails, Value:on Backtrace: (/graph_view.php[221]:top_graph_header(), /lib/functions.php[3272]:include_once(), /include/top_graph_header.php[54]:grow_dhtml_trees(), /lib/html_tree.php[95]:html_validate_tree_vars(), /lib/html_tree.php[843]:validate_store_request_vars(), /lib/html_utility.php[704]:die_html_input_error(), /lib/html_validate.php[64]:cacti_debug_backtrace()) I can't tell from this post what the solution is though. Any assistance would be greatly appreciated. |
Hi, same error as @christh0mas after upgrade to 1.2.8. Any assistance would be greatly appreciated. |
This was resolved, you'll need 1.2.9 for that which hasn't been released yet. You can download the sources from here as long as you understand how to install them. |
We are going to release 1.2.10 this weekend. I would suggest upgrading to that and we can run some checksums to make sure you have unmodified versions of things. |
ok, I had to relogin.. now it works. Thank you for your help. |
I'm following git 1.2.x branch, and a commit somewhere around d5f9867 has broken things all over again.
After updating to anything past this commit I now get this logged, and a server side error:
[Wed Nov 27 17:06:07.199325 2019] [php7:error] [pid 3756:tid 140394685986560] [client 2403:5800:7100:911::50:58253] PHP Fatal error: Uncaught Error: Cannot pass parameter 5 by reference in /var/www/cacti.reub.net/htdocs/graph_json.php:158\nStack trace:\n#0 {main}\n thrown in /var/www/cacti.reub.net/htdocs/graph_json.php on line 158, referer: https://cacti.reub.net/graph_view.php?action=preview
[Wed Nov 27 17:06:07.207148 2019] [php7:error] [pid 3756:tid 140394711164672] [client 2403:5800:7100:911::50:58253] PHP Fatal error: Uncaught Error: Cannot pass parameter 5 by reference in /var/www/cacti.reub.net/htdocs/graph_json.php:158\nStack trace:\n#0 {main}\n thrown in /var/www/cacti.reub.net/htdocs/graph_json.php on line 158, referer: https://cacti.reub.net/graph_view.php?action=preview
It is browser independent and shows up in Tree View (is anyone even testing Tree View? This is the second fatal problem in a month to break this view...) Preview and List Views still work OK though.
Reverting d5f9867 results in the error going away, but the page doesn't render graphs.
Problem current as of 1a6ba58 .
The text was updated successfully, but these errors were encountered: