-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Telegraf OPCUA runtime error: invalid memory address or nil pointer dereference #9164
Comments
@jeffsparks @henjoe Can you both test with the latest version of Telegraf. Looks like #9551 #9524 #9583 have all been merged since this issue was opened. |
Hello Thanks for this. |
I will test again but it will take a few days |
I think the only way this can panic at https://github.com/gopcua/opcua/blob/v0.1.13/ua/node_id.go#L396-L398 is if the node id is |
Maybe something going wrong in |
I would suggest to not register nodes unless you know that it is supported by the OPC/UA server and that you can handle the auto-reconnect case where the session might invalidate the registered node id. In any case, registered reads are performance optimization for very high-volume, very high-frequency reads and not needed IMHO for normal data collection. See gopcua/opcua#557 and gopcua/opcua#478 |
Also, please test this with the latest gopcua version which at this moment is v0.3.1. It is very different from v0.1.13 |
Any update on this issue. I am using telegraf v1.23.0 and have attempted to connect to the GE iFix OPC UA Server and Kepware both of which produce this error. *Edit *Edit |
Yes. Same issue. |
Relevant telegraf.conf:
System info:
Telegraf 1.18.1
Ubuntu Server
Docker
Steps to reproduce:
Expected behavior:
Full disclaimer: I haven't got it to work yet, but due to error message I don't think it is related to my configuration
Actual behavior:
jeff@ubuntu-server:~$ sudo telegraf --config /etc/telegraf/telegraf.conf
2021-04-21T14:19:53Z I! Starting Telegraf 1.18.1
2021-04-21T14:19:53Z I! Loaded inputs: cpu disk diskio kernel mem opcua processes swap system
2021-04-21T14:19:53Z I! Loaded aggregators:
2021-04-21T14:19:53Z I! Loaded processors:
2021-04-21T14:19:53Z I! Loaded outputs: influxdb_v2
2021-04-21T14:19:53Z I! Tags enabled: host=ubuntu-server
2021-04-21T14:19:53Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"ubuntu-server", Flush Interval:10s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1a11bf2]
goroutine 51 [running]:
github.com/gopcua/opcua/ua.(*NodeID).Encode(0x0, 0x39a5a00, 0x0, 0x7fe56d37fac0, 0x0, 0x0)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/node_id.go:398 +0x52
github.com/gopcua/opcua/ua.encode(0x39a5a00, 0xc000010770, 0x196, 0xc000545980, 0x2b, 0xc000010770, 0x196, 0x8, 0xc000c615b8, 0x30e314b)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:46 +0xccf
github.com/gopcua/opcua/ua.writeSlice(0x32e05c0, 0xc00024d928, 0x197, 0xc000545950, 0x28, 0x457814, 0x28, 0xc000545950, 0x28, 0xc000545950)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:131 +0x2ea
github.com/gopcua/opcua/ua.encode(0x32e05c0, 0xc00024d928, 0x197, 0xc000545950, 0x28, 0xc00024d928, 0x197, 0xc000545950, 0x28, 0x0)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:85 +0xa87
github.com/gopcua/opcua/ua.writeStruct(0x36a1980, 0xc00024d920, 0x199, 0x31102e0, 0x18, 0x3506d38, 0x203000, 0x307c368, 0x203000, 0x306dc23)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:99 +0x258
github.com/gopcua/opcua/ua.encode(0x36a1980, 0xc00024d920, 0x199, 0x31102e0, 0x18, 0x199, 0x465dd3, 0x3471f00, 0x0, 0xc0002f41a0)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:83 +0xb31
github.com/gopcua/opcua/ua.encode(0x3506d00, 0xc00024d920, 0x16, 0x31102e0, 0x18, 0xc000c616c8, 0x4, 0xc000c616e0, 0x7fe56d3987a0, 0xc000bd5808)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:81 +0x993
github.com/gopcua/opcua/ua.Encode(0x3506d00, 0xc00024d920, 0xc00024d920, 0x0, 0x0, 0x0, 0x4)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/encode.go:34 +0x118
github.com/gopcua/opcua/ua.(*Buffer).WriteStruct(0xc000bd5958, 0x3506d00, 0xc00024d920)
/go/pkg/mod/github.com/gopcua/[email protected]/ua/buffer.go:306 +0x67
github.com/gopcua/opcua/uasc.(*Message).Encode(0xc00024d9a0, 0x428ed88, 0xc00024d920, 0xc000000004, 0xc000c243c0, 0x12a05f200)
/go/pkg/mod/github.com/gopcua/[email protected]/uasc/message.go:125 +0x136
github.com/gopcua/opcua/uasc.(*SecureChannel).sendAsyncWithTimeout(0xc0002ed8c0, 0x428ed88, 0xc00024d920, 0xc000000004, 0xc000c12120, 0xc000c243c0, 0x1a3d301, 0x12a05f200, 0xc000c243c0, 0x12a05f200, ...)
/go/pkg/mod/github.com/gopcua/[email protected]/uasc/secure_channel.go:701 +0x133
github.com/gopcua/opcua/uasc.(*SecureChannel).sendRequestWithTimeout(0xc0002ed8c0, 0x428ed88, 0xc00024d920, 0x4, 0xc000c12120, 0xc000c243c0, 0x12a05f200, 0xc000bd5c90, 0x0, 0x0)
/go/pkg/mod/github.com/gopcua/[email protected]/uasc/secure_channel.go:622 +0xb7
github.com/gopcua/opcua/uasc.(*SecureChannel).SendRequestWithTimeout(0xc0002ed8c0, 0x428ed88, 0xc00024d920, 0xc000c243c0, 0x12a05f200, 0xc000bd5c90, 0x8, 0x3506d80)
/go/pkg/mod/github.com/gopcua/[email protected]/uasc/secure_channel.go:681 +0xcf
github.com/gopcua/opcua.(*Client).sendWithTimeout(0xc00057a850, 0x428ed88, 0xc00024d920, 0x12a05f200, 0xc000bd5c90, 0x410a38, 0x20)
/go/pkg/mod/github.com/gopcua/[email protected]/client.go:451 +0xbb
github.com/gopcua/opcua.(*Client).Send(...)
/go/pkg/mod/github.com/gopcua/[email protected]/client.go:437
github.com/gopcua/opcua.(*Client).RegisterNodes(0xc00057a850, 0xc00024d920, 0xc000bc6240, 0x0, 0x0)
/go/pkg/mod/github.com/gopcua/[email protected]/client.go:552 +0x8f
github.com/influxdata/telegraf/plugins/inputs/opcua.Connect(0xc000442c00, 0x0, 0x0)
/go/src/github.com/influxdata/telegraf/plugins/inputs/opcua/opcua_client.go:410 +0x315
github.com/influxdata/telegraf/plugins/inputs/opcua.(*OpcUA).Gather(0xc000442c00, 0x42ddd18, 0xc00056a040, 0x34, 0x0)
/go/src/github.com/influxdata/telegraf/plugins/inputs/opcua/opcua_client.go:503 +0x56c
github.com/influxdata/telegraf/models.(*RunningInput).Gather(0xc0005ba870, 0x42ddd18, 0xc00056a040, 0x2ee6000, 0x7ffff000)
/go/src/github.com/influxdata/telegraf/models/running_input.go:117 +0x6d
github.com/influxdata/telegraf/agent.(*Agent).gatherOnce.func1(0xc00050f440, 0xc0005ba870, 0x42ddd18, 0xc00056a040)
/go/src/github.com/influxdata/telegraf/agent/agent.go:491 +0x3f
created by github.com/influxdata/telegraf/agent.(*Agent).gatherOnce
/go/src/github.com/influxdata/telegraf/agent/agent.go:490 +0xb2
Additional info:
I havne't gotten the OPCUA plugin to work yet but I tried various combinations of settings to confirm it isn't simple configuration error. I think the issue might originate in the gopcua but I will look into it.
The text was updated successfully, but these errors were encountered: