I am using the docker image influxdb:1.8 and I want to connect to my influx database using Python from within another container. I figured out how to do it without too much looking around. However, I noticed I was able to connect to my database (and even query data !) no matter which username or password I used.
My experiment was to connect to Influx using an InfluxDBClient and some random username and password. Not only did it work, but printing client_variable._username or client_variable._password worked as well. However, the revoke_admin_privileges method raised “InfluxDBClientError: user not found”.
Why isn’t this error raised when I initiate the client object ?
In order to better understand, I connected to the Influx container and started Influx locally. There, the “show users” command returned no known user, which also surprised me because in my docker-compose.yml file I specified a username and a password that I wanted to use.
Any thoughts on all this ?
PS : Here is the part of my docker-compose.yml that creates the container.
influxdb:
image: influxdb:1.8
restart: always
ports:
- "8086:8086"
environment:
- INFLUXDB_DB=first
- INFLUXDB_ADMIN_USER=some_user
- INFLUXDB_ADMIN_PASSWORD=your_password_hehe
- INFLUXDB_HTTP_AUTH_ENABLED=false
networks:
- mynetwork
volumes:
- ./volumes/influxdb-volume:/var/lib/influxdb
cpus: 0.80
logging:
driver: "none"