influxdb: influxdb2 unauthorized error

Steps to reproduce: List the minimal actions needed to reproduce the behavior.

  1. I’m used influxdb v2.0.0 and org=prometheus; bucket=prometheus; token=XXXXX
  2. prometheus v2.7.0 I’m config the prometheus remote_write and remote_read: remote_write:

url: “http://30.23.4.174:9999/api/v2/write?org=prometheus&bucket=prometheus&precision=s” bearer_token: “XXXXX” remote_read:

url: “http://30.23.4.174:9999/api/v2/read?org=prometheus&bucket=prometheus&precision=s” bearer_token: “XXXXX” 3. but prometheus log is : err=“server returned HTTP status 401 Unauthorized:{“code”:“unauthorized”,“message”:“unauthorized access”}”

  1. I’m try it by curl ,that token is ok curl “http://30.23.4.174:9999/api/v2/write?org=prometheus&bucket=prometheus&precision=s” --header “Authorization: Token XXXXX” --data “mem,host=host1 used_percent=23 1560324751”

Expected behavior: Describe what you expected to happen.

Actual behavior: Describe What actually happened.

Environment info:

  • System info: Run uname -srm and copy the output here
  • InfluxDB version: Run influxd version and copy the output here
  • Other relevant environment details: Container runtime, disk info, etc

Config: Copy any non-default config values here or attach the full config as a gist or file.

Logs: Include snippet of errors in log.

Performance: Generate profiles with the following commands for bugs related to performance, locking, out of memory (OOM), etc.

# Commands should be run when the bug is actively.
# Note: This command will run for at least 30 seconds.
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=true"
curl -o vars.txt "http://localhost:8086/debug/vars"
iostat -xd 1 30 > iostat.txt
# Attach the `profiles.tar.gz`, `vars.txt`, and `iostat.txt` output files.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 18 (6 by maintainers)

Most upvoted comments

@DemoLiang Our API team is in the process of vetting the potential for supporting both the Bearer and Token auth schemas.

Hello, we are experimenting with influxdb2 and prometheus. +1 to implement remote write api so we can use prometheus in influxdb2

The remote write API has not yet been implemented. We are discussing our Q2 plans at the moment. There is an outstanding issue that we are aware of, even if we enable the remote write API…which is related to NaN and +/- INF. These will not be initially supported.

We are looking for feedback about how big an issue this is for our user base. I’m sure for some users/use cases it will be an issue given #4089 But, looking for some pointers about how pervasive this issue is for the community.

Hi. We were about to look into the use of InfluxDB as a downscaling-capable remote storage for prometheus. The inability of using remote write/read capabilities with InfluxDB 2.0 prevents us from moving towards this goal.

So I’d say it’s a pretty useful feature.

+1, why Prometheus is not able to do remote write to influxdb2.0? How come a new version have not feature the existing flow. correct me if we still cannot use Prometheus remote read/write with influx 2.0.

our plan is to add prometheus remote write support to Telegraf: https://github.com/influxdata/telegraf/issues/9165

Prometheus remote_write now works with influxdb2.0, see https://github.com/influxdata/influxdb/issues/17958 and this blog post.

There is an open issue for remote_read: https://github.com/influxdata/influxdb/issues/20519

Closing this issue as a duplicate. @xxj123go if you are still seeing errors on the latest influxdb I recommend opening a new issue for that specifically.