No Route to host since upgraded telegraf to 1.19.x

Good morning,

trying to upgrade my telegraf container from 1.18.3 to 1.19.1 telegraf seems not liking my config anymore.

[[inputs.mqtt_consumer]]

  servers = ["tcp://192.168.178.35:1883"]

  ## MQTT QoS, must be 0, 1, or 2

  qos = 0

  ## Topics to subscribe to

  topics = [

   ...

  ]

  # if true, messages that can't be delivered while the subscriber is offline

  # will be delivered when it comes back (such as on service restart).

  # NOTE: if true, client_id MUST be set

  persistent_session = false

  # If empty, a random client ID will be generated.

  client_id = "grafana"

  ## username and password to connect MQTT server.

  # username = "telegraf"

  # password = "metricsmetricsmetricsmetrics"

  ## Optional SSL Config

  # ssl_ca = "/etc/telegraf/ca.pem"

  # ssl_cert = "/etc/telegraf/cert.pem"

  # ssl_key = "/etc/telegraf/key.pem"

  ## Use SSL but skip chain & host verification

  # insecure_skip_verify = false

  ## Data format to consume.

  ## Each data format has it's own unique set of configuration options, read

  ## more about them here:

  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md

  data_format = "value"

  data_type="float"

causes the following exception on startup:

2021-07-19T04:43:34Z E! [telegraf] Error running agent: starting input inputs.mqtt_consumer: network Error : dial tcp 192.168.178.35:1883: connect: no route
to host

Maybe anyone can help?

Thanks and regards
Max

The error message suggests that it is not a telegraf problem, but a network problem.
I would start with some basic network troubleshooting.

Hi Franky,

thanks to your reply. Due to the fact that my configuration (Telegraf-Config and docker-compose-file) is working with the 1.18.3 image, but doesn’t with the 1.19.1, I don’t believe in a network problem.

Believe is good, but I’d rather check. :wink:
For example, shell into the container and check the network connection.

The container restarts as soon as the exception occurs.
But due to the fact that my only change is the imageversion and not the configuration, it’s hardly possibe, that there’s a configuration problem.

Then start the container manually with a shell to look around in the container itself.
Works something like this:

docker run -it --rm --entrypoint /bin/bash telegraf

Or deactivate the mqtt plugin, start the container and then go into the container with a shell.
Are there any other plugins in the config?

Hi Franky,
strange thing. Starting the container while overriding the entrypoint and starting telegraf manually aftewrwards, it works.

Regards
Max

I can only guess: Is the MQTT broker also part of the docker-compose file? If yes, maybe the broker is not yet operational at the time when the Telegraf container starts?

No it‘s not. Only the influxdb and grafana itself, but telegraf has a dependency on influxdb.