Logstash 6.6.0 jdbc_input plugin crashing during timezone conversion

Since updating to 6.6.0, the jdbc_input plugin is crashing with an undefined method error:

[2019-02-01T13:02:30,997][ERROR][logstash.pipeline        ] A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"", jdbc_password=><password>, statement=>"SELECT NOW()", jdbc_driver_library=>"mysql-connector-java-8.0.15.jar", jdbc_default_timezone=>"America/New_York", jdbc_connection_string=>"jdbc:mysql://localhost./db", id=>"532cc08b967cd83769ec6dddfc943de647896180de25d5e6e4ff077a0758f4f5", jdbc_driver_class=>"com.mysql.cj.jdbc.Driver", record_last_run=>false, enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_ff4ef9ea-b1be-48a2-9b85-95706729cd6c", 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, parameters=>{"sql_last_value"=>#<DateTime: 1970-01-01T00:00:00+00:00 ((2440588j,0s,0n),+0s,2299161j)>}, last_run_metadata_path=>"/var/lib/logstash/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, lowercase_column_names=>true>
  Error: NoMethodError: undefined method `utc_total_offset_rational' for #<TZInfo::TransitionsTimezonePeriod:0x44e70169>
Did you mean?  utc_total_offset
  Exception: Sequel::InvalidValue
  Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/extensions/named_timezones.rb:71:in `convert_input_datetime_other'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/timezones.rb:119:in `convert_input_datetime_no_offset'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/timezones.rb:156:in `convert_input_timestamp'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/timezones.rb:77:in `convert_timestamp'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/database/misc.rb:298:in `to_application_timestamp'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:686:in `timestamp_convert'
org/jruby/RubyMethod.java:127:in `call'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:793:in `block in process_result_set'
org/jruby/RubyArray.java:1734:in `each'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:792:in `process_result_set'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:726:in `block in fetch_rows'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:244:in `block in execute'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:675:in `statement'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:239:in `block in execute'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/connection_pool/threaded.rb:92:in `hold'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/database/connecting.rb:270:in `synchronize'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:238:in `execute'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/dataset/actions.rb:1083:in `execute'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/adapters/jdbc.rb:726:in `fetch_rows'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/sequel-5.16.0/lib/sequel/dataset/actions.rb:151:in `each'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:257:in `perform_query'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/plugin_mixins/jdbc/jdbc.rb:229:in `execute_statement'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:277:in `execute_query'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-jdbc-4.3.13/lib/logstash/inputs/jdbc.rb:263:in `run'
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:409:in `inputworker'
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:403:in `block in start_input'

You can duplicate this with this simple config:

input {
    jdbc {
        jdbc_connection_string => "jdbc:mysql://<host>/<database>"
        jdbc_user => ""
        jdbc_password => ""
        jdbc_driver_library => "/path/to/mysql-connector-java-8.0.15.jar"
        jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
        jdbc_default_timezone => "America/New_York"
        statement => "SELECT NOW()"
        record_last_run => false
    }
}
output {
    stdout { codec => rubydebug }
}

If you comment out the timezone config parameter, it runs fine.

It looks like this issue was opened on the Logstash JDBC Input Plugin yesterday:

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