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

[inputs.opcua] Telegraf is restarted if opcua server is not available #9154

Closed
mirkocomparetti-synesis opened this issue Apr 20, 2021 · 2 comments
Labels
area/opcua bug unexpected problem or unintended behavior

Comments

@mirkocomparetti-synesis

System info:

Ubuntu desktop 20.04.2 64bit
Ram 4Gb
Influxdb2 2.0.4 (last from ubuntu repos)
Telegraf 1.18.1 (last from ubuntu repos)

Steps to reproduce:

  1. Configure the input.opcua plugin to connect to a opcua server
  2. keep the opcua server OFF (or use a non existing ip address)
  3. start the telegraf service
  4. keep an eye on the logs

Expected behavior:

OPCUA connection has to fail gracefully, the telegraf process should still be alive and the opcua plugin has to retry retry after some time.

Actual behavior:

When the opcua plugin fails to connect to the server, the whole telegraf process is restarted and it will eventually fail after some time.

Additional info:

This is what happens in the log: the connection fails and the whole telegraf is reloaded

2021-04-20T06:47:09Z I! Loaded inputs: mqtt_consumer opcua
2021-04-20T06:47:09Z I! Loaded aggregators: merge
2021-04-20T06:47:09Z I! Loaded processors: converter dedup (2x) override (12x) rename starlark (3x)
2021-04-20T06:47:09Z I! Loaded outputs: influxdb_v2 (2x)
2021-04-20T06:47:09Z I! Tags enabled: host=somehost
2021-04-20T06:47:09Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"somehost", Flush Interval:10s
2021-04-20T06:47:09Z E! [telegraf] Error running agent: could not initialize input inputs.opcua: dial tcp 1.2.3.4:1234: connect: network is unreachable
2021-04-20T06:47:10Z I! Loaded inputs: mqtt_consumer opcua
2021-04-20T06:47:10Z I! Loaded aggregators: merge
2021-04-20T06:47:10Z I! Loaded processors: converter dedup (2x) override (12x) rename starlark (3x)
2021-04-20T06:47:10Z I! Loaded outputs: influxdb_v2 (2x)
2021-04-20T06:47:10Z I! Tags enabled: host=somehost
2021-04-20T06:47:10Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"somehost", Flush Interval:10s
2021-04-20T06:47:10Z E! [telegraf] Error running agent: could not initialize input inputs.opcua: dial tcp 1.2.3.4:1234: connect: network is unreachable
2021-04-20T06:47:11Z I! Loaded inputs: mqtt_consumer opcua
2021-04-20T06:47:11Z I! Loaded aggregators: merge
2021-04-20T06:47:11Z I! Loaded processors: converter dedup (2x) override (12x) rename starlark (3x)
2021-04-20T06:47:11Z I! Loaded outputs: influxdb_v2 (2x)
2021-04-20T06:47:11Z I! Tags enabled: host=somehost
2021-04-20T06:47:11Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"somehost", Flush Interval:10s
2021-04-20T06:47:11Z E! [telegraf] Error running agent: could not initialize input inputs.opcua: dial tcp 1.2.3.4:1234: connect: network is unreachable
2021-04-20T06:47:11Z I! Loaded inputs: mqtt_consumer opcua
2021-04-20T06:47:11Z I! Loaded aggregators: merge
2021-04-20T06:47:11Z I! Loaded processors: converter dedup (2x) override (12x) rename starlark (3x)
2021-04-20T06:47:11Z I! Loaded outputs: influxdb_v2 (2x)
2021-04-20T06:47:11Z I! Tags enabled: host=somehost
2021-04-20T06:47:11Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"somehost", Flush Interval:10s
2021-04-20T06:47:11Z E! [telegraf] Error running agent: could not initialize input inputs.opcua: dial tcp 1.2.3.4:1234: connect: network is unreachable
2021-04-20T06:59:32Z I! Loaded inputs: mqtt_consumer opcua
2021-04-20T06:59:32Z I! Loaded aggregators: merge
@mirkocomparetti-synesis mirkocomparetti-synesis added the bug unexpected problem or unintended behavior label Apr 20, 2021
@mirkocomparetti-synesis
Copy link
Author

With latest version telegraf is not restarted anymore, but it does not work at all if the opcua endpoint is not responding/missing

@srebhan
Copy link
Member

srebhan commented Jul 30, 2021

@mirkocomparetti-synesis can you please test with PR #9524. Not sure if it helps, but it fixes reconnect. Otherwise, what is the error message you are getting?

@sjwang90 sjwang90 closed this as completed Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/opcua bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants