All Apps and Add-ons

How can I restart Server error?

Vinay_Mantha
Engager

Can't save the DB connect configuration settings as it is prompting the error "Failed to restart task server".Tried with changing default port which doesn't work.

Labels (1)

gn694
Communicator

I just spent a while dealing with this, so wanted to share what I did to resolve the issue in case it will be useful for anyone else.

Scenario: I updated the DB Connect app, after which Java 8 was no longer supported.  After this when accessing the DB Connect app I got the following errors:

  • Cannot communicate with task server, please check your settings.
  • DBX Server is not available, please make sure it is started and listening on 9996 port or consult documentation for details.


I installed JDK 17.0.7, then went into DB Connect - Configuration - Settings where I updated the value of JRE Installation Path (JAVA_HOME).

When saving it, I got the error Failed to restart task server.  Restarting Splunk did not help.

After a couple of hours of troubleshooting, and it not really behaving any differently, I wondered what if it is trying to use the old JRE still?  So I renamed the old JRE directory from /usr/lib/jre1.8.0_151 to /usr/lib/jre1.8.0_151_z to guarantee it could not find it and then splunkd.log then had a helpful entry after restarting:

ERROR ModularInputs [1677 MainThread] - <stderr> Introspecting scheme=server:  /opt/splunk/etc/apps/splunk_app_db_connect/linux_x86_64/bin/server.sh: line 33: /usr/lib/jre1.8.0_151/bin/java: No such file or directory
host = splunk-ifw-p02.austin.utexas.edu source = /opt/splunk/var/log/splunk/splunkd.log sourcetype = splunkd


... so it was still trying to use the older JRE (in fact, that was the original JRE I installed for DB Connect, I had since then already installed a newer JRE a couple of years ago that I *thought* it was using)


To find out where this old JRE was being specified, I ran
grep -rnw '/opt/splunk/etc/apps/splunk_app_db_connect' -e 'jre1.8.0_151'

Which returned one file:

/opt/splunk/etc/apps/splunk_app_db_connect/linux_x86_64/bin/customized.java.path

 

After updating the content of customized.java.path and restarting Splunk, DB Connect was working again.

Searching for files containing jdk-17.0.7 returned 7 files in total..... it looks like the Settings page in DB Connect is updating all of them except for the one I had to edit.


I suppose adding $JAVA_HOME would have worked as well, I was trying to get it to work without doing that since it had worked fine in the past without it set: this way there is one less place to have to go (outside of Splunk itself) to update it in the future when the JDK has to be updated again, and also not knowing if any (non-Splunk) updates or other processes in the future may change it in /etc/profile

gpullis
Communicator

Here's what happened to me. I had installed the DB Connect app before installing the Oracle JDK version 1.8. After installing the right JDK and correcting your Java path (and getting that error), you need to restart Splunk one more time. Seems that Splunk will only do the initial Task Server startup on Splunk startup.

After restarting Splunk, I had a running Task Server and everything was okay.

davidtrujillo
Explorer

It also worked for me. After restarting Splunk I got my Task Server running.

%SPLUNK_HOME%\bin\splunk restart

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...