Repository navigation
Description
Relevant telegraf.conf
[[outputs.amqp]]
brokers = ["amqps://mq01:5671/%2f", "amqps://mq02:5671/%2f", "amqps://mq:5671/%2f"]
username = "telegraf"
password = "*************"
auth_method = "PLAIN"
tls_ca = "/etc/telegraf/telegraf-ca.pem"
tls_cert = "/etc/telegraf/telegraf-cert.pem"
tls_key = "/etc/telegraf/telegraf-key.pem"Logs from Telegraf
Sep 11 11:16:39 client01 telegraf[510936]: 2026-09-11T09:16:39Z D! [agent] Attempting connection to [outputs.amqp]
Sep 11 11:16:39 client01 telegraf[510936]: 2026-09-11T09:16:39Z D! [outputs.amqp] Connecting to "amqps://mq01:5671/%2f"
Sep 11 11:16:40 client01 telegraf[510936]: 2026-09-11T09:16:40Z D! [outputs.amqp] Connected to "amqps://mq01:5671/%2f"
Sep 11 11:16:40 client01 telegraf[510936]: 2026-09-11T09:16:40Z D! [agent] Successfully connected to outputs.amqp
Sep 11 11:16:50 client01 telegraf[510936]: 2026-09-11T09:16:50Z D! [outputs.amqp] Wrote batch of 38 metrics in 2.883056ms
Sep 11 11:16:50 client01 telegraf[510936]: 2026-09-11T09:16:50Z D! [outputs.amqp] Buffer fullness: 0 / 10000 metrics
Sep 11 11:17:00 client01 telegraf[510936]: 2026-09-11T09:17:00Z D! [outputs.amqp] Wrote batch of 21 metrics in 1.94754ms
Sep 11 11:17:00 client01 telegraf[510936]: 2026-09-11T09:17:00Z D! [outputs.amqp] Buffer fullness: 0 / 10000 metrics
Sep 11 11:17:10 client01 telegraf[510936]: 2026-09-11T09:17:10Z D! [outputs.amqp] Wrote batch of 22 metrics in 2.084154ms
Sep 11 11:27:10 client01 telegraf[510936]: 2026-09-11T09:27:10Z D! [outputs.amqp] Buffer fullness: 0 / 10000 metrics
Sep 11 11:27:20 client01 telegraf[510936]: 2026-09-11T09:27:20Z D! [outputs.amqp] Wrote batch of 22 metrics in 1.193013ms
Sep 11 11:27:20 client01 telegraf[510936]: 2026-09-11T09:27:20Z D! [outputs.amqp] Buffer fullness: 0 / 10000 metrics
Sep 11 11:27:30 client01 telegraf[510936]: 2026-09-11T09:27:30Z D! [outputs.amqp] Wrote batch of 21 metrics in 782.756Β΅s
Sep 11 11:27:30 client01 telegraf[510936]: 2026-09-11T09:27:30Z D! [outputs.amqp] Buffer fullness: 0 / 10000 metrics
Sep 11 11:27:40 client01 telegraf[510936]: 2026-09-11T09:27:40Z D! [outputs.amqp] Connecting to "amqps://mq:5671/%2f"
Sep 11 11:27:45 client01 telegraf[510936]: 2026-09-11T09:27:45Z D! [outputs.amqp] Error connecting to "amqps://mq:5671/%2f" - dial tcp: lookup mq: i/o timeout
Sep 11 11:27:45 client01 telegraf[510936]: 2026-09-11T09:27:45Z D! [outputs.amqp] Connecting to "amqps://mq01:5671/%2f"
Sep 11 11:27:50 client01 telegraf[510936]: 2026-09-11T09:27:50Z W! [agent] ["outputs.amqp"] did not complete within its flush interval
Sep 11 11:27:50 client01 telegraf[510936]: 2026-09-11T09:27:50Z D! [outputs.amqp] Buffer fullness: 43 / 10000 metrics
Sep 11 11:27:59 client01 telegraf[510936]: 2026-09-11T09:27:59Z D! [outputs.amqp] Error connecting to "amqps://mq01:5671/%2f" - Exception (501) Reason: "EOF"
Sep 11 11:27:59 client01 telegraf[510936]: 2026-09-11T09:27:59Z D! [outputs.amqp] Connecting to "amqps://mq02:5671/%2f"
Sep 11 11:28:00 client01 telegraf[510936]: 2026-09-11T09:28:00Z W! [agent] ["outputs.amqp"] did not complete within its flush interval
Sep 11 11:28:00 client01 telegraf[510936]: 2026-09-11T09:28:00Z D! [outputs.amqp] Buffer fullness: 65 / 10000 metrics
Sep 11 11:28:04 client01 telegraf[510936]: 2026-09-11T09:28:04Z D! [outputs.amqp] Error connecting to "amqps://mq02:5671/%2f" - dial tcp: lookup mq02: i/o timeout
Sep 11 11:28:04 client01 telegraf[510936]: 2026-09-11T09:28:04Z D! [outputs.amqp] Buffer fullness: 65 / 10000 metrics
Sep 11 11:28:04 client01 telegraf[510936]: 2026-09-11T09:28:04Z E! [agent] Error writing to outputs.amqp: could not connect to any broker
Sep 11 11:28:10 client01 telegraf[510936]: 2026-09-11T09:28:10Z D! [outputs.amqp] Connecting to "amqps://mq01:5671/%2f"
Sep 11 11:28:13 client01 telegraf[510936]: 2026-09-11T09:28:13Z D! [outputs.amqp] Error connecting to "amqps://mq01:5671/%2f" - Exception (403) Reason: "username or password not allowed"
Sep 11 11:28:13 client01 telegraf[510936]: 2026-09-11T09:28:13Z D! [outputs.amqp] Connecting to "amqps://mq02:5671/%2f"
Sep 11 11:28:18 client01 telegraf[510936]: 2026-09-11T09:28:18Z D! [outputs.amqp] Error connecting to "amqps://mq02:5671/%2f" - dial tcp: lookup mq02: i/o timeout
Sep 11 11:28:18 client01 telegraf[510936]: 2026-09-11T09:28:18Z D! [outputs.amqp] Connecting to "amqps://mq:5671/%2f"
Sep 11 11:28:20 client01 telegraf[510936]: 2026-09-11T09:28:20Z W! [agent] ["outputs.amqp"] did not complete within its flush interval
Sep 11 11:28:20 client01 telegraf[510936]: 2026-09-11T09:28:20Z D! [outputs.amqp] Buffer fullness: 108 / 10000 metrics
Sep 11 11:28:26 client01 telegraf[510936]: 2026-09-11T09:28:26Z D! [outputs.amqp] Error connecting to "amqps://mq:5671/%2f" - Exception (403) Reason: "username or password not allowed"
Sep 11 11:28:26 client01 telegraf[510936]: 2026-09-11T09:28:26Z D! [outputs.amqp] Buffer fullness: 108 / 10000 metrics
Sep 11 11:28:26 client01 telegraf[510936]: 2026-09-11T09:28:26Z E! [agent] Error writing to outputs.amqp: could not connect to any broker
Sep 11 11:28:30 client01 telegraf[510936]: 2026-09-11T09:28:30Z D! [outputs.amqp] Connecting to "amqps://mq02:5671/%2f"
System info
Telegraf 1.40.0-1 from yum/apt-repos on various arm64 (debian/ubuntu) and x86_64 (debian/ubuntu/alma)
Docker
No response
Steps to reproduce
The initial connection after startup or systemctl restart ist fine.
But for me it looks like any network hickup leads to the state described. I see it most often on a flappy powerline connection.
Rabbitmq reports
PLAIN login refused: user 'telegraf' attempted to log in with a blank password, which is prohibited by the internal authN backend. To use TLS/x509 certificate-based authentication, see the rabbitmq_auth_mechanism_ssl plugin and configure the client to use the EXTERNAL authentication mechanism. Alternatively change the password for the user to be non-blank.
Telegraf runs into
telegraf[2273142]: 2026-09-11T08:50:36Z E! [agent] Error writing to outputs.amqp: could not connect to any broker
telegraf[2273142]: 2026-09-11T08:50:51Z W! [agent] ["outputs.amqp"] did not complete within its flush interval
The initial connection after startup or systemctl restart ist fine.
But for me it looks like any network hickup leads to the state described. I see it most often on a flappy powerline connection.
My Setup works like this: I use a custom CA certificate to allow the connection to rabbitmq, but I have a password/login for the identity on rabbitmq, the identity is not derived from the certificate. If the reconnect claims "empty password", this remindes me of a similar bug in amqp.input: #19571
Expected behavior
Smooth reconnect, no data loss.
Actual behavior
Unpublished data, thrown away during restart.
Activity
FlHinrichsen commentedon Sep 14, 2026
Same issue for me.
After a connection lost it does not reconnect.
Using Version 1.40.0
It seams that the password is not provided on a reconnect.
Thats really annoying, as all data after a connection lost are gone.
As workaround I actual testing the Disk persistance:
[agent]
buffer_strategy = "disk"
buffer_directory = "/var/lib/telegraf/buffer"
buffer_disk_sync = true
srebhan commentedon Sep 14, 2026
This should have been fixed with PR #19575. Are you sure you tested with v1.40.0?
pstadt commentedon Sep 14, 2026
Yes, I am pretty sure and I use the official builds distributed via apt and yum repositories.
FlHinrichsen commentedon Sep 14, 2026
Same for me:
Telegraf 1.40.0 (git: HEAD@e9017dc3)
Only difference to the mentioned pullrequest is, that we use "outputs.amqp"
pstadt commentedon Sep 14, 2026
As far as I can see there were fixes on plugins/outputs/amqp two weeks ago (#19464) on unavailable brokers.
Looks like the fix Restore configuration to successfully reconnect (#19575) on plugins/inputs/amqp_consumer needs to be ported to plugins/outputs/amqp as well.
skartikey commentedon Sep 16, 2026
Confirmed, it's the same bug as #19571 but in the output. The AMQP library blanks the password after the first connect and
outputs.amqpreuses that config on reconnect, while #19575 only fixed the consumer. #19734 fixes it for the output.pstadt commentedon Sep 17, 2026
I installed the artifacts from #19734 on more than 30 boxes and they all transmit data for >12h.
I still see some repetitions off
but after a few occurrences, things settle down, the connection is created and the data is transmitted reliably again.