Skip to content

TOML internal.Duration marshaller panics on integers #1926

@denzuko

Description

@denzuko

Bug report

telegraf crashes with snmp input pointed to bigswitch

Relevant telegraf.conf:

'''
[[outputs.influxdb]]
urls = ["http://influxdbmaster:8086"] # required
database = "telegraf" # required

retention_policy = ""
write_consistency = "any"
timeout = "5s"

[[inputs.snmp]]
interval = "15s"
retries = 2
timeout = 5

version = 2
community="public"

agents = [ "bs1.example.tld", "bs2.example.tld" ]

[[inputs.snmp.table]]
name="bigswitch"

[[inputs.snmp.table.field]]
  name="memory"
  oid = ".1.3.6.1.4.1.25506.8.35.18.43.1.3"

'''

System info:

telegraf 1.0.0
influxdb 1.0.0
alpine linux

Steps to reproduce:

start telegraf

Expected behavior

Telegraf started and connected to influx

Actual behavior:

/ # telegraf
2016/10/21 20:39:22 Using config file: /etc/telegraf/telegraf.conf
panic: runtime error: slice bounds out of range

Additional info:

goroutine 1 [running]:
panic(0x12904a0, 0xc82000a050)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/telegraf/internal.(*Duration).UnmarshalTOML(0xc82014b7b8, 0xc8201a4a68, 0x1, 0x8, 0x0, 0x0)
/home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/internal/internal.go:39 +0x270
github.com/influxdata/toml.setUnmarshaler(0x1262080, 0xc82014b7b8, 0x199, 0xc8201a4a60, 0x1, 0x0, 0x0, 0xc8201a4a40)
/home/ubuntu/telegraf-build/src/github.com/influxdata/toml/decode.go:230 +0x2ec
github.com/influxdata/toml.setValue(0x1262080, 0xc82014b7b8, 0x199, 0x7f3ad67eeb18, 0xc8200136c0, 0x0, 0x0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behaviorpanicissue that results in panics from Telegraf

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions