All Apps and Add-ons

DBConnect: OSError: [Errno 2] No such file or directory validate java command: /usr/java/latest/bin/java.

Branden
Builder

Hi. I'm trying to configure DBConnect on my Splunk instance (Splunk 7.2.4 on RHEL). I can't make any progress because of this error:

OSError: [Errno 2] No such file or directory validate java command: /usr/java/latest/bin/java.

That is the correct location of java. It's Oracle java version 1.8.0_231.

JAVA_HOME is set:

echo $JAVA_HOME
/usr/java/latest

The splunk user ('splunk') has full rights to access this installation of java.

-rwxr-xr-x. 1 root root 8534 Oct  5 06:15 /usr/java/latest/bin/java

As you can see, it has wide-open read/execute permissions, and I've manually verified that the splunk user can use java.

I then ran this command:

/opt/splunk//bin/splunk cmd python -c "import os; print(os.environ)"

And see that JAVA_HOME is set:

{'USER': 'splunk', 'LOGNAME': 'splunk', 'JAVA_HOME': '/usr/java/latest', .......

What am I missing here? I've seen similar posts with this question, but no good solutions.

Thank you in advance.

arunkg
New Member

Hi , I have installed oracle JRE version 1.8 and done all the required configuration. When i go for the further configuration in Setting-> General -> JRE installation path( JAVE_HOME) and updates the path /usr/java/jre1.8.0_241-amd64/bin/ i am getting the below error.

OSError: [Errno 2] No such file or directory validate java command: /usr/java/jre1.8.0_241-amd64/bin/bin/java.

As i see in the following path /usr/java/jre1.8.0_241-amd64/bin/bin/java additional /bin/java got added automatically. Due to this i am unable to move on further steps.
Can any one help to fix the issue.

Thanks
Arun

,Hi , i have installed JRE 1.8 version and done all the required configuration. When i give JRE installation path ( JAVA_HOME) as /usr/java/jre1.8.0_241-amd64/bin/ i am getting the below error.

OSError: [Errno 2] No such file or directory validate java command: /usr/java/jre1.8.0_241-amd64/bin/bin/java.

I could see additional /bin/java added in it. Can any one help to me fix the issue ?

Thanks
Arun

0 Karma

gebr
Explorer

Still not fixed - got the same issue.

Version 3.2.0 should provide the python compatibility for 2.x and 3.x as preparation for the 2.x support removal from Splunk Enterprise.

0 Karma

teunlaan
Contributor

To "fix" it:
Use splunk_app_db_connect/bin/dbx2/jre_validator.py form version 3.1.4
OR change the code of the 3.2.0 version line 23:

      if isinstance(command, basestring):

manuelostertag
Path Finder

Thanks, that solves the problem I've been struggling with.

0 Karma

aaronbarry73
Path Finder

This worked for me!! I updated the script in 3.2 as you suggested.

0 Karma

rtev
Path Finder

This worked for me too.

0 Karma

michael_kushma
Path Finder

Worked for me as well. Splunk 7.3.2 and DB connect version 3.2.0.
Changed that one line:

   if isinstance(command, str):
   if isinstance(command, basestring):

They need to fix this...

0 Karma

tvergov
Explorer

Looks like this is still the case. I hope someone from dev part to see and fix.
Meantime let us know if there is some nice workaround.

0 Karma

falcalde
Explorer

The only workaround that worked for me was using db_connect version 3.1.4

0 Karma

graether
Path Finder

FWIW, my problem was caused not by the new DB connect version, but likely by using a Splunk App Repo on Windows, where executables might have lost there executable "x" right. Then no JDBC related java process was startet. When I reinstalled the DB connect App purely on Linux from scratch, installed the driver, restarted the Heavy Forwarder, then it was working, although the Configuration.General GUI still shows issues.

0 Karma

RDAVISS
Path Finder

First time user of DB connect here, we had the same problem on version 3.2 and reverted back to 3.1.4. The java path is now recognized (had to restart splunkd though.)

aokur_splunk
Splunk Employee
Splunk Employee

agreed this is what it worked as well

0 Karma

skalliger
Motivator

Yep, I'll add to that. Did not work with DBX 3.2 on Splunk 7.3.x. I had to revert back to 3.1.4, too. SH was running on RHEL.

Skalli

0 Karma

aagro
Path Finder

Same problem, I roll back Splunk DB Connect, below the details about my environment:

  • Splunk Enterprise 8
  • Splunk DB Connect 3.1.3
  • JAVA jdk1.8.0_181

Suppose bugs.

Regards,
Antonio

0 Karma

Branden
Builder

I think this ended up being a red herring. Even though the error was appearing, I clicked through and things still worked as expected. Strange... So it looks like the error was a false positive.

0 Karma

DD_MBennett
New Member

What version of DB Connect are you using?

I had the exact same issue today after I updated to the latest version.
I rolled back to version 3.1.4 and everything worked perfectly again.

I suspect there is an issue with DB Connect version 3.2.0.

0 Karma

chrisbaniqued
Engager

Yeah, I suspect it's the new DB Connect version. When I upgraded it, I got errors. I had 3.2 on SplEnt 8.0. When I rolled back everything is working again.

0 Karma

chrisbaniqued
Engager

Any luck on this? Encountering the same issue.

Error shows:

Cannot communicate with task server, please check your settings.
OSError: [Errno 2] No such file or directory validate java command: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre/bin/java

I changed the server port from default 9998 to 9995 and hit save but it doesn't seem to be making the changes.

JRE Installation Path(JAVA_HOME)
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre

JVM Options
-Ddw.server.applicationConnectors[0].port=9995

Task Server Port
9995

Splunk DB Connect Version: 3.2.0
Splunk Enterprise Version: 8.0

Running alternatives --config java Java installed shows -

java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64/jre/bin/java)

java -version shows

openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
`

falcalde
Explorer

Have you managed to solve this problem? I have SplEnt 8.0.1 and db_connect 3.2.0, and exactly same problem.
- Folder permissions Ok
- Path OK
- JAVA_HOME OK
- OpenJDK 8 (splunk db connect says it is supported)

I am lost.
TY.

0 Karma

RDAVISS
Path Finder

I created a ticket with splunk support and they logged it as a defect with the latest version of DB connect. So a future release should resolve it. You can always revert to the previous version until then.

Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...