Telegraf Panic Runtime Error: Invalid Memory Address

Hello, fairly new to snmp, Telegraf, and the whole shebang, so I apologize if my explanation is a bit confusing. I’m needing to pull temperature data from some Geist temp sensors. Grafana and Telegraf are linked together through InfluxDB. The three services seem to be communicating properly. I tried configuring my snmp inputs but every time I test out my .conf file it shows a “panic: runtime error”:

pi@Grafana:~ $ telegraf --test --config /etc/telegraf/telegraf.d/raspberrypi.conf
2021-01-16T19:12:12Z I! Starting Telegraf 1.17.0
2021-01-16T19:12:12Z E! [agent] Starting input inputs.snmp_trap: listen udp :162: bind: address already in use
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x159f43c]

goroutine 15 [running]:
github.com/soniah/gosnmp.(*TrapListener).Close(0x4502f30)
        /go/pkg/mod/github.com/soniah/gosnmp@v1.25.0/trap.go:131 +0x48
github.com/influxdata/telegraf/plugins/inputs/snmp_trap.(*SnmpTrap).Stop(0x4520200)
        /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp_trap/snmp_trap.go:251 +0x20
github.com/influxdata/telegraf/agent.stopServiceInputs(0x492c678, 0x2, 0x2)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:445 +0x74
github.com/influxdata/telegraf/agent.(*Agent).testRunInputs(0x492c650, 0x2773b28, 0x4533760, 0x0, 0x0, 0x440d7a0, 0x1, 0x15b7168)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:434 +0x160
github.com/influxdata/telegraf/agent.(*Agent).test.func4(0x48955e4, 0x492c650, 0x2773b28, 0x4533760, 0x0, 0x0, 0x440d7a0)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:977 +0x70
created by github.com/influxdata/telegraf/agent.(*Agent).test
        /go/src/github.com/influxdata/telegraf/agent/agent.go:975 +0x25c

Here is my .conf file:

[[inputs.snmp_trap]]
   service_address = "udp://:162"
   timeout = "5s"
   version = "3"
   sec_name = "####"
   auth_protocol = "MD5"
   auth_password = "####"
   sec_level = "authPriv"
   priv_protocol = "AES"
   priv_password = "####"

[[inputs.snmp]]
   agents = [ "192.168.1.244" ]

   timeout = "3s"
   retries = 5

   version = 3
   sec_name = "####"
   auth_protocol = "MD5"
   auth_password = "####"
   sec_level = "authPriv"
  ## context_name = ""
   priv_protocol = "AES"
   priv_password = "####"

   [[inputs.snmp.field]]
     name = "currentTempMain"
     oid = "1.3.6.1.4.1.21239.5.1.2.1.5"

   [[inputs.snmp.field]]
     name = "currentHumidityMain"
     oid = "1.3.6.1.4.1.21239.5.1.2.1.6"

   [[inputs.snmp.field]]
     name = "currentDewPointMain"
     oid = "1.3.6.1.4.1.21239.5.1.2.1.7"

   [[inputs.snmp.field]]
     name = "currentTempRemote"
     oid = "1.3.6.1.4.1.21239.5.1.4.1.5"

Any help/guidance at all would be greatly appreciated! Thanks.

Hello @Kuuchuu ,
I’m not sure.
Let me ask the telegraf team.
Is this related to your issue at all?

It looks to me like this is the same crash that’s described in the github issue Anais linked. @Kuuchuu would you leave a comment on the issue to report that you’re also experiencing the problem? Then we can track the fix through the issue. Thanks!

1 Like