All Apps and Add-ons

Why am I unable to install the Splunk Add-on for MySQL in Splunk 6.3.1 and getting "OSError: [Errno 2] No such file or directory"?

brandonf
Path Finder

Hi

I've installed the Splunk Add-on for MySQL as per the documentation and it is not working. I have tested DB Connect to and from the server and it is working.
I checked the splunkd.log and I get the following python errors:

11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" Traceback (most recent call last):
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py", line 232, in <module>
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     main()
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py", line 226, in main
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     run()
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py", line 154, in run
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     meta, stanzas, global_settings = mysql_conf.get_configs()
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql_config.py", line 39, in get_configs
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     self._update_stanza_configs(default_configs)
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql_config.py", line 73, in _update_stanza_configs
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     defaults[c.mysql_data_collection_settings])
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql_common.py", line 24, in get_mysql_variables
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     p = subprocess.Popen(mysql, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/lib/python2.7/subprocess.py", line 710, in __init__
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     errread, errwrite)
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"   File "/mnt/splunkstore/splunk/lib/python2.7/subprocess.py", line 1335, in _execute_child
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py"     raise child_exception
11-11-2015 10:47:11.145 +0200 ERROR ExecProcessor - message from "python /mnt/splunkstore/splunk/etc/apps/Splunk_TA_mysql/bin/mysql.py" OSError: [Errno 2] No such file or directory

Thanks
Brandon

0 Karma

jkat54
SplunkTrust
SplunkTrust

Line 20-24 in mysql_common.py are below:

    mysql = ["mysql", "--host={}".format(host), "--port={}".format(port),
             "--user={}".format(config[c.username]),
             "--password={}".format(config[c.password]),
             "-e", "SHOW VARIABLES"]
    p = subprocess.Popen(mysql, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

Here, it is trying to execute mysql as the SplunkD user. Can you confirm that the SplunkD user has access to mysql? Can you confirm mysql is in the SplunkD user's path? If it's not in the path, you might use which mysql to find it's path and edit mysql_common.py line 20 as follows mysql = ["/path/to/mysql"....

If the splunkd user can run msyql just by typing mysql at a prompt, then check the username & password being sent to mysql command:

 mysql --host=localhost --port=3306 --user="<YOURmysqlUser>" --password="<mysqlPass>" -e SHOW VARIABLES
0 Karma

msteelehpcs
New Member

No, still no progress.

0 Karma

msteelehpcs
New Member

I'm having the same problem with the same build on CENTOS 6.5

0 Karma

brandonf
Path Finder

Hi - did you make any progress on this?

0 Karma

jcoates_splunk
Splunk Employee
Splunk Employee

what stage of the installation are you at when it produces that error? It looks like it's trying to read a config file and can't find it... that might be spurious if the config hasn't been created yet?

0 Karma

brandonf
Path Finder

I had completed the installation - as per the documentation steps.
Everything seemed fine however I noticed that no data was being collected when I enabled the inputs.
I tested DB connect 2 and I made a test connection - working.
I downloaded and installed the add-on, ran through the configuration and then looked at the logs.

0 Karma

brandonf
Path Finder

Forgot to mention:

Running Splunk 6.3.1 (also tested on 6.3) on Centos 7

0 Karma

gyslainlatsa
Motivator

hi brandon,
what version of dbconnect are using?

0 Karma

brandonf
Path Finder

latest - 2.0.6

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...