Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Authorization error against InfluxDB 2.0 #897

Open
rajahaidar opened this issue Aug 25, 2021 · 5 comments
Open

Authorization error against InfluxDB 2.0 #897

rajahaidar opened this issue Aug 25, 2021 · 5 comments
Assignees

Comments

@rajahaidar
Copy link

rajahaidar commented Aug 25, 2021

  • InfluxDB version: 2.0
  • InfluxDB-python version: e.g. 5.3.1
  • Python version: 3.9
  • Operating system version: Docker on MacOS

When upgrading influxDB from 1.8 to 2.0, and trying to use the same application logic we currently have, we are getting a 401 unauthorized when trying to insert data using the admin user which was specified in the upgrade environment variables.

Error raised: 401: {"code":"unauthorized","message":"Unauthorized"}

This is the docker-compose that was used to bring up the instance

  influxdb:
    image: influxdb:2.0
    ports:
      - '8086:8086'
    volumes:
      - ./influxdb:/var/lib/influxdb
      - ./influxdb2:/var/lib/influxdb2

    networks:
      - backend
    environment:
      # - INFLUXDB_ADMIN_USER=admin
      # - INFLUXDB_ADMIN_PASSWORD=supersecret
      # - INFLUXDB_DB=db0
      - DOCKER_INFLUXDB_INIT_MODE=upgrade
      - DOCKER_INFLUXDB_INIT_USERNAME=admin
      - DOCKER_INFLUXDB_INIT_PASSWORD=supersecret
      - DOCKER_INFLUXDB_INIT_ORG=someorg
      - DOCKER_INFLUXDB_INIT_BUCKET=default
@BaneOfKnoll
Copy link

I'm also getting this in my unraid docker environment. Trying to set up with influxDB2.0 has there been any indication of a solution?

@lestercollado
Copy link

Help!

@BaneOfKnoll
Copy link

I found some info that indicates the issue I was having. Not sure if it also affects you.
https://community.influxdata.com/t/getting-started-with-influxdb-docker-401-unauthorized/16989/3

@raymond4entrak
Copy link

I also come across a similar problem. Mine is running on a VM. I successfully updated from v1.8 to v2.2 on 31-May and operated as usual on 1-Jun. But today (2-Jun), it suddenly rejected all the requests with an unauthorized error. Now, I even can't run any influx command via the CLI.

Please help!

@pspacek
Copy link

pspacek commented Jun 6, 2022

InfluxDB v1 compatibility requires extra setup using influx v1 authorization create command.
InfluxDB v2 API is provided by different library: https://influxdb-client.readthedocs.io/en/stable/index.html

Pick your poison, I would day.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants