JDBC input, kafka output, syntax error, unexpected end-of-file Java:: after pipeline starts

We are seeing the following error messages after starting our pipeline:

[2022-01-13T19:48:06,009][FATAL][org.logstash.Logstash  ] Logstash stopped processing because of an error: (SyntaxError) (eval):1: syntax error, unexpected end-of-file


We did not have this issue in 7.6.2 but are seeing it after 7.16.2/3 upgrade. Full error scrape below:

2022-01-13T19:48:05,769][INFO ][logstash.agent      ] Pipelines running {:count=>2, :running_pipelines=>[:p_sltdb_jdbc, :p_sltdb_jdbc_metrics], :non_running_pipelines=>[]}

[2022-01-13T19:48:06,009][FATAL][org.logstash.Logstash  ] Logstash stopped processing because of an error: (SyntaxError) (eval):1: syntax error, unexpected end-of-file



org.jruby.exceptions.SyntaxError: (SyntaxError) (eval):1: syntax error, unexpected end-of-file



    at org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:1048) ~[jruby-complete-]

    at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_51_dot_0.lib.sequel.adapters.jdbc.load_driver(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.51.0/lib/sequel/adapters/jdbc.rb:55) ~[?:?]

    at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_1_dot_8.lib.logstash.plugin_mixins.jdbc.common.load_driver(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.1.8/lib/logstash/plugin_mixins/jdbc/common.rb:33) ~[?:?]

    at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_integration_minus_jdbc_minus_5_dot_1_dot_8.lib.logstash.inputs.jdbc.run(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-integration-jdbc-5.1.8/lib/logstash/inputs/jdbc.rb:294) ~[?:?]

unexpected end-of-file ... at usr.share.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_51_dot_0.lib.sequel.adapters.jdbc.load_driver(/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/sequel-5.51.0/lib/sequel/adapters/jdbc.rb:55)

That is here. If you are using a jdbc input then it is evaluating the jdbc_driver_class option string, expecting JRuby to auto-load it. I cannot tell you any more than that.

Any thoughts on why the same config file would work in 7.6.2 but fail in 7.16.2/3 ?
Your input is much appreciated of course,

Found a note attached to the jdbc_driver_class option here that specifies you may have to add Java:: to a jdbc_driver_class entry. I find it odd that it would start failing with a similar message after updating to new version.

Also, to validate, jdbc_driver_class => "" is an acceptable entry in the config when jdbc_driver_library => "/etc/logstash/jtds-1.3.1.jar"

Thanks again,

7.6 did not bundle a JDK, but 7.16 does. That means you could be using a different Java version and conceivably even a different Java vendor.

I cannot speak to your other question.

We have performed the following:
Change the parameter in
from: #JAVACMD=/usr/bin/java
to: JAVACMD=/bin/java


# which java

# ls -la /bin/java
lrwxrwxrwx 1 root root 22 Jan  8 05:37 /bin/java -> /etc/alternatives/java

# ls -la /etc/alternatives/java
lrwxrwxrwx 1 root root 73 Jan  8 05:37 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-

Then execute:
and finally:
systemctl restart logstash

After changing (a previously working):
jdbc_driver_class => ""
jdbc_driver_class => "net.sourceforge.jtds.jdbc.Driver"
we seem to be working now.

We also tested this with the built in jdk and it worked correctly.

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