<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk DB Connect : Connection Refused in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203116#M21456</link>
    <description>&lt;P&gt;@edwinmae if you liked my answer, please mark it as the answer to your question.  &lt;/P&gt;</description>
    <pubDate>Sun, 17 Jan 2016 19:09:38 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-01-17T19:09:38Z</dc:date>
    <item>
      <title>Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203107#M21447</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;What does this mean and better how to resolve this issue?   &lt;/P&gt;

&lt;H2&gt;The error below shows up when clicking the RPC service that is UP (green) and Database connection status is also OK&lt;/H2&gt;

&lt;P&gt;12/30/2015 14:06:16 [ERROR] [&lt;STRONG&gt;init&lt;/STRONG&gt;.py] [Errno 111] Connection refused&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
  File "/opt/splunk/lib/python2.7/site-packages/splunk/rest/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 185, in dispatch&lt;BR /&gt;
    methodOutput = method()&lt;BR /&gt;
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbinfo.py", line 28, in handle_GET&lt;BR /&gt;
    self.dbx2 = rpc_service_channel(self.userName, self.sessionKey, host=self.host)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/rpcutils.py", line 33, in rpc_service_channel&lt;BR /&gt;
    return service.build_service(rpcChannel, max_retries=max_retries, verified=verified)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/service.py", line 694, in build_service&lt;BR /&gt;
    raise error&lt;BR /&gt;
error: [Errno 111] Connection refused&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:13:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203107#M21447</guid>
      <dc:creator>edwinmae</dc:creator>
      <dc:date>2020-09-29T08:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203108#M21448</link>
      <description>&lt;P&gt;If you increase your logging level to debug verbosity you might be getting this error as a log_level=DEBUG in _internal index:&lt;/P&gt;

&lt;P&gt;"The RPC server is not ready to serve yet as [Errno 111] Connection refused."&lt;/P&gt;

&lt;P&gt;I just looked at the code and that's about the only explanation I have for you.  For some reason the RPC connection test is failing so no idea why it shows as "Green".  I think you should  troubleshoot your RPC server that the db connect app is creating. on the splunk server.&lt;/P&gt;

&lt;P&gt;Check out this as it shows how to increase RPC logging verbosity and troubleshoot RPC:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/DBX/2.1.0/DeployDBX/Troubleshooting"&gt;http://docs.splunk.com/Documentation/DBX/2.1.0/DeployDBX/Troubleshooting&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/914iD038FCF3C1DD68E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;See my comments below about this inputs.conf in db2 and the corresponding rpc port:&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2016 14:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203108#M21448</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-01T14:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203109#M21449</link>
      <description>&lt;P&gt;Try going to $SPLUNK_HOME/etc/system/local/web.conf and change your timeout settings as shown below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [settings]
 splunkdConnectionTimeout = 300
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Jan 2016 01:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203109#M21449</guid>
      <dc:creator>jcoates_splunk</dc:creator>
      <dc:date>2016-01-03T01:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203110#M21450</link>
      <description>&lt;P&gt;Still not working: RPC Service is Up (= green) and DB connections are stated as Valid Connections&lt;/P&gt;

&lt;HR /&gt;

&lt;UL&gt;
&lt;LI&gt;copied the dbx_logging.conf and log4j.properties to /opt/splunk/etc/apps/splunk_app_db_connect/local&lt;/LI&gt;
&lt;LI&gt;level set to DEBUG &lt;/LI&gt;
&lt;LI&gt;Restarted Splunk&lt;/LI&gt;
&lt;/UL&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;STRONG&gt;dbx&lt;/STRONG&gt;&lt;BR /&gt;
01/04/2016 12:32:16 [ERROR] [&lt;STRONG&gt;init&lt;/STRONG&gt;.py] [Errno 111] Connection refused&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
  File "/opt/splunk/lib/python2.7/site-packages/splunk/rest/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 185, in dispatch&lt;BR /&gt;
    methodOutput = method()&lt;BR /&gt;
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbinfo.py", line 28, in handle_GET&lt;BR /&gt;
    self.dbx2 = rpc_service_channel(self.userName, self.sessionKey, host=self.host)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/rpcutils.py", line 33, in rpc_service_channel&lt;BR /&gt;
    return service.build_service(rpcChannel, max_retries=max_retries, verified=verified)&lt;BR /&gt;
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/service.py", line 694, in build_service&lt;BR /&gt;
    raise error&lt;BR /&gt;
