Cacti - Validation error on new graph
Moderators: Developers, Moderators
Cacti - Validation error on new graph
Hi All,
New on the forum and was 'forced' to post something since i have an issue with my cacti installation. I am running Debian 7, 32-bit with Cacti from apt repo.
When i try to add graph to a tree it gives the error 'Validation error' when i submit with 'Go'. I already removed (apt-get remove --purge) the install and reinstalled from scratch, however this didn't help. I have searched for it online, but can online find very old posts dating 2006/2007 which were fixed after an upgrade. The page that is required for this action is 'graphs.php' which runs fine, except doing this action.
Could somebody please help me out? Thanks!
New on the forum and was 'forced' to post something since i have an issue with my cacti installation. I am running Debian 7, 32-bit with Cacti from apt repo.
When i try to add graph to a tree it gives the error 'Validation error' when i submit with 'Go'. I already removed (apt-get remove --purge) the install and reinstalled from scratch, however this didn't help. I have searched for it online, but can online find very old posts dating 2006/2007 which were fixed after an upgrade. The page that is required for this action is 'graphs.php' which runs fine, except doing this action.
Could somebody please help me out? Thanks!
Re: Cacti - Validation error on new graph
I'm also having the same issue. Currently running version 0.8.8b.
Re: Cacti - Validation error on new graph
I just installed cacti from source, version 8.8b, this works without issues.
Re: Cacti - Validation error on new graph
I am having the same issue on Debian 7 (64bit) after most recent package update. Anyone?
Re: Cacti - Validation error on new graph
I ran into this same exact message. It happened on an older Debian 6.0.9 box I have.
I read through the code. The problem is that when you do the form execute to add a graph to the tree, it calls a function in graphs.php, called "form_actions".
Inside that function, one of the first things it does is input validation with a function call "input_validate_input_number(get_request_var_post('drp_action'))". This function makes sure the option value for the form submission is a number.
However, if you look at the form submission HTML on that graph page, for the add to graph tree submission, the options are all numbers except for the add to tree stuff. Like this:
Since tr_3 or tr_4 or whatever, is not a number, it will always bail out with a validation error.
I just commented out the input validation at the top of that function and it all began to work.
I'm not sure if this is a bug or something else on these systems is screwed up. I run a lot of Cacti installs and this is the only one that had the problem. On my newer Cacti installs this integer check is done inside if/else statements further within the function.
Hope this helps!
I read through the code. The problem is that when you do the form execute to add a graph to the tree, it calls a function in graphs.php, called "form_actions".
Inside that function, one of the first things it does is input validation with a function call "input_validate_input_number(get_request_var_post('drp_action'))". This function makes sure the option value for the form submission is a number.
However, if you look at the form submission HTML on that graph page, for the add to graph tree submission, the options are all numbers except for the add to tree stuff. Like this:
Code: Select all
<option value="2">Change Graph Template</option>
<option value="5">Change Host</option>
<option value="6">Reapply Suggested Names</option>
<option value="7">Resize Graphs</option>
<option value="3">Duplicate</option>
<option value="4">Convert to Graph Template</option>
<option value="tr_2">Place on a Tree (ActiveMQ)</option>
<option value="tr_3">Place on a Tree (Backup)</option>
<option value="tr_4">Place on a Tree (Caching)</option>
I just commented out the input validation at the top of that function and it all began to work.
I'm not sure if this is a bug or something else on these systems is screwed up. I run a lot of Cacti installs and this is the only one that had the problem. On my newer Cacti installs this integer check is done inside if/else statements further within the function.
Hope this helps!
Re: Cacti - Validation error on new graph
This is the bit I commented out in graphs.php:
Code: Select all
function form_actions() {
global $colors, $graph_actions;
/* ================= input validation ================= */
//input_validate_input_number(get_request_var_post('drp_action'));
/* ==================================================== */
Re: Cacti - Validation error on new graph
It is a bug with the automate plugin. We had to ensure validation on the forums to stop a security exploit. The form is indeed suppose to be a number, and automate will need to be changed to conform to this.
Re: Cacti - Validation error on new graph
justruss wrote:This is the bit I commented out in graphs.php:
Code: Select all
function form_actions() { global $colors, $graph_actions; /* ================= input validation ================= */ //input_validate_input_number(get_request_var_post('drp_action')); /* ==================================================== */
Thanks, but that did not work for me.
Commented out, removed, didn't matter... same "validation error" on submit. (yes, I restarted the web server post edit). I was hopeful.
I did find a bug submission:
http://www.mail-archive.com/debian-bugs ... 38007.html
Re: Cacti - Validation error on new graph
Try going into /usr/share/cacti/site/lib/html_validate.php
In there you'll see a few small functions for validation, each of them ends with:
Prior to that line add a couple debug lines like this:
Then try doing the submission again and paste the result. You shouldn't need to reload the web server.
In there you'll see a few small functions for validation, each of them ends with:
Code: Select all
die_html_input_error();
Code: Select all
function input_validate_input_number($value) {
if ((!is_numeric($value)) && ($value != "")) {
echo "<h2>input_validate_input_number</h2>";
echo "Value: $value";
die_html_input_error();
}
}
Re: Cacti - Validation error on new graph
justruss wrote:Try going into /usr/share/cacti/site/lib/html_validate.php
In there you'll see a few small functions for validation, each of them ends with:
Prior to that line add a couple debug lines like this:Code: Select all
die_html_input_error();
Then try doing the submission again and paste the result. You shouldn't need to reload the web server.Code: Select all
function input_validate_input_number($value) { if ((!is_numeric($value)) && ($value != "")) { echo "<h2>input_validate_input_number</h2>"; echo "Value: $value"; die_html_input_error(); } }
Adding that segment causes a white screen, the app does nothing until I remove it.
Re: Cacti - Validation error on new graph
You must have a typo, it's blank screening because PHP found a syntax error.
Try running the php from the command line like:
php /usr/share/cacti/site/lib/html_validate.php
Look for missing semi-colons, unclosed brackets, etc.
Try running the php from the command line like:
php /usr/share/cacti/site/lib/html_validate.php
Look for missing semi-colons, unclosed brackets, etc.
Re: Cacti - Validation error on new graph
justruss wrote:You must have a typo, it's blank screening because PHP found a syntax error.
Try running the php from the command line like:
php /usr/share/cacti/site/lib/html_validate.php
Look for missing semi-colons, unclosed brackets, etc.
got it. sorry.
result:
---
input_validate_input_number
Value: tr_1
Validation error.
---
Re: Cacti - Validation error on new graph
Well the good new is you're running into the same issue I described, the bad news is you should have been all set by commenting out that bit I referred to earlier.
Can you paste the first 100 lines or so from the function form_actions() inside /usr/share/cacti/site/graphs.php?
Can you paste the first 100 lines or so from the function form_actions() inside /usr/share/cacti/site/graphs.php?
Re: Cacti - Validation error on new graph
Hi,
Did you manage to find a fix for this? I too am experiencing this issue, I am using CentOS and have commented out the suggested line however it still says validation error.
Andy
Did you manage to find a fix for this? I too am experiencing this issue, I am using CentOS and have commented out the suggested line however it still says validation error.
Andy
Re: Cacti - Validation error on new graph
You can try looking for every call in graphs.php to the function input_validate_input_number and comment it out. Then verify if it works, and through the process of elimination, start uncommenting them and see which one breaks it. This approach is a bit hamfisted but will get it working if you're desperate. I modified the code to make it so I could track down where it was breaking for me, but it's a bit much to be able to walk through over the forum.
Who is online
Users browsing this forum: No registered users and 0 guests