New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database initialization is not working #232
Comments
Any progress on this? I have the same issue when auth is enabled. |
I've fixed the issue by escaping "true" value for
@cpang2 can you confirm whether it works for you? |
Having the same issue. Passing |
I am also seeing this issue
Database is not initialized. Users are not created. |
edit: Sorry, my bad. Using |
As mentionned by @PSanetra in another thread, cleaning my influxdb volume fixed it for me (rm -rf /influxDbData) |
I ran into a similar issue. I've set There was an issue with the special characters not being properly escaped. In my case, the database was called |
thanks to the comment above from @emriver . cleaning the volume fixed it for me. |
My problem was having OLD: influxdb:
image: docker.io/influxdb:latest
environment:
- INFLUXDB_DB=prometheus
volumes:
- ./influxdb.conf:/etc/influxdb/influxdb.conf
command:
- 'influxd'
- '-config'
- '/etc/influxdb/influxdb.conf' NEW: influxdb:
image: docker.io/influxdb:latest
environment:
- INFLUXDB_DB=prometheus
volumes:
- ./influxdb.conf:/etc/influxdb/influxdb.conf
command:
- '-config'
- '/etc/influxdb/influxdb.conf' |
This is what worked for me using docker-compose. Keep in mind it doesn't work well when changing those settings back and forth. Once the database is initialized it will somehow rebel against changes and output weird errors while authenticating. In my case deleting So delete any database dir first and then use the config below:
|
Hello, still have the problem with the current version. |
Thank you for this hint, I struggled with this for hours. Deleting the volume and let docker-compose recreate it solved it. |
This issue is quite old - is there any hope that it will be fixed at all. Any workaround to set the ADMIN_USER, ADMIN_PASSWORD as well as the option to HTTP_AUTH_ENABLED at initial docker-compose? |
Checking the INIT_USERS=$([ ! -z "$AUTH_ENABLED" ] && [ ! -z "$INFLUXDB_ADMIN_USER" ] && echo 1 || echo) I have checked it and it properly initializes the db and creates the user if you specify all the required variables. I've stumbled upon this issue for a different thing though (I'll create a different issue for it right away): if you specify a |
Hello, env should be correct (this is from my docker-compose.yml file)
It should work as I have both ADMIN USER and HTTP AUTH enabled
so it has everything to create user and db...in theory i can see these logs
and these logs
Anyhow, if i check on my local directory used for influx data i do not see the db created
only internal db is created as a result, when i go to grafana and try to create a data source it fails due to authorization issues (as i'm probably trying to 'connect' to a db that does not exist Is there a working tag or something i can do to make it work? |
Ok the issue for me was with the meta_data directory check with the in the if statement before the init stuff occurs. if ( [ ! -z "$INIT_USERS" ] || [ ! -z "$INFLUXDB_DB" ] || [ "$(ls -A /docker-entrypoint-initdb.d 2> /dev/null)" ] ) && [ ! "$(ls -d "$META_DIR" 2>/dev/null)" ]; then The last part is checking if the $META_DIR directory exists - if it does it won't continue. This is important as it's what really see's if the init command have been run and if they needs to be run again. My problem is I don't want to use a volume but a bind - and I can't do that with What I did was replaced [ ! "$(ls -d "$META_DIR" 2>/dev/null)" ] with [ $(ls "$META_DIR" | wc -l | grep -w "0") ] |
Please specify the OS on which you run docker and the docker-compose version you are using. BTW, it might have to do with the OS, on Windows 10 I have to use double quotes for the environement variables, so: INFLUXDB_DB="db-test" and it works. hope that helps! |
that's worked for me
|
If you're still using influxdb:1.8, you'll need to set a custom meta DB directory with the
|
Do we have any solution for this, as after every restart of the container or docker service or server reboot I have to change the meta DIR variable.
|
Tried to create database user and database in docker-compose.yml but it is not working. Nothing gets created. Please advise.
influxdb:
image: influxdb:latest
restart: always
container_name: influxdb
ports:
- "8086:8086"
environment:
- INFLUXDB_ADMIN_USER=USERNAME
- INFLUXDB_ADMIN_PASSWORD=PASS
- INFLUXDB_DB=DBTEST
- INFLUXDB_HTTP_ENABLED=true
- INFLUXDB_HTTP_AUTH_ENABLED=true
The text was updated successfully, but these errors were encountered: