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

fix: Update gopcua library to latest version #9560

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Jul 30, 2021

  • Updated associated README.md.
  • Wrote appropriate unit tests.

resolves #9551

Update to the latest state of the gopcua library in the hope to fix potential timeout problems (see #9551).

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Jul 30, 2021
Copy link
Member

@helenosheaa helenosheaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@helenosheaa helenosheaa added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jul 30, 2021
@sspaink sspaink changed the title Update gopcua library to latest version fix: Update gopcua library to latest version Aug 2, 2021
@sspaink sspaink removed the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Aug 2, 2021
@sspaink
Copy link
Contributor

sspaink commented Aug 2, 2021

Removing the ready for final review label because the issue reporter ran into a different issue after using the latest version. Needs more investigation.

@jnangle
Copy link

jnangle commented Aug 3, 2021

Hi @srebhan,

This code (v1.20.0 3) failed at the 1-hr mark with the following messages:

2021-08-03T16:00:07Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-08-03T16:00:16Z E! [inputs.opcua] Error in plugin: RegisterNodes Read failed: The operation could not complete because the client is not connected to the server. StatusBadServerNotConnected (0x800D0000)
panic: close of closed channel
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x32915ad]

goroutine 7715 [running]:
github.com/gopcua/opcua/uacp.(*Conn).Close(0x0, 0x0, 0x0)
        /go/pkg/mod/github.com/gopcua/opcua@v0.2.0-rc2.0.20210409063412-baabb9b14fd2/uacp/conn.go:166 +0x2d
panic(0x5138100, 0x62858b0)
        /usr/local/go/src/runtime/panic.go:965 +0x1c7
github.com/gopcua/opcua.(*Client).Close(0xc000ec61c0, 0x0, 0x0)
        /go/pkg/mod/github.com/gopcua/opcua@v0.2.0-rc2.0.20210409063412-baabb9b14fd2/client.go:516 +0xe9
github.com/influxdata/telegraf/plugins/inputs/opcua.Connect(0xc00016c340, 0x0, 0x0)
        /go/src/github.com/influxdata/telegraf/plugins/inputs/opcua/opcua_client.go:409 +0x52e
github.com/influxdata/telegraf/plugins/inputs/opcua.(*OpcUA).Gather(0xc00016c340, 0x6414658, 0xc000a3a240, 0xdb5b55, 0xc001387020)
        /go/src/github.com/influxdata/telegraf/plugins/inputs/opcua/opcua_client.go:522 +0x5c5
github.com/influxdata/telegraf/models.(*RunningInput).Gather(0xc00013c690, 0x6414658, 0xc000a3a240, 0xdf661d, 0x5cc0b80)
        /go/src/github.com/influxdata/telegraf/models/running_input.go:117 +0x74
github.com/influxdata/telegraf/agent.(*Agent).gatherOnce.func1(0xc000750de0, 0xc00013c690, 0x6414658, 0xc000a3a240)
        /go/src/github.com/influxdata/telegraf/agent/agent.go:469 +0x46
created by github.com/influxdata/telegraf/agent.(*Agent).gatherOnce
        /go/src/github.com/influxdata/telegraf/agent/agent.go:468 +0xc5

C:\Users\scada_read\Desktop\Installers\InfluxDB\telegraf-1.20.0 3>```

@sspaink sspaink added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Sep 13, 2021
Copy link
Contributor

@sspaink sspaink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In hindsight, probably would have been fine to merge this because we will need to update the library anyway.

@srebhan thanks for working on this, when you get the chance to resolve the merge conflicts I think this is ready to merge.

@srebhan
Copy link
Member Author

srebhan commented Sep 14, 2021

@sspaink rebase done.

@sspaink sspaink merged commit 3c27f59 into influxdata:master Sep 14, 2021
@jnangle
Copy link

jnangle commented Sep 14, 2021

I ran the latest artifact (windows_amd64), configured to connect to a Red Lion OPC UA server using numeric ids tags and received this error:

D:\InfluxDB\telegraf-1.20.0 5>telegraf --config http://localhost:8086/api/v2/telegrafs/07d830630e2b0000  --test
2021-09-14T17:44:50Z I! Starting Telegraf
2021-09-14T17:44:50Z D! [agent] Initializing plugins
2021-09-14T17:44:50Z I! Failed to load certificate: open /etc/telegraf/cert.pem: The system cannot find the path specified.
2021-09-14T17:44:50Z D! [agent] Starting service inputs
2021-09-14T17:44:50Z E! [inputs.opcua] Error in plugin: registerNodes failed: EOF
2021-09-14T17:44:50Z D! [agent] Stopping service inputs
2021-09-14T17:44:50Z D! [agent] Input channel closed
2021-09-14T17:44:50Z D! [agent] Stopped Successfully
2021-09-14T17:44:50Z E! [telegraf] Error running agent: input plugins recorded 1 errors

The code works fine connecting to OPC UA servers that use strings for tag ids.

reimda pushed a commit that referenced this pull request Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please merge latest gopcua library
4 participants