Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

deepak7202
Posts: 4
Joined: Wed Mar 02, 2022 5:12 am

Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by deepak7202 »

I am trying to create a Graph for cisco router.
Selected the interface, Going with Default graph settings, once I click create, it says "operation was successful"
But, Getting error as "Whitelist validation failed. Check data input methods" and no graph created.
Running it on Red Hat Enterprise Linux 7.9".
Appreciate your help.
deepak7202
Posts: 4
Joined: Wed Mar 02, 2022 5:12 am

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by deepak7202 »

Can someone please help me with this.
Thank you
deepak7202
Posts: 4
Joined: Wed Mar 02, 2022 5:12 am

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by deepak7202 »

Hi All,

Notices this error in Logs, when trying to create graph. Along with pop-up saying "Not able to create graph - whitelist validation failed, check data input methods"

2022-03-24 09:47:08 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'test_source' in 'field list'
2022-03-24 09:46:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[573]:CactiErrorHandler())
2022-03-24 09:46:49 - ERROR PHP NOTICE: Undefined index: graph_template_name in file: /nyl/apps/cacti/lib/html_graph.php on line: 573
2022-03-24 09:46:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[572]:CactiErrorHandler())
2022-03-24 09:46:49 - ERROR PHP NOTICE: Undefined index: graph_template_name in file: /nyl/apps/cacti/lib/html_graph.php on line: 572

Really appreciate your help.

Thank you.
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by macan »

Let the Cacti grow!
deepak7202
Posts: 4
Joined: Wed Mar 02, 2022 5:12 am

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by deepak7202 »

I have tried to download "html_graph.php" from github and updated it. but still getting same error.
Please advise, if anything else needs to be addressed .

2022-03-29 12:18:58 - CMDPHP ERROR: A DB Cell Failed!, Error: Unknown column 'test_source' in 'field list'
2022-03-29 12:18:54 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[573]:CactiErrorHandler())
2022-03-29 12:18:54 - ERROR PHP NOTICE: Undefined index: graph_template_name in file: /nyl/apps/cacti/lib/html_graph.php on line: 573
2022-03-29 12:18:54 - CMDPHP PHP ERROR NOTICE Backtrace: (/graphs_new.php[42]:form_save(), /graphs_new.php[150]:html_graph_new_graphs(), /lib/html_graph.php[442]:html_graph_custom_data(), /lib/html_graph.php[572]:CactiErrorHandler())
2022-03-29 12:18:54 - ERROR PHP NOTICE: Undefined index: graph_template_name in file: /nyl/apps/cacti/lib/html_graph.php on line: 572
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by macan »

no, the right answer is in file <cacti_dir>install/upgrades/1_2_19.php
You can run db upgrade manually from <cacti_dir>/cli/upgrade_database.php
Let the Cacti grow!
tsy
Posts: 15
Joined: Tue Dec 18, 2007 3:29 pm

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by tsy »

Hi there,

I've bumped into this a while ago, and did wait for a later release...
However, now running v1.2.21 (on centos7), the problem persists: I can not create ANY graph relying on Data Query (simple templates work just fine).
For instance, Data Query [SNMP - Interface Statistics] fails, but Unix - Processes succeeds.

I've tried the above mentioned solution (manual upgrade) without success (already up2date).
Even tried to force it on a test server:

Code: Select all

# /usr/share/cacti/cli/upgrade_database.php --debug --forcever=1.2.18
NOTE: Repairing Tables for Local Database
Upgrading from v1.2.18 (DB 1.2.21) to v1.2.19
++++
################################
[Success]    -   <no error>
+------------------------------+
UPDATE data_input_fields SET name='SNMP Authenticaion Protocol (v3)' WHERE hash IN ('20832ce12f099c8e54140793a091af90', '2cf7129ad3ff819a7a7ac189bee48ce8')
################################

################################
[Success]    -   <no error>
+------------------------------+
ALTER TABLE graph_templates ENGINE=InnoDB ROW_FORMAT=Dynamic, DROP INDEX multiple_name, DROP INDEX name, ADD INDEX multiple_name(multiple, name), ADD INDEX name(name)
################################

################################
[Success]    -   <no error>
+------------------------------+
ALTER TABLE host MODIFY COLUMN snmp_sysUpTimeInstance bigint(20) unsigned not null default "0"
################################

################################
[Success]    -   <no error>
+------------------------------+
ALTER TABLE automation_devices MODIFY COLUMN sysUpTime bigint(20) unsigned not null default "0"
################################
Upgrading from v1.2.19 (DB 1.2.21) to v1.2.20
Upgrading from v1.2.20 (DB 1.2.21) to v1.2.21
------------
################################
[Skipped]    -   <no error>
...
[Skipped]    -   <no error>
...
[Skipped]    -   <no error>
...
But still get 'whitelist validation failed, check data input methods'.

Any idea how to go about it?

ThX

PS: adding the log in attachment:
cacti.log.txt
(814 Bytes) Downloaded 69 times
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by macan »

disable console->settings->General tab->Graph Template Test Data Source

Try making graphs. It may happen that it creates some empty graphs. This means that it didn't get the appropriate data from the device and maybe there is a bug in the template.
Let the Cacti grow!
tsy
Posts: 15
Joined: Tue Dec 18, 2007 3:29 pm

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by tsy »

Hi macan,

I had hope, but 'Graph Template Test Data Source' was already disabled :-/
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by TheWitness »

I would get to 1.2.21 ASAP. Better release.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
tsy
Posts: 15
Joined: Tue Dec 18, 2007 3:29 pm

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by tsy »

TheWitness wrote: Mon Jun 06, 2022 4:36 pm I would get to 1.2.21 ASAP. Better release.
That's the one I have.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by TheWitness »

You need to familiarize yourself with the Whitelist validation process in Cacti. When it's enabled, every time you create a new Data Input method, either manually or through import, you have to run the validation script to approve the changes. If you don't do this, your data sources will not be updated. There are both audit and approval steps in that process. You should have been provided a detailed screen at install time that explained this.

Due to the security issues, you can not perform this audit from the Web GUI itself. That's the deal.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
tsy
Posts: 15
Joined: Tue Dec 18, 2007 3:29 pm

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by tsy »

@TheWitness: thank you for your answer. Much appreciated.

We tend to automate the installation of everything whenever possible, so I might have missed this screen you're referring to.

I was not aware of this whitelist at all indeed!
Is this feature enabled or disabled by default (can not find any setting in the db)?
It seems like a very good idea and something I need to dig in.

Unfortunately, I'm not finding much about it in the documentation:
https://github.com/Cacti/documentation/ ... =whitelist
Though, there is of course a bit more in the code:
https://github.com/Cacti/cacti/search?q=whitelist

Here is a bit of feedback about my findings:
When I run the related validation script, I'm getting a small clue:

Code: Select all

# /var/lib/cacti/cli/input_whitelist.php --audit; echo $?
NOTICE: Data Input Whitelist file not defined in config.php.
0
Then I've added the following line in config.php:

Code: Select all

$input_whitelist = '/etc/cacti/input_whitelist.json';
Now the validation script just exits with an explicit error:

Code: Select all

# /var/lib/cacti/cli/input_whitelist.php --audit; echo $?
ERROR: Data Input Whitelist file '/etc/cacti/input_whitelist.json' does not exist.  Please run with the '--update' option.
1
Thus, the next step seems obvious:

Code: Select all

# /var/lib/cacti/cli/input_whitelist.php --update; echo $?
SUCCESS: Data Input Whitelist file '/etc/cacti/input_whitelist.json' successfully updated.
0
I'm not sure if there is anything else to do after that?
Because it does not seems to fix my problem yet :-/
I still can not create a simple traffic graph...

REM:
At first, I've thought it was sensible to touch that input_whitelist.json file to make sure it exist before running the script.
But I was wrong: it should only be created by the script!
Otherwise, the audit was not inviting to update:

Code: Select all

# /var/lib/cacti/cli/input_whitelist.php --audit; echo $?
0
Maybe an empty file should be considered as invalid?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by TheWitness »

The option is in config.php at least with non package based installs. With the package maintainers, some of them chop up/change behavior to manage configs and logs the Linux Standard (LSB) way.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
tsy
Posts: 15
Joined: Tue Dec 18, 2007 3:29 pm

Re: Cacti - 1.2.19 - Not able to create graph - whitelist validation failed, check data input methods

Post by tsy »

The missing line in the config.php is on me, not on the package maintainer.
In short, we are using Puppet to install and configure all the software (based on packages like the one from EPEL).

So, from time to time, it happens we are missing some new feature in the config.
It's no biggy: I'll have a look at the latest config options, refresh our template to handle it and automate the validation too.

Although, now the config is fixed and the validation is complete, I'm still left to find out why I can still not create a simple graph...
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests