Closed louis-prudhomme closed 1 year ago
Follow-up : after some tinkering in my configuration & some reading of the nextcloud server source code, here's what I understood:
autoconfig.php
file; however, this file must specify an "install" => true
property in order to trigger installation as per line 67 of their SetupController.php
fileThe first issue be can be easily fixed.
The second is trickier. I'm considering use of depends_on:
along with a healthcheck
to circumvent the issue. Any other ideas ?
I am facing the same issue. Been tinkering with it for a few nights - no success yet.
Running the container on k3s, mounted volume is a bcache. I tried mounting to my home directory, no luck.
I'm fairly confident the repeating of the error in the logs is because of the cron task that runs every 5 minutes https://github.com/linuxserver/docker-nextcloud/blob/3c326e02c17ce921128c0bd63a038147365fffd1/root/etc/crontabs/root#L9
I would be very curious if you could wipe your config folder for nextcloud (rename it if necessary) and then start a brand new container with a fresh empty config (don't copy in your php) and run through the setup in the web UI.
k logs nextcloud-0 -n nextcloud
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service 00-legacy: starting
s6-rc: info: service 00-legacy successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/01-envfile
cont-init: info: /etc/cont-init.d/01-envfile exited 0
cont-init: info: running /etc/cont-init.d/01-migrations
[migrations] started
[migrations] 01-nginx-site-confs-default: executing...
[migrations] 01-nginx-site-confs-default: succeeded
[migrations] done
cont-init: info: /etc/cont-init.d/01-migrations exited 0
cont-init: info: running /etc/cont-init.d/10-adduser
cont-init: info: /etc/cont-init.d/10-adduser exited 0
cont-init: info: running /etc/cont-init.d/11-folders
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
-------------------------------------
To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------
User uid: 1001
User gid: 1002
-------------------------------------
cont-init: info: /etc/cont-init.d/11-folders exited 0
cont-init: info: running /etc/cont-init.d/12-samples
cont-init: info: /etc/cont-init.d/12-samples exited 0
cont-init: info: running /etc/cont-init.d/13-nginx
Setting resolver to 10.43.0.10
Setting worker_processes to 4
cont-init: info: /etc/cont-init.d/13-nginx exited 0
cont-init: info: running /etc/cont-init.d/14-php
cont-init: info: /etc/cont-init.d/14-php exited 0
cont-init: info: running /etc/cont-init.d/15-keygen
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
.......................................+++++
................................................................................+++++
writing new private key to '/config/keys/cert.key'
-----
cont-init: info: /etc/cont-init.d/15-keygen exited 0
cont-init: info: running /etc/cont-init.d/20-permissions
cont-init: info: /etc/cont-init.d/20-permissions exited 0
cont-init: info: running /etc/cont-init.d/40-config
cont-init: info: /etc/cont-init.d/40-config exited 0
cont-init: info: running /etc/cont-init.d/50-install
cont-init: info: /etc/cont-init.d/50-install exited 0
cont-init: info: running /etc/cont-init.d/60-memcache
cont-init: info: /etc/cont-init.d/60-memcache exited 0
cont-init: info: running /etc/cont-init.d/70-aliases
cont-init: info: /etc/cont-init.d/70-aliases exited 0
cont-init: info: running /etc/cont-init.d/85-version-checks
cont-init: info: /etc/cont-init.d/85-version-checks exited 0
cont-init: info: running /etc/cont-init.d/99-custom-files
[custom-init] No custom files found, skipping...
cont-init: info: /etc/cont-init.d/99-custom-files exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-mods: starting
s6-rc: info: service init-mods successfully started
s6-rc: info: service init-mods-package-install: starting
s6-rc: info: service init-mods-package-install successfully started
s6-rc: info: service init-mods-end: starting
s6-rc: info: service init-mods-end successfully started
s6-rc: info: service init-services: starting
s6-rc: info: service init-services successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun cron (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
services-up: info: copying legacy longrun php-fpm (no readiness notification)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service 99-ci-service-check: starting
[ls.io-init] done.
s6-rc: info: service 99-ci-service-check successfully started
Exception: Not installed in /config/www/nextcloud/lib/base.php:284
Stack trace:
#0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1144): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('...')
#3 {main}
{"reqId":"gcD6voKTCFDpcp8fT1OM","level":3,"time":"2023-01-29T17:05:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Not installed","userAgent":"--","version":"","exception":{"Exception":"Exception","Message":"Not installed","Code":0,"Trace":[{"file":"/config/www/nextcloud/lib/base.php","line":680,"function":"checkInstalled","class":"OC","type":"::"},{"file":"/config/www/nextcloud/lib/base.php","line":1144,"function":"init","class":"OC","type":"::"},{"file":"/config/www/nextcloud/cron.php","line":43,"args":["/config/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/config/www/nextcloud/lib/base.php","Line":284,"CustomMessage":"--"}}
I deleted the config folder and started a new pod. These are the container logs.
run through the setup in the web UI.
It works, but that's the point : it is necessary to go through the web UI. This means I cannot chain transmission to nextcloud :
The solution from there seems to firstly spin the docker compose with mock parameters for transmission, install nextcloud, then stopping the containers and providing the real path for transmission before starting everything again; which is painful.
I'm not sure if it's nextcloud default behavior not to install its instance, or if this is an issue with this image. Likewise, I'm not sure whether this image should mark the container "started" when nextcloud is not installed.
However, what ultimately seems to work with me is to use a healthcheck ; I'm simply curl
ing nextcloud repeatedly, which triggers installation and eventually marks the container healthy as soon as the login page pops up.Thanks for your help, though !
I have this issue with a fresh install but am unable to access the UI to finish the setup.
Any ideas?
Surely you'd want to create and set up nextcloud before letting any other app write stuff into what's meant to be the nextcloud data folder.
You don't have to create and start transmission at the same time as nextcloud. You can create your pod or do compose up -d with just nextcloud (optionally with mariadb), set it up in the wizard, then add transmission into the yaml and update the pod ir do compose up -d again. It only affects brand new installs.
started
refers to the nextcloud container and has no bearing on whether the wizard is completed or not.
While I follow the logic, having to configure manually through a UI something which can also be configured through a text file is quite painful in my opinion.
But then again, maybe this is something nextcloud should address (for the record, finding information about autoconfig.php
and config.php
is painful in its own rights and I'm about 70% sure I'm missing several points).
Regardless, adding a healthcheck was the right tool for me and I hope this issue will provide insight for others with a similar use case (as below).
FROM lscr.io/linuxserver/nextcloud:latest
# pinging the nextloud instance will eventually trigger the installation process until ultimately returning a login page
HEALTHCHECK \
--interval=2m \
--retries=10 \
--start-period=10m \
--timeout=5s \
CMD curl --insecure --fail "https://localhost:443/login" || exit 1
However, if (as @aptalca & @Festlandtommy & others seem to point out) the image's standard behavior is to output error logs (because manual installation is required), I think it could be a nice addition to the documentation.
I don't know why this worked, but it worked. FYI, you can add a healthcheck to your docker compose file if you have one:
nextcloud:
network_mode: "service:gluetun"
image: lscr.io/linuxserver/nextcloud:latest
container_name: nextcloud
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- .config/nextcloud/config:/config
- .config/nextcloud/data:/data
healthcheck:
test: curl --insecure --fail "https://localhost:443/login" || exit 1
interval: 2m
retries: 10
start_period: 10m
timeout: 5s
restart: unless-stopped
Is there an existing issue for this?
Current Behavior
When I run the container for the first time, it configures Nextcloud, but something (I don't know what) triggers an exception somewhere in the process.
I suspect this prevents the setup from completing normally: my
config/www/nextcloud/config/config.php
file is not marked asinstalled => true
.I have to manually edit the
autoconfig.php
file I provided and then manually setup the admin account through the web UI. There, theautoconfig.php
file is deleted, theconfig.php
file is updated and everything runs normally.When looking at the logs, I see an exception and this stacktrace, which is repeated every 5 minutes or so:
Though I post from my mac, as it is the hardware I have most of the time at hand, I also reproduced this bug on my Debian machine.
It seems to me my issue is very similar to #230 ; @j0nnymoe suggested it could be a permission issue and to try with folders under the
/home/<user>
path, but it was the case in both configurations on my side.As said in this issue as well as earlier, I use both a
config.php
and anautoconfig.php
files. Is there something wrong in my config ?Expected Behavior
I expect the Nextcloud setup to complete normally and my
config.php
to be updated accordingly.Thanks a lot for your hard work, dedication and support by the way ; I have discovered your containers recently and I must say I am extremely satisfied with how easy the setup becomes, thanks to them (also, rad docs).
Steps To Reproduce
./
is the root of the repository: a. create./config/www/nextcloud/config/autoconfig.php
and paste the contents below b. also copy the./nextcloud/config.php
as./config/www/nextcloud/config/config.php
(this one is not ciphered) c. finally, at the repository root, create an.env
file and paste the contents belowdocker-compose up
and wait for a bitautoconfig.php
:.env
:Environment
CPU architecture
arm64
Docker creation
Used
docker-compose up
on thisdocker-compose.yml
:Container logs