Logstash-filter-jdbc_streaming -- parameter issue calling stored procedure (MSSQL)

Alright so....a new day a fresh set of eyes :slight_smile:

Turns out that this error message seems to be benign. I tried to determine why the exception was being thrown but I had to move on.

Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Invalid length parameter passed to the LEFT or SUBSTRING function.>}

Yesterday as I was troubleshooting, our database was having performance issues so the stored procedure was taking a much longer time to execute. Had I waited 5 minutes I could have determined this and moved on to the next issue :frowning:

The Real Problem:
Once the jdbc query is executed and the results are returned to logstash I receive the following error message and the pipeline stops processing.

Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. 

     {
         :pipeline_id=>"dev_inference", 
         "exception"=>"Missing Converter handling for full class name=org.jruby.RubyObjectVar3, simple name=RubyObjectVar3", 
         "backtrace"=>[
            "org.logstash.Valuefier.fallbackConvert(Valuefier.java:97)", 
            "org.logstash.Valuefier.convert(Valuefier.java:75)", ....
            <could not post entire stack>
        ], 
        :thread=>"#<Thread:0x508dd494@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:157 sleep>"
    } 

A little googling on

Missing Converter handling for full class name=org.jruby.RubyObjectVar3

Lead me to an old discussion topic: https://discuss.elastic.co/t/problem-with-timestamp-and-timezone/148622

Which resulted in an issue being logged for the logstash-input-jdbc plugin:
https://github.com/logstash-plugins/logstash-input-jdbc/issues/302

Which lead me to guyboertje's comment pointing back to the logstash-filter-jdbc_streaming plugin: Problem with data enrichment using jdbc_default_timezone and fields of type "timestamp" · Issue #302 · logstash-plugins/logstash-input-jdbc · GitHub

Given the conversation it seemed like this was a type issue, where one of my MSSQL types was not playing well with whatever this internal JRuby class (org.jruby.RubyObjectVar3) is doing. Going through some process of elimination I found the culprit. I had a single date type field being leveraged to remove the time value as it was not needed. All I had to do was cast this date type into our standard datetime2 type and everything was right with the world.

I am not sure if upgrading to a newer version of LS would solve this problem but currently that's not an option for me. Wanted to make sure this issue was documented in case someone else runs into it in the future.

Thanks!

1 Like