Cannot serialize instance of: Sequel::SQL::Blob


#1

LogStash::Json::GeneratorError: Cannot serialize instance of: Sequel::SQL::Blob

The above error is received our new logstash instance.

logstash-2.3
Installed Packages
logstash.noarch 1:2.3.4-1 @logstash-2.3

This does not happen on original logstash instance. Both have the same .conf and .sql files for JDBC pulls.

version for the older install is listed here:
> logstash-2.0
> Installed Packages
> logstash.noarch 1:2.0.0-1 @logstash-2.0

lasts about 30 seconds and then closes out on the new box. It is working and processing just fine on the old box.

output file looks like below, nothing special on the .conf and the .sql file works for other Oracle JDBC pulls just fine (same file) and is just looking up Oracle Audit log trail info.

output {
                kafka {
                        bootstrap_servers => "THE-KAFKA-ELB"
                        topic_id => "%{type}"
                        codec => "json"
                }
}

#2
LogStash::Json::GeneratorError: Cannot serialize instance of: Sequel::SQL::Blob
            jruby_dump at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/json.rb:53
               to_json at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-event-2.3.4-java/lib/logstash/event.rb:142
                encode at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-codec-json-2.1.4/lib/logstash/codecs/json.rb:42
               receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-kafka-2.0.5/lib/logstash/outputs/kafka.rb:151
         multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/outputs/base.rb:83
                  each at org/jruby/RubyArray.java:1613
         multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/outputs/base.rb:83
  worker_multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/output_delegator.rb:130
         multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/output_delegator.rb:114
          output_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:301
                  each at org/jruby/RubyHash.java:1342
          output_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:301
           worker_loop at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:232
         start_workers at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.3.4-java/lib/logstash/pipeline.rb:201

output of the full error.


(Joe Lawson) #3

This is an input error, not an output so your config on that side would be helpful. Sounds like a bug though. Check the github for the plugins you are using.


#4

I'm still having the issue, but only on 2.3 and above.

The issue seems to focus on our connection to oracle DB's. I'm going to retest with MSSQL today.

attached is our input setup but this doesn't have an issue on the older logstash 2.0.0 box.

the config is slightly modified to remove passwords and server names, but effectively is the same.

input {
       jdbc {
                       jdbc_driver_library => "/opt/logstash/lib/ojdbc7.jar"
                       jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
                       jdbc_connection_string => "jdbc:oracle:thin:@oracleserver"
                       jdbc_user => ""
                       statement_filepath => "oracle.sql"
                       schedule => "05 3 * * *"
                        type => "oracle"
                        tags => ["Oracle"]
               }

        jdbc {
                        jdbc_driver_library => "/opt/logstash/lib/ojdbc7.jar"
                        jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
                        jdbc_connection_string => "jdbc:oracle:thin:@oracleserver"
                        jdbc_user => ""
                        statement_filepath => "oracle.sql"
                        schedule => "10 3 * * *"
                        type => "oracle"
                        tags => ["Oracle"]
                }
        jdbc {
                        jdbc_driver_library => "/opt/logstash/lib/ojdbc7.jar"
                        jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
                        jdbc_connection_string => "jdbc:oracle:thin:@oracleserver"
                        jdbc_user => ""
                        statement_filepath => "oracle.sql"
                        schedule => "15 3 * * *"
                        type => "oracle"
                        tags => ["Oracle"]
                }
}

(NSK) #5

LogStash::Json::GeneratorError: Cannot serialize instance of: Sequel::SQL::Blob
jruby_dump at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/json.rb:53
to_json at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-event-2.4.0-java/lib/logstash/event.rb:145
encode at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-codec-json_lines-2.1.3/lib/logstash/codecs/json_lines.rb:48
receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-stdout-2.0.6/lib/logstash/outputs/stdout.rb:55
multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/outputs/base.rb:109
each at org/jruby/RubyArray.java:1613
multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/outputs/base.rb:109
worker_multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/output_delegator.rb:130
multi_receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/output_delegator.rb:114
output_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:301
each at org/jruby/RubyHash.java:1342
output_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:301
worker_loop at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:232
start_workers at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.4.0-java/lib/logstash/pipeline.rb:201

Getting same error in logstash2.4.0.. Any assistance would be greatly appreciated


(Mussie) #6

I have the exact same issue with similar configuration, I'm curious to know the response to this inquiry.


(Pip Jones) #7

FYI. I had the same error, and while I can't see any SQL posted above, for me it was that I needed to CAST some floats to CHAR during a concatenate while forming a GeoPoint string. This is contrary to the MySQL manual, which states concat implicitly converts parameters to strings.

This statement (for logstash-jdbc-plugin) produces the cannot serialise error:

statement => "SELECT gps_log.*, CONCAT(latitude, ',', longitude) as location FROM gps_log"

Whereas this one works OK:

statement => "SELECT gps_log.*, CONCAT(CAST(latitude AS CHAR), ',', CAST(longitude AS CHAR)) as location FROM gps_log"

(ssh) #8

There is a bug reported and still open for logstash 2.4 for this issue - https://github.com/logstash-plugins/logstash-input-jdbc/issues/177


(system) #9