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

**URL:** https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911
**Category:** Logstash
**Created:** [July 19, 2016, 6:22pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911 "2016-07-19T18:22:26Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bizkit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bizkit/32/11012_2.png) [@bizkit](https://discuss.elastic.co/u/bizkit)
#### Post date: [July 19, 2016, 6:22pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/1 "2016-07-19T18:22:26Z")

</div>

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"
                }
}

```

---

<div class="post-metadata">

### Author: ![bizkit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bizkit/32/11012_2.png) [@bizkit](https://discuss.elastic.co/u/bizkit)
#### Post date: [July 20, 2016, 4:16pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/2 "2016-07-20T16:16:17Z")

</div>

```
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.

---

<div class="post-metadata">

### Author: ![Joe\_Lawson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_lawson/32/3390_2.png) [@Joe\_Lawson](https://discuss.elastic.co/u/Joe_Lawson)
#### Post date: [August 3, 2016, 6:15pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/3 "2016-08-03T18:15:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![bizkit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bizkit/32/11012_2.png) [@bizkit](https://discuss.elastic.co/u/bizkit)
#### Post date: [August 16, 2016, 6:26pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/4 "2016-08-16T18:26:53Z")

</div>

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"]
                }
}
```

---

<div class="post-metadata">

### Author: ![NSK](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@NSK](https://discuss.elastic.co/u/NSK)
#### Post date: [October 21, 2016, 10:27pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/5 "2016-10-21T22:27:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![MGG](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@MGG](https://discuss.elastic.co/u/MGG)
#### Post date: [October 23, 2016, 4:44pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/6 "2016-10-23T16:44:45Z")

</div>

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

---

<div class="post-metadata">

### Author: ![scipilot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scipilot/32/14166_2.png) [@scipilot](https://discuss.elastic.co/u/scipilot)
#### Post date: [December 27, 2016, 3:33pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/7 "2016-12-27T15:33:54Z")

</div>

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"
```

---

<div class="post-metadata">

### Author: ![Somnath\_Shantveer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/somnath_shantveer/32/10084_2.png) [@Somnath\_Shantveer](https://discuss.elastic.co/u/Somnath_Shantveer)
#### Post date: [April 14, 2017, 10:13pm UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/8 "2017-04-14T22:13:24Z")

</div>

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](https://github.com/logstash-plugins/logstash-input-jdbc/issues/177)

---

<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 6, 2017, 4:27am UTC](https://discuss.elastic.co/t/cannot-serialize-instance-of-sequel-sql-blob/55911/9 "2017-07-06T04:27:02Z")

</div>


