All Apps and Add-ons

DB connect 2 Problem

sjlin
Explorer

Hi, I have installed DB connect 2 on my splunk server to retrieve data from a remote database.
After setup the identity and connection, it shows that it is a "Valid connection".
But in the query tab, it shows "No catalog found".

I switch to Advanced Query Mode, and the query is "SELECT * FROM myTable", the following error message is shown:

External search command 'dbxquery' returned error code 1. First 1000 (of 1061) bytes of script output: " ERROR "Exception at ""C:\Program Files\Splunk\etc\apps\splunk_app_db_connect\bin\dbxquery.py"", line 82 : {""messages"":[{""type"":""WARN"",""text"":""Traceback (most recent call last):\r\n File \""C:\Program Files\Splunk/bin/rest_handler.py\"", line 78, in <module>\r\n print splunk.rest.dispatch(**params)\r\n File \""C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\rest\init.py\"", line 215, in dispatch\r\n responseObject.write(json.dumps(feed.asJsonStruct(), separators=(',', ':')))\r\n File \""C:\Program Files\Splunk\Python-2.7\Lib\json\init.py\"", line 250, in dumps\r\n sort_keys=sort_keys, **kw).encode(obj)\r\n File \""C:\Program Files\Splunk\Python-2.7\Lib\json\encoder.py\"", line 230, in encode\r\n chunks = self.iterencode(o, _one_shot=True)\r\n File \""C:\Program Files\Splunk\Python-2.7\Lib\json\encoder.py\"", line 293, in iterencode\r\n return _iterencode(o, 0)\r\nUnicodeDecodeError: 'utf8' codec can't decode"

If anyone has the same problem? Any help is appreciated.

Tags (1)
0 Karma
1 Solution

sjlin
Explorer

Solved this problem with DB connect 1. Maybe there are some bugs in DB connect 2...

View solution in original post

0 Karma

molens
New Member

There's a Java 1.8 issue with DB Connect 2 that requires you to pre-format date/time in the query. With MySQL it's DATE_FORMAT(date_column_name, '%Y%m%d') as date_column_name, for an example.

0 Karma

massmann
New Member

Hi,

I'm having exactly the same issue as mentioned above after upgrading from DBConnect 2.0.3 to 2.1.3.

Any idea why this is happening? Nothing has changed on the MSSQL server side..
In 2.0.3 everything has worked as expected.

Thanks in advance,
Christoph

0 Karma

goelli
Communicator

I have similar problem with Oracle DB. Connection validates, but I get "No catalog found" and with query in advanced mode I always get following error:

command="dbxquery", {"messages":[{"type":"WARN","text":"Traceback (most recent call last):\r\n File \"C:\\Program Files\\Splunk/bin/rest_handler.py\", line 78, in \r\n print splunk.rest.dispatch(**params)\r\n File \"C:\\Program Files\\Splunk\\Python-2.7\\Lib\\site-packages\\splunk\\rest\\__init__.py\", line 215, in dispatch\r\n responseObject.write(json.dumps(feed.asJsonStruct(), separators=(',', ':')))\r\n File \"C:\\Program Files\\Splunk\\Python-2.7\\Lib\\json\\__init__.py\", line 250, in dumps\r\n sort_keys=sort_keys, **kw).encode(obj)\r\n File \"C:\\Program Files\\Splunk\\Python-2.7\\Lib\\json\\encoder.py\", line 230, in encode\r\n chunks = self.iterencode(o, _one_shot=True)\r\n File \"C:\\Program Files\\Splunk\\Python-2.7\\Lib\\json\\encoder.py\", line 293, in iterencode\r\n return _iterencode(o, 0)\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 30: invalid continuation byte\r\n\r\n"}]}

Using old version can't really be the solution for DB connect 2? But as it is the accepted answer, do I have to open a new problem?

sjlin
Explorer

Solved this problem with DB connect 1. Maybe there are some bugs in DB connect 2...

0 Karma

despachoSTD
Explorer

I downvoted this post because this is not a solution

0 Karma

dougmartin
Path Finder

I downvoted this post because this isn't a solution, it's a workaround.

0 Karma

andrea_o
Explorer

I downvoted this post because using v1 should not be the accepted answer

0 Karma

asimagu
Builder

from my experience with DB 2, it certainly comes a bit below the expectations. i cannot blame @sjlin

0 Karma

esix_splunk
Splunk Employee
Splunk Employee

What kind of database are you trying to connect to? And did you install the drivers for it?

0 Karma

sjlin
Explorer

MySQL database, and yes , I have installed mysql-connector-java-5.1.35-bin.

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, ...