telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

MQTT Consumer fails with invalid connection_timeout value

Open tstaals opened this issue 9 years ago • 4 comments

telegraf stops working after the last update, in the log files i receive the follow message.

2017-09-29T21:17:00Z E! Service for input inputs.mqtt_consumer failed to start, exiting MQTT Consumer, invalid connection_timeout value: {0} 2017-09-29T21:19:32Z E! Service for input inputs.mqtt_consumer failed to start, exiting MQTT Consumer, invalid connection_timeout value: {30000000000} 2017-09-29T21:24:05Z E! Service for input inputs.mqtt_consumer failed to start, exiting MQTT Consumer, invalid connection_timeout value: {30000000000}

The first time I did not configured the connection timeout the second time I did but I guess its not parsed right

my config is [[inputs.mqtt_consumer]] servers = ["localhost:1883"] # ## MQTT QoS, must be 0, 1, or 2 qos = 0 connection_timeout = 30

tstaals avatar Sep 29 '17 21:09 tstaals

When I change the connection_timeout = 30 to connection_timeout =1 telefgraf will start up

tstaals avatar Sep 29 '17 21:09 tstaals

I think this should actually be a string duration, can you test with connection_timeout = "30s"?

danielnelson avatar Sep 29 '17 22:09 danielnelson

tested it with 30s and that does seam to do the trick, so only the documentation at https://github.com/influxdata/telegraf/blob/master/plugins/inputs/mqtt_consumer/README.md should be updated to reflect that

tstaals avatar Sep 29 '17 22:09 tstaals

I will correct the documentation and also set a default timeout if it is not specified.

danielnelson avatar Sep 29 '17 22:09 danielnelson