Skip to content

Postgres Adatper SQL Plugin and Nil Pointer Exception #154

@chris-selinc

Description

@chris-selinc

FluentD verison: fluentd 1.17.1
Ruby version: ruby 3.2.5 (2024-07-26 revision 31d0f1a2e7) [x86_64-linux]
Gems:
fluent-plugin-sql (2.3.1)
pg (1.5.9)
This is currently running in a k3s environment.

When using the following configuration for the source in and FluentD:

@type sql
adapter postgresql
host hostname-of-postgres
port 5432
database databaseName
username userName
password passwordForDatabase
tag_prefix postgres
select_interval 5s
state_file /var/run/fluentd/sql_state


table target_table
tag target_table
update_column insertTimestamp


Sometimes I am able to successfully query the database, and other times I am unable to query the database, which results in the following error:
line = caller(depth+1)[0] ^^^ from /usr/local/bundle/gems/fluentd-1.17.1/lib/fluent/log.rb:506:indump_stacktrace'
from /usr/local/bundle/gems/fluentd-1.17.1/lib/fluent/log.rb:389:in warn_backtrace' from /usr/local/bundle/gems/fluentd-1.17.1/lib/fluent/root_agent.rb:287:in rescue in block (3 levels) in shutdown'
from /usr/local/bundle/gems/fluentd-1.17.1/lib/fluent/root_agent.rb:266:in block (3 levels) in shutdown' /usr/local/bundle/gems/fluent-plugin-sql-2.3.1/lib/fluent/plugin/in_sql.rb:252:in shutdown': undefined method `join' for nil:NilClass (NoMethodError)

  @thread.join

`
Sometimes the plugin works as expected, and then I'm able to successfully print out the results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions