Troubleshooting
Telegraf failed to send metrics to any configured server
Short answer
The error means the outputs.influxdb_v2 plugin tried every server in its URL list and none accepted a write. Work outward in order: destination URL and port 8086, the InfluxDB HTTP bind address on the Windows PC, a scoped Windows Firewall inbound rule, then TLS trust and the organization, bucket and token on the new server. A ping proves neither the listener nor the credentials.
On this page
- What the aggregate error does and does not tell you
- Point the output at the Windows PC, not at the device
- Make the listener accept remote writers
- Open the firewall boundary, and only that far
- Check TLS, then the write identity
- Example: sizing the write cache for a 30-minute outage at 20 metrics per second
- Work the branches in this order
- Questions asked
Yes — a Telegraf app on an edge device, such as the ctrlX CORE app, can write straight to InfluxDB installed on a Windows PC. The error means the output never completed a write to any server in its list, not that the combination is unsupported. Error writing to outputs.influxdb_v2: failed to send metrics to any configured server(s) is an aggregate line: connection refused, a silent timeout, a TLS failure and a rejected token all end in it. Fix the path in one pass outward from the device — destination URL and port, listener bind address on the PC, firewall rule scoped to the device, then certificate trust and the organization, bucket and token on the new server — and leave the working input and agent settings untouched.
What the aggregate error does and does not tell you #
The plugin treats every URL in its server list as an independent write target. Each flush it tries them in turn, logs each individual failure, and raises the aggregate error only when all targets failed. The line therefore carries no layer information. Read it as a broken write path somewhere between this runtime and the new server, and use tests that separate transport from application before changing any setting.
Point the output at the Windows PC, not at the device #
Three properties of the destination URL cause most first-time failures:
- Host. It must be an address of the Windows PC on a network the device can reach. A loopback address names the machine making the request, so a URL proven against the device's own InfluxDB now sends metrics to the device itself. A hostname that resolves to the wrong adapter fails the same way — the same trap that keeps an MQTT sink offline until you use the broker's IP address.
- Scheme.
httpfor a plain listener,httpswhen the server runs TLS. A mismatch never completes a usable request. - Port. InfluxDB's HTTP API listens on TCP port 8086 by default; if the Windows server was moved to another port, the URL must carry it explicitly.
Decision: test the configured host and port from the device before touching credentials. If it will not connect, the next two sections own the fault.
Make the listener accept remote writers #
On the PC, read the HTTP bind address in the InfluxDB server configuration. Bound to loopback only (for example 127.0.0.1:8086), the server answers local requests and refuses remote ones — exactly the split where a browser on the PC works while the device gets the aggregate error. Remote writers need the listener bound to the PC's LAN interface or to all interfaces (0.0.0.0); if only local agents will ever write to it, loopback is the safer binding.
Test in two steps: open the server's own HTTP address in a browser on the PC to confirm the listener is up on the configured port, then test that same port from the device. A ping proves neither direction — echo requests can be answered while the write port is refused, and dropped while the write port serves fine.
Decision: local success with remote refusal means bind address or firewall; a timeout from the device means routing or a silent drop.
Open the firewall boundary, and only that far #
Windows Defender Firewall with Advanced Security is where the path usually stops. Inbound rules for the InfluxDB service must allow TCP on the HTTP port from the device's address, on the network profile that is actually active — Domain, Private and Public rules are separate sets, and a rule on an inactive profile, a different program or a different port opens nothing.
| Test from the device | Meaning | Branch to work |
|---|---|---|
| Connection refused | Something answered and rejected: nothing listening on that port, or an explicit reject | Listener bind, then the rule |
| Connection times out | Traffic is silently dropped: no allow rule on the active profile, or a routing fault | Profile and rule, then routing |
| TCP connect succeeds | The transport path is good end to end | TLS and write identity |
Keep the fix scoped: one inbound rule, one port, the sending device's address. A disabled firewall is not a fix, because it opens every other listener on the PC to the whole network.
Decision: once the port test connects, transport is done. If the Telegraf error still appears, the remaining causes are TLS and identity.
Check TLS, then the write identity #
With an https URL the TLS handshake completes before any HTTP is exchanged, so an untrusted chain, an expired certificate or a name mismatch lands in the same aggregate error. Repair the certificate and the runtime's trust store; the option that skips certificate verification is a diagnostic aid, not a production setting.
Then the identity objects. An organization, a bucket and a token belong to one specific InfluxDB server: nothing created on the device's earlier local server exists on the Windows server. Create the bucket inside the target organization there, issue a token with write permission to that bucket, and put those exact values in the output. With a raw connect now succeeding, read the HTTP response: 404 not found means the organization or bucket in the request does not exist on that server; 401 or 403 means the token is wrong or lacks write scope — the same distinction that resolves Telegraf authorization not found on InfluxDB 2.
Decision: 404 sends you to the organization and bucket; 401 or 403 sends you to a freshly issued token with write scope on that bucket.
Example: sizing the write cache for a 30-minute outage at 20 metrics per second #
While the error repeats, the inputs keep producing and the agent caches recent metrics per output, flushing the cache on the first successful write. Telegraf's agent configuration documents a default cache limit of 10,000 metrics per output and a 1,000-metric write batch. Take an illustrative line that logs 20 metrics per second:
- Cache coverage: 10,000 metrics ÷ 20 metrics/s = 500 s, about 8 min 20 s. Past that point the cache is full and the oldest metrics are discarded to make room for new ones.
- A 30-minute outage collects 20 metrics/s × 1,800 s = 36,000 metrics. The cache ends holding the most recent 10,000, so 36,000 − 10,000 = 26,000 metrics are gone for good.
Decision: to carry a 30-minute outage at this rate, set the cache limit above 36,000 — 40,000 keeps it a multiple of the 1,000-metric batch — and accept the larger runtime memory footprint. Otherwise treat 8 min 20 s as the outage window you can absorb and repair the path faster. On recovery the cache drains by itself: expect the first successful write to deliver a backlog, and expect the window before it to stay empty.
Work the branches in this order #
- Destination URL. A reachable address of the Windows PC, scheme matching the listener, port matching the server's HTTP setting — loopback leftovers from the on-device setup go first.
- Listener bind. Local success with remote refusal: move the HTTP bind address off loopback onto the LAN interface or all interfaces.
- Firewall. Refused or timing out from the device: an inbound TCP rule for the HTTP port, scoped to the device's address, on the active profile.
- TLS. Connect succeeds but an
httpsURL still fails: repair the certificate chain and name match; the verification skip stays out of production. - Identity. 404: create or correct the organization and bucket on the Windows server. 401 or 403: issue a token there with write to that bucket.
- Verify. A full flush interval without the error, then a known tag, value and timestamp confirmed in the bucket from the PC.
For the case in hand — a proven on-device logging job pointed at a newly installed InfluxDB on a Windows PC — plan two fixes, not one. Restore transport with the first three branches, then recreate the authorization objects on the new server: the token that worked on the device was never valid there, so the identity branch fails even with perfect connectivity until its objects exist.
Questions asked
Can a Telegraf app on an edge device write to InfluxDB on a Windows PC?
Yes. Telegraf only issues HTTP or HTTPS writes to the URL you configure, so it does not care where InfluxDB runs. Four things must be true: the output URL points at a reachable address of the PC, the listener accepts remote connections, the firewall allows the device on that port, and the organization, bucket and token exist on the PC's server. Run them in that order.
Why did the same output configuration work while InfluxDB ran on the device itself?
Because a loopback write never leaves the machine: the destination, the listener, the firewall and the token all lived on the device. Moving the server changes all four conditions at once, so a configuration proven locally starts failing in every branch simultaneously. That is why the order runs from the address inward rather than starting at the token.
How do I confirm the metrics really landed in the bucket on the Windows PC?
Watch two signals. First, the Telegraf log: one full flush interval without the error means at least one write request succeeded, including the cached backlog. Second, the data itself: on the PC, open the InfluxDB user interface, select the bucket, query a recent window and confirm a known tag, value and timestamp that your inputs produced during the test. A quiet log without a confirmed point is not proof.
Should I turn the Windows firewall off to find out whether it is the cause?
Only as a short test on a network you control, and never as the fix. If writes succeed with the firewall disabled, the diagnosis is confirmed: a rule was missing or attached to the wrong profile. Re-enable the firewall and write the scoped inbound rule — one port, TCP, from the device's address — because a disabled firewall exposes remote desktop, file sharing and every other listener on that PC.