Internal server error when posting data using Telegraf

Hi,

I’m trying to ingest the data that is available via HTTP API from my OpenTherm Gateway.
An example of this api’s response is:

[
  {"name": "flamestatus", "value": true, "unit": "", "epoch": 1769628836},
  {"name": "chmodus", "value": true, "unit": "", "epoch": 1769628836},
  {"name": "chenable", "value": true, "unit": "", "epoch": 1769628836},
  {"name": "ch2modus", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "ch2enable", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "dhwmode", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "dhwenable", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "diagnosticindicator", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "faultindicator", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "coolingmodus", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "coolingactive", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "otcactive", "value": false, "unit": "", "epoch": 1769628836},
  {"name": "servicerequest", "value": false, "unit": "", "epoch": 1769628820},
  {"name": "lockoutreset", "value": false, "unit": "", "epoch": 1769628820},
  {"name": "lowwaterpressure", "value": false, "unit": "", "epoch": 1769628820},
  {"name": "gasflamefault", "value": false, "unit": "", "epoch": 1769628820},
  {"name": "airtemp", "value": false, "unit": "", "epoch": 1769628820},
  {"name": "waterovertemperature", "value": false, "unit": "", "epoch": 1769628820},
  {"name": "outsidetemperature", "value": 0.000, "unit": "°C", "epoch": 1769628825},
  {"name": "roomtemperature", "value": 19.480, "unit": "°C", "epoch": 1769628800},
  {"name": "roomsetpoint", "value": 19.500, "unit": "°C", "epoch": 1769628835},
  {"name": "remoteroomsetpoint", "value": 0.000, "unit": "°C", "epoch": 0},
  {"name": "controlsetpoint", "value": 75.000, "unit": "°C", "epoch": 1769628837},
  {"name": "relmodlvl", "value": 0.000, "unit": "%", "epoch": 1769628837},
  {"name": "maxrelmodlvl", "value": 0.000, "unit": "%", "epoch": 1769628830},
  {"name": "boilertemperature", "value": 30.200, "unit": "°C", "epoch": 1769628834},
  {"name": "returnwatertemperature", "value": 34.200, "unit": "°C", "epoch": 1769524734},
  {"name": "dhwtemperature", "value": 0.000, "unit": "°C", "epoch": 1769628805},
  {"name": "dhwsetpoint", "value": 50.000, "unit": "°C", "epoch": 1769628733},
  {"name": "maxchwatersetpoint", "value": 75.000, "unit": "°C", "epoch": 1769628774},
  {"name": "chwaterpressure", "value": 0.000, "unit": "bar", "epoch": 1769628692},
  {"name": "oemfaultcode", "value": 0, "unit": "", "epoch": 1769628810}
]

I’ve created a Telegraf (v1.37.1) config to ingest this JSON and write it to InfluxDB (v2.7.12). I’m currently running both in a containerized environment (Docker).

My Telegraf config is fairly simple, e.g.:

# Configuration for telegraf agent
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = true
  hostname = "otgw-ingester"
[[outputs.influxdb_v2]]
  urls = ["http://influx2:8086"]
  token = "#$#%$^%&I^UHTGRWBET"
  organization = "noppe"
  bucket = "heatingsystem/autogen"
[[inputs.http]]
  urls = ["http://2345678/api/v1/otgw/telegraf/"]
  method = "GET"
  timeout = "15s"
  interval = "30s"
  data_format = "json_v2"
  [[inputs.http.json_v2]]
    measurement_name_path = "name"
    [[inputs.http.json_v2.object]]
      path = "@this"
      tags = ["unit"]
      timestamp_key = "epoch"
      timestamp_format = "unix"
      [inputs.http.json_v2.object.fields]
        value = "auto"

However, Influx is not accepting the data posted by Telegraf. InfluxDB responds with an error code 500. The complete error is:

ts=2026-01-28T19:25:38.361842Z lvl=debug msg=Request log_id=10iWsjq0000 service=http method=POST host=influx2:8086 path=/api/v2/write query="bucket=heatingsystem%2Fautogen&org=noppe" proto=HTTP/1.1 status_code=500 response_size=88 content_length=-1 referrer= remote=172.24.0.12:55384 user_agent=Telegraf authenticated_id=102d39fd5f549000 user_id=0c9eea55f21c5000 took=1.247ms error="internal error" error_code="internal error"

The error that is logged in Telegraf:

2026-01-28T19:38:38Z E! [agent] Error writing to outputs.influxdb_v2: failed to write metrics to bucket "heatingsystem/autogen": 500 Internal Server Error: internal error: An internal error has occurred - check server logs

What am I doing wrong? Any tips on how to debug this setup? The logs aren’t very helpful…

I think we’d need to see the server logs with the errors on the InfluxDB side of things to understand what the error is. The 500 status code being reported to Telgraf is unfortunately unhelpful.

Shot in the dark, though - what happens if you try writing to a bucket that doesn’t contain a / in its name? It looks like it’s being parsed into a %2F, and I’m not sure if that’s going to work as intended.

1 Like