Does not work with pg 1.0.0
okkez opened this issue · 5 comments
2018-02-01 11:52:24 +0900 [warn]: #0 failed to flush the buffer. retry_time=0 next_retry_seconds=2018-02-01 11:52:25 +0900 chunk="5641d9e65c4330bdcc74b923a64c27a8" error_class=RuntimeError error="failed to initialize connection: uninitialized constant Fluent::PgJsonOutput::PGconn"
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:71:in `rescue in init_connection'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:64:in `init_connection'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:41:in `write'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluentd-1.1.0/lib/fluent/compat/output.rb:131:in `write'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluentd-1.1.0/lib/fluent/plugin/output.rb:1094:in `try_flush'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluentd-1.1.0/lib/fluent/plugin/output.rb:1319:in `flush_thread_run'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluentd-1.1.0/lib/fluent/plugin/output.rb:439:in `block (2 levels) in start'
2018-02-01 11:52:24 +0900 [warn]: #0 /tmp/local/lib/ruby/gems/2.6.0/gems/fluentd-1.1.0/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
If you don't have enough time to maintain this plugin, I can take over this plugin.
Facing same issue with Postgres 9.6
tried all the ways I could think of, but failed. Got no clue from the debug-log either. Here it is.
2018-06-14 18:18:35 +0000 [warn]: #0 failed to flush the buffer. retry_time=0 next_retry_seconds=2018-06-14 18:18:36 +0000 chunk="56e9e1cf3396141b65265b16f1354759" error_class=RuntimeError error="failed to initialize connection: uninitialized constant Fluent::PgJsonOutput::PGconn"
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:71:in `rescue in init_connection'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:64:in `init_connection'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-pgjson-0.0.8/lib/fluent/plugin/out_pgjson.rb:41:in `write'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.2.2/lib/fluent/compat/output.rb:131:in `write'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.2.2/lib/fluent/plugin/output.rb:1099:in `try_flush'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.2.2/lib/fluent/plugin/output.rb:1378:in `flush_thread_run'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.2.2/lib/fluent/plugin/output.rb:440:in `block (2 levels) in start'
2018-06-14 18:18:35 +0000 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.2.2/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2018-06-14 18:18:36 +0000 [debug]: #0 connecting to PostgreSQL server localhost:5432, database streaming-logs...
2018-06-14 18:18:36 +0000 [debug]: #0 taking back chunk for errors. chunk="56e9e1cf3396141b65265b16f1354759"
2018-06-14 18:18:36 +0000 [warn]: #0 failed to flush the buffer. retry_time=0 next_retry_seconds=2018-06-14 18:18:36 +0000 chunk="56e9e1cf3396141b65265b16f1354759" error_class=RuntimeError error="failed to initialize connection: uninitialized constant Fluent::PgJsonOutput::PGconn"
Any help ?
Ok, i think i got it after losing more than a day to it. Got it from this README of other related plugin https://github.com/fluent/fluent-plugin-sql
To use this plugin, you must use it with pg v.0.21.0
gem, not the latest one which is pg v.1.0.0
as of now. Why?
We must use pg gem 0.21.0 (< 1.0.0) because ActiveRecord 5.0 or later doesn't support Ruby 2.1. NOTE: ActiveRecord has supported pg 1.0.0 since ActiveRecord 5.1.5.
As I am not a Ruby guy, I'll leave it here.
Current master HEAD works fine with pg gem v1.0.0.
Finally, we've released v1.0.0. Thank you @cosmo0920 @okkez @theasp @kmonsoor! Then, I will transfer the ownership of this repository to @fluent-plugins-nursery, as mentioned in #11.