-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Auto-configuration based on environment variables does not work #593
Comments
I am encountering the same issue. |
I'm not able to reproduce this |
I'm having the same issue using the example docker container configuration (tried both docker-compose/with-nginx-proxy/mariadb/fpm and docker-compose/with-nginx-proxy/postgres/fpm) EDIT: |
I used the example in #593 (comment) |
I got the same problem, but only on an existing installation. Copy & Pasting the nextcloud parts into a new docker-compose file and starting it works like a charme... |
Auto configuration will not overwrite settings if you already have an existing installation. If you are migrating or already have installed nextcloud, you have to edit the config file manually by attaching to the container or copying additional files into the container/volume. |
normally Can you please post your docker-compose file? |
You forgot the MySQL info for nextcloud to automatically configure the database connection. That's why the setup page is coming up. You need to add the following variables:
|
Are you sure you started a fresh install? Remove the created volumes with |
Ok, thanks for clarification - if restored my files and it works again |
I think the problem is caused by a race condition. docker/16.0/apache/entrypoint.sh Line 104 in 2acb1df
|
the same problem with postgres:
On the first URL checking I see "Create an admin account" message. UPD. when I trying to put admin/admin as login and password on that screen, I got that error:
Feels like nextcloud tries to connect with another user. But:
|
Autoconfig based on ENV Vars is still broken in v17. |
same issue in v17, |
Tried with version 16 and 17 and this issue pops up. |
Broken for me too. Possible mitigations:
If you've already created your volumesMitigation without intervening on the source, for us users consists in removing the faulty Nextcloud volume, and recreating it:
If you're freshIf you haven't ever ran sudo docker-compose -f docker-compose.yml up db Let it do its thang, then kill it, and run:; sudo docker-compose up Both those solutions work, which confirms it's a racing condition, though I have no idea why. |
would be great to have an argument to auto-configure the nextcloud (triggering the install) when running the container. |
This is due a performance regression in recent MariaDB releases, see MariaDB/mariadb-docker#262 |
For anyone that's still struggling with this issue, I was able to come up with a solution in my docker-compose project. The cause of the issue has already been discussed above (mariadb takes ~60 seconds to setup on first launch, whereas nextcloud only performs 10 install attempts. If mariadb doesn't start up before nextcloud, the installation will fail and the parameters won't be applied)... To resolve it, I mount the wait-for-it script found here https://github.com/vishnubob/wait-for-it into the container, override the entrypoint in my docker-compose file to call the script which then calls the entrypoint when the database container is accepting connections.
|
Hello, i'm still struggling with this, Is there a way to auto-config a docker nextcloud instance sticking with sqlite (default database)? I tried to configure this instance through Travis CI yaml file here https://github.com/eblondel/ocs4R/blob/master/.travis.yml#L52 Thanks |
#963 didn't solve this, MariaDB is still taking too much time to start in some cases. And, since the related MariaDB issue is still open, maybe this issue should be reopen too so people can see workarounds. By now, I guess the best option is to use wait-for-it, as suggested by @bhammack . |
Thanks, I've finally resolved my issue, and to me it works well, including with a SQLITE database. |
When installing with PostgreSQL/MySQL/MariaDB, nextcloud tries to use |
Values set in |
@jakkso I have the same issue here! Apparently it is a problem with the new release of the latest image, since a few days ago the environment variables were working normally |
@krouw and anyone else having this problem: as a stopgap solution I copied |
any news here? I went and chose to use docker because it's "nice and clean", and now I have to integrate hacks like the wait-for-it script? I don't really get why this isn't fixed yet (or broken again), anyone running a real docker compose setup will run into this problem. EDIT: Now i tried the wait-for-it, and it didn't work - the db container taking too long doesn't seem to be the problem. The logs don't really show any problem, either...
|
Unsure why the issue is |
(EDIT: FIXED, SEE BELOW!) For anyone who comes across this thread for the same reasons I did: The issue that I was having not getting TRUSTED_DOMAINS env variable to pass through was related to this issue. I did not realize that both the db container and the nextcloud container, confusingly, have MYSQL_PASSWORD/DATABASE/USER environmental variables as it is not really stated in the documentation which environmental variables go with the nextcloud container and which go with the mariadb container. This is partially because the readme page linked from the hub.docker.com page is not the proper, fully updated one - this is linked as opposed to the readme.md from this repository., which contains a small modification to a pertinent section - see the issue linked above, an edit to the readme.md was made as a result. Is this something I should open an issue for, or is this not the proper place to do it considering that the issue is more related to the hub.docker.com page? |
I have similar problems. |
I had the exact same behaviour as the the OP. I solved the problem by setting the environment variables |
@Giom-fm I'm facing the same issue. Did you ever figure this out? |
This still does not work with postgresql and nextcloud 25. After configuring all ENV-vars and starting the container. There are errors as the installer tries to use the admin user of the install script. Furthermore it is not possible to use hyphens in admin user names. |
@clayrisser Sorry for the delay. |
Hello, same issue here, but with an already existing mariadb database, i verified that the database works and configured 'nextcloud' ad the database user in the cdocker compose file but in the logs i still see it using oc_admin, this is weird, and also cant get past the first run configuration page because it always says my db username or password is wrong, why is that still an issue after a so long time? |
This Issue is a hodgepodge of loads of different situations. Many of these are unrelated. Some have since been fixed. There have also been numerous documentation revisions. The original report was also already addressed so I'm closing this issue. But not without some awareness there are possibly some legitimate bug reports in here. Unfortunately it's impossible to isolate each of the remaining situations without a full bug report from each person because similar symptoms do not always equal the same underlying cause. I'm going to re-close this, but feel free to open individual issues if you think there is bug in the image that you are experiencing today. To head off a few things, here's a quick summary of a few things off the top of my head I see above that weren't already addressed or seem worthy of re-mentioning:
|
It seems auto-configuration using environment variables does not work when using docker image "nextcloud:15.0.0-apache".
docker-compose.yml:
Results in the first-time wizard having empty admin user/password, sqlite as the chosen database, and when one chooses mysql the mysql infos aren't filled in. So for some reason all those environment variables are ignored by the first-time wizard.
If I start a bash shell in the container, I can see the environment variables there just fine.
The text was updated successfully, but these errors were encountered: