Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql_extensible crash on null value #4688

Closed
aleszeleny opened this issue Sep 13, 2018 · 0 comments
Closed

postgresql_extensible crash on null value #4688

aleszeleny opened this issue Sep 13, 2018 · 0 comments
Assignees
Labels
area/postgresql bug unexpected problem or unintended behavior

Comments

@aleszeleny
Copy link

Relevant telegraf.conf:

[[outputs.influxdb]]
  urls = ["http://localhost:8086"]

  [[inputs.postgresql_extensible.query]]
    sqlquery='''
      SELECT *
      FROM pg_catalog.pg_stat_activity
    '''
    version=100
    withdbname=false

System info:

Linux 4.4.0-1061-aws #70-Ubuntu SMP Fri May 25 21:47:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

telegraf --version
Telegraf v1.7.4 (git: release-1.7 578db7ef)

Steps to reproduce:

drop target measurement on influxdb side and

select have to capture at least one column with null value, can be simplified:

    sqlquery='''
      SELECT
        null as datname
      FROM pg_catalog.pg_stat_activity
'''

Expected behavior:

Insert null and did not crash

Actual behavior:

# /usr/bin/telegraf -config /etc/telegraf/fr_usd_dev-5432.conf
panic: interface conversion: interface {} is nil, not string

goroutine 16 [running]:
github.com/influxdata/telegraf/plugins/inputs/postgresql_extensible.(*Postgresql).accRow(0xc42019e120, 0xc420304cc1, 0x10, 0x17ac460, 0xc4201c8780, 0x17c9f20, 0xc42048dce0, 0xc4203b8c00, 0x2, 0x2, ...)
        /go/src/github.com/influxdata/telegraf/plugins/inputs/postgresql_extensible/postgresql_extensible.go:226 +0xe5e
github.com/influxdata/telegraf/plugins/inputs/postgresql_extensible.(*Postgresql).Gather(0xc42019e120, 0x17c9f20, 0xc42048dce0, 0x0, 0x0)
        /go/src/github.com/influxdata/telegraf/plugins/inputs/postgresql_extensible/postgresql_extensible.go:184 +0x40e
github.com/influxdata/telegraf/agent.gatherWithTimeout.func1(0xc42017c540, 0xc42040cf00, 0x17c9f20, 0xc42048dce0)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:153 +0x47
created by github.com/influxdata/telegraf/agent.gatherWithTimeout
        /go/src/github.com/influxdata/telegraf/agent/agent.go:152 +0xd4

Additional info:

crash is not written to logfile.

@glinton glinton self-assigned this Sep 13, 2018
@glinton glinton added bug unexpected problem or unintended behavior area/postgresql labels Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/postgresql bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants