All Apps and Add-ons

Splunk DB Connect: How to resolve dbxquery error "Failed to run query... Connection is not available, request timed out after 30000ms"

ppanchal
Path Finder

Whenever I try to execute the query in Splunk DB Connect (Data Input), I get the below error:

External search command 'dbxquery' returned error code 1. Script output = "RuntimeError: Failed to run query: "(select * from ocs_admin.tp_customerorder where plandate between sysdate-5 and sysdate and ticketnumber is not null)", params: "None", caused by: Exception(' java.sql.SQLTransientConnectionException: ocsdprd_splunk_srv - Connection is not available, request timed out after 30000ms..',). "

Is there a way to fix this?

cjj1977
Path Finder

For what it's worth, I see this in DB Connect 2.4.0 as well, either running saved searches or ad-hoc searches. The problem is intermittent and the same query runs in less than 10 seconds in SQL Studio.

0 Karma

wongea
Explorer

Try updating to DB Connect 2 version 2.4.0. I was running DB Connect 2 version 2.3.4. I was getting the same error of a 30 second timeout until I upgraded to version 2.4.0. Now the query works fine and I don't see the 30 second timeout.

I was also get this 30000ms timeout message in my dbx2.log for cronned Splunk DB searches. The query would work fine in the DB Connect, Search tab, but it wouldn't work as a cronned search. I would get a blank email with no query results and I would see the 30000ms timeout in the dbx2.log. The fix was adding "maxWaitMillis = 60000" in the /etc/apps/splunk_app_db_connect/local/db_connections.conf to the specific DB connection you are trying to run it on.

Saikat001
Explorer

Hello. i increased maxWaitMillis = 180000 and Db connect version is 3.4.2. Still i am getting the same error for oracle servers only.

error message:

ERROR com.splunk.dbx.connector.ConnectorFactory - action=failed_to_load_get_connection error=unnamed_pool_-131xxx5723_jdbc__oracle__thin__@server_name - Connection is not available, request timed out after 180000ms.

0 Karma

cj4splunk
Engager

We were on 2.3.1 and had a lot of the connection timeout errors. The upgrade to 2.4 was the fix !!

0 Karma

woodcock
Esteemed Legend

You should click Accept to close the question.

0 Karma

ppanchal
Path Finder

I noticed that splunk is refusing to connect to the database many times.
Sometime the query works and sometime it does not.
Not sure what is going wrong.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Your connection is timing out after 30 seconds. I don't know a way to change the timeout setting so I suggest you look at ways to reduce the query time.
Are there any errors reported on the other end?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...