# Logstash error with jdbc connection

**URL:** <https://discuss.elastic.co/t/logstash-error-with-jdbc-connection/92866>\
**Category:** Logstash\
**Created:** [July 12, 2017, 6:40pm UTC](https://discuss.elastic.co/t/logstash-error-with-jdbc-connection/92866 "2017-07-12T18:40:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudra](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@rudra](https://discuss.elastic.co/u/rudra)\
**Post date:** [July 12, 2017, 6:40pm UTC](https://discuss.elastic.co/t/logstash-error-with-jdbc-connection/92866/1 "2017-07-12T18:40:04Z")

</div>

Unable to connect to oracle database from a logstash conf file:

input {  
jdbc {  
jdbc\_validate\_connection =\> true  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@:1522/"  
jdbc\_user =\> "\<\>"  
jdbc\_password =\> "\<\>"  
jdbc\_driver\_library =\> "/config-dir/ojdbc7-12.1.0.2.0.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
#use\_column\_value =\> true  
#tracking\_column =\> executiondate  
statement=\>"select testcase from QE\_EXECUTIONTABLE"  
}  
}

output {  
elasticsearch {

```
      hosts => "elasticsearch:9200"
}

    stdout{codec=>json_lines}
    #stdout{}

```

I start the logstash like this:

docker run -h logstash --name logstash --link elasticsearch:elasticsearch -it --rm -v "$PWD":/config-dir logstash -f /config-dir/logstash.conf

I get errors continuously:  
docker run -h logstash --name logstash --link elasticsearch:elasticsearch -it --rm -v "$PWD":/config-dir logstash -f /config-dir/logstash.conf  
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.  
Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties  
18:38:37.487 [main] INFO logstash.setting.writabledirectory - Creating directory {:setting=\>"path.queue", :path=\>"/var/lib/logstash/queue"}  
18:38:37.491 [main] INFO logstash.setting.writabledirectory - Creating directory {:setting=\>"path.dead\_letter\_queue", :path=\>"/var/lib/logstash/dead\_letter\_queue"}  
18:38:37.512 [LogStash::Runner] INFO logstash.agent - No persistent UUID file found. Generating new UUID {:uuid=\>"f040e3a4-b40f-41b2-bafb-689c68ae6ba5", :path=\>"/var/lib/logstash/uuid"}  
18:38:37.829 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Elasticsearch pool URLs updated {:changes=\>{:removed=\>, :added=\>[[http://elasticsearch:9200/](http://elasticsearch:9200/)]}}  
18:38:37.829 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Running health check to see if an Elasticsearch connection is working {:healthcheck\_url=\>[http://elasticsearch:9200/](http://elasticsearch:9200/), :path=\>"/"}  
18:38:37.893 [[main]-pipeline-manager] WARN logstash.outputs.elasticsearch - Restored connection to ES instance {:url=\>#Java::JavaNet::URI:0x8ecb39e}  
18:38:37.895 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Using mapping template from {:path=\>nil}  
18:38:38.048 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - Attempting to install template {:manage\_template=\>{"template"=\>"logstash-_", "version"=\>50001, "settings"=\>{"index.refresh\_interval"=\>"5s"}, "mappings"=\>{"default"=\>{"\_all"=\>{"enabled"=\>true, "norms"=\>false}, "dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date", "include\_in\_all"=\>false}, "@version"=\>{"type"=\>"keyword", "include\_in\_all"=\>false}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}}  
18:38:38.053 [[main]-pipeline-manager] INFO logstash.outputs.elasticsearch - New Elasticsearch output {:class=\>"LogStash::Outputs::Elasticsearch", :hosts=\>[#Java::JavaNet::URI:0x323cad72]}  
18:38:38.056 [[main]-pipeline-manager] INFO logstash.pipeline - Starting pipeline {"id"=\>"main", "pipeline.workers"=\>6, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>5, "pipeline.max\_inflight"=\>750}  
18:38:38.146 [[main]-pipeline-manager] INFO logstash.pipeline - Pipeline main started  
18:38:38.190 [Api Webserver] INFO logstash.agent - Successfully started Logstash API endpoint {:port=\>9600}  
18:38:58.096 [[main]\<jdbc] WARN logstash.inputs.jdbc - Failed test\_connection.  
18:38:58.099 [[main]\<jdbc] ERROR logstash.pipeline - A plugin had an unrecoverable error. Will restart this plugin.  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_validate\_connection=\>true, jdbc\_connection\_string=\>"jdbc:oracle:thin:@dentsd3dlpx04.test.tiaa-cref.org:1522/suu004", jdbc\_user=\>"qprobews", jdbc\_password=\>, jdbc\_driver\_library=\>"/config-dir/ojdbc7-12.1.0.2.0.jar", jdbc\_driver\_class=\>"Java::oracle.jdbc.driver.OracleDriver", statement=\>"select testcase from QE\_EXECUTIONTABLE", id=\>"58ac81bab11ca47886f1a0bb6a1c547e10b82d36-1", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_a81cecb5-dec0-4a2d-a32a-47601b5e72e1", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_page\_size=\>100000, jdbc\_validation\_timeout=\>3600, jdbc\_pool\_timeout=\>5, sql\_log\_level=\>"info", connection\_retry\_attempts=\>1, connection\_retry\_attempts\_wait\_time=\>0.5, parameters=\>{"sql\_last\_value"=\>1970-01-01 00:00:00 UTC}, last\_run\_metadata\_path=\>"/usr/share/logstash/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>  
Error: undefined method `close\_jdbc\_connection' for #Sequel::JDBC::Database:0x1b8ac9b9  
18:38:59.213 [[main]\<jdbc] WARN logstash.inputs.jdbc - Exception when executing JDBC query {:exception=\>#\<Sequel::DatabaseConnectionError: Java::JavaSql::SQLException: ORA-00604: error occurred at recursive SQL level 1  
ORA-01882: timezone region not found

> }  
> 18:38:59.213 [[main]\<jdbc] WARN logstash.inputs.jdbc - Attempt reconnection.  
> 18:38:59.332 [[main]\<jdbc] WARN logstash.inputs.jdbc - Failed test\_connection.  
> 18:38:59.334 [[main]\<jdbc] ERROR logstash.pipeline - A plugin had an unrecoverable error. Will restart this plugin.  
> Plugin: \<LogStash::Inputs::Jdbc jdbc\_validate\_connection=\>true, jdbc\_connection\_string=\>"jdbc:oracle:thin:@dentsd3dlpx04.test.tiaa-cref.org:1522/suu004", jdbc\_user=\>"qprobews", jdbc\_password=\>, jdbc\_driver\_library=\>"/config-dir/ojdbc7-12.1.0.2.0.jar", jdbc\_driver\_class=\>"Java::oracle.jdbc.driver.OracleDriver", statement=\>"select testcase from QE\_EXECUTIONTABLE", id=\>"58ac81bab11ca47886f1a0bb6a1c547e10b82d36-1", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_a81cecb5-dec0-4a2d-a32a-47601b5e72e1", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_page\_size=\>100000, jdbc\_validation\_timeout=\>3600, jdbc\_pool\_timeout=\>5, sql\_log\_level=\>"info", connection\_retry\_attempts=\>1, connection\_retry\_attempts\_wait\_time=\>0.5, parameters=\>{"sql\_last\_value"=\>1970-01-01 00:00:00 UTC}, last\_run\_metadata\_path=\>"/usr/share/logstash/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>

---

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [July 24, 2017, 2:45pm UTC](https://discuss.elastic.co/t/logstash-error-with-jdbc-connection/92866/2 "2017-07-24T14:45:11Z")

</div>

From [http://www.orafaq.com/wiki/JDBC#Thin\_driver](http://www.orafaq.com/wiki/JDBC#Thin_driver)

> SID (no longer recommended by Oracle to be used):  
> `jdbc:oracle:thin:[<user>/<password>]@<host>[:<port>]:<SID>`  
> Services:  
> `jdbc:oracle:thin:[<user>/<password>]@//<host>[:<port>]/<service>`  
> TNSNames:  
> `jdbc:oracle:thin:[<user>/<password>]@<TNSName>`

> There is no reliable universal URL format, it must be decided according to the server configuration.

the connection string should look like:  
`jdbc:oracle:thin:qprobews/password@//dentsd3dlpx04.test.tiaa-cref.org:1522/suu004`

---

<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:** [August 21, 2017, 2:45pm UTC](https://discuss.elastic.co/t/logstash-error-with-jdbc-connection/92866/3 "2017-08-21T14:45:40Z")

</div>

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