influxdata / ui

UI for InfluxDB
94 stars 42 forks source link

got unauthorize access after a while using influxdb #6940

Open amin-basiri opened 2 months ago

amin-basiri commented 2 months ago

About the bug

Steps to reproduce:

  1. start influxdb oss on docker
  2. use api call to save and query data from another service on docker

Expected behavior: api call works normally and i can get and set my data periodically

Actual behavior: after 3 days i got unauthorized access from influxdb on my service. when i try to login to influxdb on ui i got An InfluxDB error has occurred

Visual Proof: i got this after login from ui image

About your environment

Environment info:

Config: i just use DOCKER_INFLUXDB_INIT_MODE, DOCKER_INFLUXDB_INIT_USERNAME, DOCKER_INFLUXDB_INIT_PASSWORD, DOCKER_INFLUXDB_INIT_ORG, DOCKER_INFLUXDB_INIT_BUCKET environment variable to launch influxdb on docker using docker compose

Logs: influx db logs on docker:

influx-db-1  | ts=2024-09-03T07:59:45.567559Z lvl=info msg=Unauthorized log_id=0rMGMBwW000 error="session not found"
influx-db-1  | ts=2024-09-03T07:59:45.576214Z lvl=info msg=Unauthorized log_id=0rMGMBwW000 error="session not found"
influx-db-1  | ts=2024-09-03T07:59:45.583360Z lvl=info msg=Unauthorized log_id=0rMGMBwW000 error="session not found"
influx-db-1  | ts=2024-09-03T07:59:45.599761Z lvl=info msg=Unauthorized log_id=0rMGMBwW000 error="session not found"
influx-db-1  | ts=2024-09-03T07:59:45.613114Z lvl=info msg=Unauthorized log_id=0rMGMBwW000 error="session not found"
influx-db-1  | ts=2024-09-03T07:59:45.619762Z lvl=info msg=Unauthorized log_id=0rMGMBwW000 error="session not found"

api call logs from other service:

websocket-1  | HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.6', 'X-Platform-Error-Code': 'unauthorized', 'Date': 'Tue, 03 Sep 2024 08:04:21 GMT', 'Content-Length': '55'})
websocket-1  | HTTP response body: {"code":"unauthorized","message":"unauthorized access"}
amin-basiri commented 2 months ago

i am using python influxdb client and username and password for authentication. in my case after a while my session has been expired and i have 2 choice to solve this problem 1) using token base authentication except username and password authentication (i choose this one) 2) catch exception manually and sign in again

the problem with client solved but ui crash exists and randomly influx ui crashes