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

MQTT consumer plugin crashes telegraf on a connection failure #13029

Closed
moracca opened this issue Apr 4, 2023 · 2 comments
Closed

MQTT consumer plugin crashes telegraf on a connection failure #13029

moracca opened this issue Apr 4, 2023 · 2 comments
Labels
area/mqtt bug unexpected problem or unintended behavior plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins

Comments

@moracca
Copy link

moracca commented Apr 4, 2023

Relevant telegraf.conf

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = "0s"
  hostname = ""
  omit_hostname = false

[[inputs.mqtt_consumer]]
  servers = ["tcp://172.30.88.239:1883"]

[[inputs.ping]]
  urls = ["8.8.8.8"]
  count = 6
  ping_interval = 0.1
  timeout = 2.00

[[outputs.file]]
  files = ["stdout"]

Logs from Telegraf

My-Mac-Pro:telegraf ldd$ telegraf --config full.conf --config-directory telegraf.d/
2023-04-04T06:42:32Z I! Loading config file: full.conf
2023-04-04T06:42:32Z I! Loading config file: telegraf.d/outputs.file.conf
2023-04-04T06:42:32Z I! Loading config file: telegraf.d/outputs.postgresql.conf
2023-04-04T06:42:32Z I! Starting Telegraf 1.26.0
2023-04-04T06:42:32Z I! Available plugins: 235 inputs, 9 aggregators, 27 processors, 22 parsers, 57 outputs, 2 secret-stores
2023-04-04T06:42:32Z I! Loaded inputs: cisco_telemetry_mdt disk mqtt_consumer ping (2x)
2023-04-04T06:42:32Z I! Loaded aggregators: 
2023-04-04T06:42:32Z I! Loaded processors: regex
2023-04-04T06:42:32Z I! Loaded secretstores: 
2023-04-04T06:42:32Z I! Loaded outputs: file postgresql
2023-04-04T06:42:32Z I! Tags enabled: host=My-Mac-Pro.local
2023-04-04T06:42:32Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"My-Mac-Pro.local", Flush Interval:10s
2023-04-04T06:43:02Z E! [telegraf] Error running agent: starting input inputs.mqtt_consumer: network Error : dial tcp 172.30.88.239:1883: i/o timeout
My-Mac-Pro:telegraf ldd$ 


### System info

Telegraf 1.26.0 on FreeBSD 13.1

### Docker

_No response_

### Steps to reproduce

run telegraf with the attached config, and it will exit after timing out

### Expected behavior

as per a discussion in slack:

Plug-ins that connect to external services should retry instead of crashing telegraf. If you believe this is not the case with the mqtt plugin, please file a bug report.

The telegraf process should continue to function for the other inputs (ping), and the mqtt plugin should retry its connection periodically

### Actual behavior

process exits after the i/o timeout

### Additional info

_No response_
@moracca moracca added the bug unexpected problem or unintended behavior label Apr 4, 2023
@Hipska Hipska added area/mqtt plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Apr 4, 2023
@Hipska
Copy link
Contributor

Hipska commented Apr 4, 2023

Hi, it seems like this is already discussed in #10694

@powersj
Copy link
Contributor

powersj commented Apr 4, 2023

Agreed - closing as a dup of #10694 - I'll rename that one to call out MQTT

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mqtt bug unexpected problem or unintended behavior plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

No branches or pull requests

3 participants