# LS failing to start with JDBC or multiple Input plugins

**URL:** <https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837>\
**Category:** Logstash\
**Created:** [November 29, 2015, 4:11pm UTC](https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837 "2015-11-29T16:11:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvenkat\_in](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mvenkat\_in](https://discuss.elastic.co/u/mvenkat_in)\
**Post date:** [November 29, 2015, 4:11pm UTC](https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837/1 "2015-11-29T16:11:53Z")

</div>

Hi  
My LS config has 2 input plugins 1-FileBeats & 2-JDBC. Here are my queries or issues.

1. LS is failing to start with JDBC plugin and the database listner is down, even though the jdbc\_validate\_connection is set to false and the schedule is in the future. Ideally if the jdbc\_validate\_connection is false then the LS should try to open the connection at scheduled execution.  
The target database is a mirror database and gets down every night to sync up with master production DB.

2. The LS is able to start if I disable JDBC plugin and start with only FB plugin. As of now I have 2 FB clients to LS.

LS Startup Errors:  
\*\*1-When only JDBC Plugin is set \*\*  
Settings: Default filter workers: 2  
The error reported is:  
Java::JavaSql::SQLException: Listener refused the connection with the following error:  
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

\*\*2-When both Filebeat & JDBC Plugin is set \*\*  
Settings: Default filter workers: 2  
The error reported is:  
Java::JavaSql::SQLException: Listener refused the connection with the following error:  
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor  
Beats input: unhandled exception {:exception=\>#\<ConcurrencyError: interrupted waiting for mutex: null\>, :backtrace=\>["org/jruby/ext/thread/Mutex.java:94:in `lock'", "org/jruby/ext/thread/Mutex.java:147:in`synchronize'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-lumberjack-2.0.4/lib/logstash/circuit\_breaker.rb:89:in `state'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-lumberjack-2.0.4/lib/logstash/circuit_breaker.rb:36:in`execute'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/logstash/inputs/beats.rb:111:in `run'", "org/jruby/RubyProc.java:271:in`call'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/logstash/inputs/beats.rb:150:in `create_event'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-codec-plain-2.0.2/lib/logstash/codecs/plain.rb:35:in`decode'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-codec-multiline-2.0.4/lib/logstash/codecs/identity\_map\_codec.rb:143:in `decode'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/logstash/inputs/beats.rb:144:in`create\_event'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/logstash/inputs/beats.rb:185:in `invoke'", "org/jruby/RubyProc.java:271:in`call'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:382:in `data'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:361:in`read\_socket'", "org/jruby/RubyProc.java:271:in `call'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:373:in`ack\_if\_needed'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:357:in `read_socket'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:246:in`json\_data\_payload'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:163:in `feed'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:296:in`compressed\_payload'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:163:in `feed'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:342:in`read\_socket'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/lumberjack/beats/server.rb:319:in `run'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/logstash-input-beats-2.0.3/lib/logstash/inputs/beats.rb:184:in`invoke'", "org/jruby/RubyProc.java:271:in `call'", "/sysapp/app/elk/logstash-2.1.0/vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/executor_service.rb:515:in`run'", "Concurrent$$JavaExecutorService$$Job\_84093389.gen:13:in `run'"], :level=\>:error}  
A plugin had an unrecoverable error. Will restart this plugin.  
Plugin: \<LogStash::Inputs::Beats port=\>5044, codec=\>\<LogStash::Codecs::Plain charset=\>"UTF-8"\>, host=\>"0.0.0.0", ssl=\>false, congestion\_threshold=\>5, target\_field\_for\_codec=\>"message"\>  
Error: Concurrent::RejectedExecutionError {:level=\>:error}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 29, 2015, 7:31pm UTC](https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837/2 "2015-11-29T19:31:10Z")

</div>

This is an Oracle-specific error. Googling the error message results in lots of hits—have you looked at them? For example, the first hit I get indicates that it _could_ be a connection string syntax problem.

---

<div class="post-metadata">

**Author:** ![mvenkat\_in](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@mvenkat\_in](https://discuss.elastic.co/u/mvenkat_in)\
**Post date:** [November 29, 2015, 11:17pm UTC](https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837/3 "2015-11-29T23:17:10Z")

</div>

My Query was - Does the LS establish the connection to database at the start up itself even though the JDBC schedule is set to future date & time and the jdbc\_validate\_connection is false !!

It seems LS is trying to test the connection at the startup itself. It would be nice if LS doesn't test the connection at the startup if jdbc\_validate\_connection is false...

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 30, 2015, 7:05am UTC](https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837/4 "2015-11-30T07:05:09Z")

</div>

That parameter seems to be connected to the connection pool configuration. Logstash will unconditionally attempt to connect to the database when the plugin is started. Note the unconditional call to jdbc\_connect() from the unconditionally called prepare\_jdbc\_connection().

> <https://github.com/logstash-plugins/logstash-input-jdbc/blob/v2.0.5/lib/logstash/plugin_mixins/jdbc.rb#L96>

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:20am UTC](https://discuss.elastic.co/t/ls-failing-to-start-with-jdbc-or-multiple-input-plugins/35837/5 "2017-07-06T05:20:51Z")

</div>

Closed on July 6, 2017, 5:20am UTC


