# Logstash continues to restart itself on connection failures

**URL:** <https://discuss.elastic.co/t/logstash-continues-to-restart-itself-on-connection-failures/244172>\
**Category:** Logstash\
**Created:** [August 7, 2020, 12:10pm UTC](https://discuss.elastic.co/t/logstash-continues-to-restart-itself-on-connection-failures/244172 "2020-08-07T12:10:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VinayM30](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinaym30/32/73420_2.png) [@VinayM30](https://discuss.elastic.co/u/VinayM30)\
**Post date:** [August 7, 2020, 12:10pm UTC](https://discuss.elastic.co/t/logstash-continues-to-restart-itself-on-connection-failures/244172/1 "2020-08-07T12:10:48Z")

</div>

I have a usecase where i need to ingest data from Oracle DB and send it to elastic search  
i have written a config file which is executing fine when connection is ok. but today when i ran it somehow password got wrong and due to that connection failure logstash was restarting itself continuously.

config file :

```auto
input {
         jdbc {
            jdbc_validate_connection => true
            connection_retry_attempts => 2
            connection_retry_attempts_wait_time => 60
            jdbc_connection_string => 'jdbc:oracle:thin:@<host>:<port>/<service name>'
            jdbc_user => '<user>'
            jdbc_password=>'<DBpassword>'
            jdbc_driver_library=>'<absolute path to ojdbc8.jar>'
            jdbc_driver_class=>'Java::oracle.jdbc.OracleDriver'
            statement => 'select * from mytable'
            last_run_metadata_path=>'<path to yml file>'
        }
    }
    output {
        stdout {
             codec => json_lines
        }
    }

```

Even if i gave wrong DB host to test the retry attempts, it seems logstash is ignoring all and restating itself and getting stuck in an infinite loop.

log :  
[Error] [logstash.inputs.jdbc] Unable to connect to database. Tried 1 times{:error\_message=\>"Java::JavaSql::SqlRecoverableException: IO Error: Unknown host specified}  
[logstash.javapipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Pipeline\_id:main  
Plugin: \<Logstash::

Logstash version 7.2.0

plugin version used  
logstash-input-jdbc (4.3.13)  
logstash-filter-jdbc-static (1.0.6)

Can anyone suggest what i am doing wrong

---

<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:** [September 4, 2020, 12:11pm UTC](https://discuss.elastic.co/t/logstash-continues-to-restart-itself-on-connection-failures/244172/2 "2020-09-04T12:11:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