error: [Errno 111] Connection refused&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;rpc&lt;/STRONG&gt;&lt;BR /&gt;
2016-01-04 12:48:38 DEBUG Connector:153 - DataSource: [jdbc:sqlserver://xxx.xxx.xxx.xxx:1433;databaseName=xxxx;selectMethod=cursor:jdbc:sqlserver://xxx.xxx.xxx.xxx:1433;databaseName=xxxx;selectMethod=cursor:xxxx:xxxxxxxxx] com.microsoft.sqlserver.jdbc.SQLServerDriver.&lt;BR /&gt;
2016-01-04 12:48:38 DEBUG Connector:211 - SSL: false&lt;BR /&gt;
2016-01-04 12:48:38 DEBUG Connector:212 - The database connection information: jdbcDriverClass = [com.microsoft.sqlserver.jdbc.SQLServerDriver], jdbcUrlFormat = [jdbc:sqlserver://xxx.xxx.xxx.xxx:1433;databaseName=xxxx;selectMethod=cursor], username = [xxxxx].&lt;BR /&gt;
2016-01-04 12:48:38 DEBUG Connector:255 - Database connection was established correctly: jdbcUrlFormat = [jdbc:sqlserver://xxx.xxx.xxx.x:1433;databaseName=xxxxx;selectMethod=cursor], username = [xxxxx].&lt;BR /&gt;
2016-01-04 12:48:38 INFO  Connector:39 -        duration=0      splunk-user=nobody      connection=null rows=1  params=null     sql=SELECT 1&lt;BR /&gt;
2016-01-04 12:48:38 DEBUG ResultSetConverter:142 - Return Data: NULL..int&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;When I change the RPC port (number), the error is still the same&lt;/P&gt;

&lt;P&gt;I probably have missed something but I don't know what (at the moment) ---&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203110#M21450</guid>
      <dc:creator>edwinmae</dc:creator>
      <dc:date>2020-09-29T08:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203111#M21451</link>
      <description>&lt;P&gt;I did also set the ConnectionTimeOut to 300&lt;/P&gt;

&lt;P&gt;When trying to run a simple/advanced query: &lt;BR /&gt;
External search command 'dbxquery' returned error code 1. Script output = " ERROR "Exception at ""/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbxquery.py"", line 121 : Unable to connect to rpcserver, please check rpc.log: [Errno 111] Connection refused" "&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:18:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203111#M21451</guid>
      <dc:creator>edwinmae</dc:creator>
      <dc:date>2020-09-29T08:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203112#M21452</link>
      <description>&lt;P&gt;What port do you have setup in inputs.conf of the db2 connect app? Is this port open on your server?  Is it below port 1024 (if so splunkd has to run as root to open ports lower than 1024)?  Is it open on the firewall(s) both software and hardware (iptables, apparmor, windows firewall, etc.)?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 12:41:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203112#M21452</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-04T12:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203113#M21453</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/915i2B342BACD13ECB0D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;If I set a port lower than 1024, I get a permission denied : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-01-05 09:30:40 ERROR RPCServer:230 - Starting RPC server thread failed : java.net.SocketException: Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;The only ports that have been opened are for traffic between Splunk server and 'connected' servers: &lt;BR /&gt;
1433 (MSSQL)  -- Splunk server to Database servers&lt;BR /&gt;
9997 (Splunk Forwarder)  -- Servers to Splunk server&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;If I set the RPC port to 9997, I no longer get the connection refused:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;External search command 'dbxquery' returned error code 1. Script output = " ERROR "Exception at ""/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbxquery.py"", line 123 : ''" "

01/05/2016 09:35:35 [ERROR] [__init__.py] '' Traceback (most recent call last): File "/opt/splunk/lib/python2.7/site-packages/splunk/rest/__init__.py", line 185, in dispatch methodOutput = method() File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbinfo.py", line 28, in handle_GET self.dbx2 = rpc_service_channel(self.userName, self.sessionKey, host=self.host) File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/rpcutils.py", line 33, in rpc_service_channel return service.build_service(rpcChannel, max_retries=max_retries, verified=verified) File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/service.py", line 694, in build_service raise error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;With default port 9998:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;External search command 'dbxquery' returned error code 1. Script output = " ERROR "Exception at ""/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbxquery.py"", line 121 : Unable to connect to rpcserver, please check rpc.log: [Errno 111] Connection refused" "

01/05/2016 09:37:26 [ERROR] [search_command.py] Traceback (most recent call last):
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/splunk_sdk-1.3.1.a-py2.7.egg/splunklib/searchcommands/search_command.py", line 316, in process
    self._execute(operation, reader, writer)
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/splunk_sdk-1.3.1.a-py2.7.egg/splunklib/searchcommands/generating_command.py", line 79, in _execute
    for record in operation():
  File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbxquery.py", line 121, in generate
    raise Exception("Unable to connect to rpcserver, please check rpc.log: " + error)
Exception: Unable to connect to rpcserver, please check rpc.log: [Errno 111] Connection refused
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;I assume port 9998 should work but there is probably something else here what causes these problems ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@xxxxxxx xxxxx]# netstat -plnt | grep 9998
tcp        0      0 ::ffff:127.0.0.1:9998       :::*                        LISTEN      13130/java
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2016 08:10:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203113#M21453</guid>
      <dc:creator>edwinmae</dc:creator>
      <dc:date>2016-01-05T08:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203114#M21454</link>
      <description>&lt;P&gt;Yes it is obvious port 9998 is blocked and 9997 is not.&lt;/P&gt;

&lt;P&gt;Open TCP port 9998 through the firewall if that's the port you want to use.  Your SQL server must be able to contact the RPC server on this port and visa versa.  &lt;/P&gt;

&lt;P&gt;As to why you cant use a port lower than 1024 this is because only root can open those ports.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2016 12:37:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203114#M21454</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-06T12:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203115#M21455</link>
      <description>&lt;P&gt;It did the job  -- &lt;BR /&gt;
Had to change the Bind IP address to * &lt;/P&gt;

&lt;P&gt;Thanks for the support --&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 08:56:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203115#M21455</guid>
      <dc:creator>edwinmae</dc:creator>
      <dc:date>2016-01-13T08:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203116#M21456</link>
      <description>&lt;P&gt;@edwinmae if you liked my answer, please mark it as the answer to your question.  &lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 19:09:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203116#M21456</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-17T19:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203117#M21457</link>
      <description>&lt;P&gt;@adwinmae ,can you confirm where did you change the Bind IP &lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 12:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203117#M21457</guid>
      <dc:creator>chamambom</dc:creator>
      <dc:date>2016-11-11T12:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect : Connection Refused</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203118#M21458</link>
      <description>&lt;P&gt;/etc/apps/splunk_app_db_connect/local &amp;gt; inputs.conf&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-Connection-Refused/m-p/203118#M21458</guid>
      <dc:creator>edwinmae</dc:creator>
      <dc:date>2020-09-29T11:45:07Z</dc:date>
    </item>
  </channel>
</rss>

