# LogStash JDBC input Error - sqlanywhere - Sybase - undefined method \`new

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-input-error-sqlanywhere-sybase-undefined-method-new/132907>\
**Category:** Logstash\
**Created:** [May 23, 2018, 12:54am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-error-sqlanywhere-sybase-undefined-method-new/132907 "2018-05-23T00:54:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pquery](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pquery](https://discuss.elastic.co/u/pquery)\
**Post date:** [May 23, 2018, 12:54am UTC](https://discuss.elastic.co/t/logstash-jdbc-input-error-sqlanywhere-sybase-undefined-method-new/132907/1 "2018-05-23T00:54:34Z")

</div>

I have been trying to use the JDBC input plugin to connect to my Sybase database (running on a SUSE server) and I think that I have it close but it is throwing a strange error at the moment:

```
[2018-05-23T00:47:43,415][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error_message=>"NoMethodError: undefined method `new' for #<Array:0x6b29b1a4>"}

```

[2018-05-23T00:47:43,416][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.

Here is the full stack trace that loops over and over again:

```
[2018-05-23T00:51:39,594][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error_message=>"NoMethodError: undefined method `new' for #<Array:0x6b29b1a4>"}

```

[2018-05-23T00:51:39,595][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.  
Pipeline\_id:main  
Plugin: \<LogStash::Inputs::Jdbc jdbc\_connection\_string=\>"jdbc:sqlanywhere://localhost:2638/BI4\_Audit", jdbc\_user=\>"dba", jdbc\_driver\_library=\>"/opt/sap/sqlanywhere/java/sajdbc4.jar", jdbc\_driver\_class=\>" ", jdbc\_password=\>, statement=\>"SELECT \* from dba.ADS\_EVENT", id=\>"9d6bf0203ba84c0e0b18ae38326fd9d45faa9a25fa1559537cb5986443b6469c", enable\_metric=\>true, codec=\>\<LogStash::Codecs::Plain id=\>"plain\_09f9b51d-42a0-403f-aad1-55827c2831e7", enable\_metric=\>true, charset=\>"UTF-8"\>, jdbc\_paging\_enabled=\>false, jdbc\_page\_size=\>100000, jdbc\_validate\_connection=\>false, 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 +0000}, last\_run\_metadata\_path=\>"/home/ec2-user/.logstash\_jdbc\_last\_run", use\_column\_value=\>false, tracking\_column\_type=\>"numeric", clean\_run=\>false, record\_last\_run=\>true, lowercase\_column\_names=\>true\>  
Error: NoMethodError: undefined method `new' for #<Array:0x6b29b1a4> Exception: Sequel::DatabaseConnectionError Stack: /opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/adapters/jdbc.rb:203:in`connect'  
/opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/connection\_pool.rb:126:in `make_new' /opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/connection_pool/threaded.rb:192:in`assign\_connection'  
/opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/connection\_pool/threaded.rb:133:in `acquire' /opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/connection_pool/threaded.rb:90:in`hold'  
/opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:269:in `synchronize' /opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:279:in`test\_connection'  
/opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/database/connecting.rb:58:in `connect' /opt/logstash/logstash-6.2.4/vendor/bundle/jruby/2.3.0/gems/sequel-5.7.1/lib/sequel/core.rb:116:in`connect'  
/opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/plugin\_mixins/jdbc.rb:114:in `block in jdbc_connect' org/jruby/RubyKernel.java:1292:in`loop'  
/opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/plugin\_mixins/jdbc.rb:111:in `jdbc_connect' /opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/plugin_mixins/jdbc.rb:164:in`open\_jdbc\_connection'  
/opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/plugin\_mixins/jdbc.rb:220:in `execute_statement' /opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/inputs/jdbc.rb:264:in`execute\_query'  
/opt/logstash/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.9/lib/logstash/inputs/jdbc.rb:250:in `run' /opt/logstash/logstash/logstash-core/lib/logstash/pipeline.rb:514:in`inputworker'  
/opt/logstash/logstash/logstash-core/lib/logstash/pipeline.rb:507:in `block in start\_input'

Here is the basic configuration that I am running for the input:  
input {  
jdbc {  
# Postgres jdbc connection string to our database, mydb  
jdbc\_connection\_string =\> "jdbc:sqlanywhere://localhost:2638/BI4\_Audit"  
# The user we wish to execute our statement as  
jdbc\_user =\> "user"  
# The path to our downloaded jdbc driver  
jdbc\_driver\_library =\> "/opt/sap/sqlanywhere/java/sajdbc4.jar"  
# The name of the driver class for Postgresql  
jdbc\_driver\_class =\> " "  
# Add the password for the DB user  
jdbc\_password =\> "password"  
# Add a schedule (run every 5 minutes)  
#schedule =\> "30 \* \* \* \* \*"  
# our query  
statement =\> "SELECT \* from dba.ADS\_EVENT"  
}  
}

I have gotten past the driver class errors which I had before but am not sure about this undefined method `new

Help is appreciated

---

<div class="post-metadata">

**Author:** ![pquery](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@pquery](https://discuss.elastic.co/u/pquery)\
**Post date:** [June 4, 2018, 6:08pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-error-sqlanywhere-sybase-undefined-method-new/132907/2 "2018-06-04T18:08:18Z")

</div>

I have seen this error in a few threads, however the moderators just seem to let it close.

I know it is not as simple as postgres or mySQL connections but has anyone in the last 2 years been able to at least figure out why this error always appears?

---

<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 2, 2018, 6:08pm UTC](https://discuss.elastic.co/t/logstash-jdbc-input-error-sqlanywhere-sybase-undefined-method-new/132907/3 "2018-07-02T18:08:28Z")

</div>

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