influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.51k stars 5.55k forks source link

Unhelpful error message on influxdbv2 output with auth error #4947

Closed nathanielc closed 5 years ago

nathanielc commented 5 years ago

Relevant telegraf.conf:

[[outputs.influxdb_v2]]
  ## The URLs of the InfluxDB cluster nodes.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  urls = ["http://127.0.0.1:9999"]

  ## Token for authentication.
  token = "xxxxx"

  ## Organization is the name of the organization you wish to write to; must exist.
  organization = "my-org"

  ## Destination bucket to write into.
  bucket = "telegraf"

System info:

[Include Telegraf version, operating system name, and other relevant details]

Steps to reproduce:

  1. Configure output.influxdbv2
  2. Give it a token that does not have write permissions to the bucket

Expected behavior:

Get an error message about bad authentication

Actual behavior:

Get this error message:

E! [outputs.influxdb_v2] Failed to write metric: EOF
glinton commented 5 years ago

This is actually an influxdata/platform issue. (The api spec hasn't yet been fully implemented.)

danielnelson commented 5 years ago

Can you explain a little bit more about whats happening here? Are we getting a 401? Is the server just closing the connection?

glinton commented 5 years ago

We are getting a 401, but according to the spec for a 401, we should be getting back a json body. 2.0 isn't returning a body, however, resulting in an EOF.

danielnelson commented 5 years ago

If you haven't yet, can you also open an issue on platform?

glinton commented 5 years ago

Server issue created at https://github.com/influxdata/platform/issues/1284