Logstash jdbc sybase connect fails

Working on:
SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux

logstash 7.8.0

I need to connect to a sybase ASE16, using jconn4 driver.
The driver for example works in squirrel without any problems.

input {
  jdbc {
    jdbc_driver_library => "/usr/share/logstash/logstash-core/lib/jars/jconn4.jar"
    jdbc_driver_class => "com.sybase.jdbc4.jdbc.SybDataSource"
    jdbc_connection_string => "jdbc:sybase:Tds:hostname.de:Port?ServiceName=DB"
    jdbc_user => "****"
    jdbc_password => "*****"
    statement => "select * from blub noholdlock where nummer='12334'"
  }
}

The error i am getting over and over is:

[ERROR] 2020-07-22 15:37:43.011 [[main]<jdbc] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"username", jdbc_password=><password>, statement=>"select * from blub noholdlock where nummer='12334314'", jdbc_driver_library=>"/usr/share/logstash/logstash-core/lib/jars/jconn4.jar", jdbc_connection_string=>"jdbc:sybase:Tds:hostname:port?ServiceName=db", id=>"8fc0bcc778a08a28bb8e91cf1c60cb8a8654a8a88f047361669f84a169284086", jdbc_driver_class=>"com.sybase.jdbc4.jdbc.SybDataSource", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_2e86758c-85ac-4e75-8c7a-203783227279", 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, plugin_timezone=>"utc", last_run_metadata_path=>"/root/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true, use_prepared_statements=>false>
  Error: Java::JavaSql::SQLException: No suitable driver found for jdbc:sybase:Tds:spam-sun.schlund.de:5000?ServiceName=vertrag
  Exception: Sequel::DatabaseConnectionError
  Stack: java.sql.DriverManager.getConnection(java/sql/DriverManager.java:702)
java.sql.DriverManager.getConnection(java/sql/DriverManager.java:228)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(jdk/internal/reflect/NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:426)
org.jruby.javasupport.JavaMethod.invokeStaticDirect(org/jruby/javasupport/JavaMethod.java:358)

I have read, that i would have to move the driver jar to "/usr/share/logstash/logstash-core/lib/jars/". Before i tried it in a custom folder.
It works neither way.

Can you please help out... this starts getting ridiculous.

KR
Chris

Does it work if you remove the jdbc_driver_library parameter from your configuration?

Hi Jenni,

thanks for your reply. Unfortunately removing the jdbc_driver_library parameter didnt fix it.
Same error:

[ERROR] 2020-07-24 15:02:48.989 [[main]<jdbc] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"*****", jdbc_password=><password>, statement=>"select * from **** noholdlock where ****='****'", jdbc_connection_string=>"jdbc:sybase:Tds:*****:****?ServiceName=****", id=>"2ea94006854d03a6ba3dd990f3504f3ff3c1e6189b8ded957fcd9597e52ff98b", jdbc_driver_class=>"com.sybase.jdbc4.jdbc.SybDataSource", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_81794e61-b050-41f3-a2a7-26e303ca3226", 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, plugin_timezone=>"utc", last_run_metadata_path=>"/root/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true, use_prepared_statements=>false>
  Error: Java::JavaSql::SQLException: No suitable driver found for jdbc:sybase:Tds:******:***?ServiceName=******
  Exception: Sequel::DatabaseConnectionError
  Stack: java.sql.DriverManager.getConnection(java/sql/DriverManager.java:702)
java.sql.DriverManager.getConnection(java/sql/DriverManager.java:228)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jdk.internal.reflect.NativeMethodAccessorImpl.invoke(jdk/internal/reflect/NativeMethodAccessorImpl.java:62)
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:426)
org.jruby.javasupport.JavaMethod.invokeStaticDirect(org/jruby/javasupport/JavaMethod.java:358)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_32_dot_0.lib.sequel.adapters.jdbc.connect(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.32.0/lib/sequel/adapters/jdbc.rb:215)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_32_dot_0.lib.sequel.connection_pool.make_new(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.32.0/lib/sequel/connection_pool.rb:122)
usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_32_dot_0.lib.sequel.connection_pool.threaded.assign_connection(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.32.0/lib/sequel/connection_pool/threaded.rb:209)

KR
CHris

Hi,

anyone else who has an advice here?

KR
Chris

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