linuxserver / docker-nextcloud

GNU General Public License v3.0
710 stars 128 forks source link

[BUG] Exception: Not installed in /config/www/nextcloud/lib/base.php:284 #280

Closed louis-prudhomme closed 1 year ago

louis-prudhomme commented 1 year ago

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 as installed => true.

I have to manually edit the autoconfig.php file I provided and then manually setup the admin account through the web UI. There, the autoconfig.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:

nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}

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 an autoconfig.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

  1. on macOS (or Debian)
  2. clone this repository: https://github.com/louis-prudhomme/ambre
  3. critical secrets are ciphered, so, assuming ./ 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 below
  4. run docker-compose up and wait for a bit

autoconfig.php:

<?php
$AUTOCONFIG = [
    "dbtype"        => "sqlite",
    "dbname"        => "nextcloud",
    "dbtableprefix" => "",
    "adminlogin"    => "root",
    "adminpass"     => 'OPasswordSoStrong987',
    "directory"     => "/data",
];

.env:

# global
COMPOSE_PROJECT_NAME=ambre
data_path=<whichever suits you best>
timezone=Europe/Paris
# wireguard
wireguard_ext_port=51820
# transmission
transmission_usr=transmission_usr
transmission_pwd=iAmAMightyPassword123
transmission_peerport=51413
transmission_ui_port=9091
# nextcloud
nextcloud_port=80
nextcloud_usr=nextcloud_usr
# gid & uid
uid=<your uid>
gid=<your gid>

Environment

- OS: macOS 12.6.0 Monterey   
- How docker service was installed: `Docker version 20.10.12, build e91ed57`, installed following [this page](https://docs.docker.com/desktop/install/mac-install/) for *Apple Silicon*
- CPU architecture arm64

But the bug was reproduced from a `Debian 5.10.149-2 (2022-10-21) x86_64`, on which Docker was installed through their repository, following [this page](https://docs.docker.com/engine/install/debian/)

CPU architecture

arm64

Docker creation

Used docker-compose up on this docker-compose.yml:

---
version: "2.1"

services:
  wireguard:
    image: lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=${uid}
      - PGID=${gid}
      - TZ=${timezone}
    volumes:
      - ./config/wireguard:/config
    ports:
      - ${wireguard_ext_port}:51820/udp
      - ${transmission_ui_port}:${transmission_ui_port} 
      - ${transmission_peerport}:${transmission_peerport}
      - ${transmission_peerport}:${transmission_peerport}/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv6.conf.all.disable_ipv6=0
    restart: unless-stopped
  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=${uid}
      - PGID=${gid}
      - TZ=${timezone}
    volumes:
      - ./config/nextcloud:/config
      - ${data_path}/shared:/data
    ports:
      - ${nextcloud_port}:443
    restart: unless-stopped
  transmission:
    image: lscr.io/linuxserver/transmission:latest
    container_name: transmission
    depends_on: 
      - nextcloud
      - wireguard
    network_mode: "service:wireguard"
    environment:
      - PUID=${uid}
      - PGID=${gid}
      - TZ=${timezone}
      - TRANSMISSION_WEB_HOME=/flood-for-transmission/
      - USER=${transmission_usr}
      - PASS=${transmission_pwd}
      - PEERPORT=${transmission_peerport}
    volumes:
      - ./config/transmission:/config
      - ${data_path}/shared/${nextcloud_usr}/files/Torrents:/downloads
      - ${data_path}/transmission-watch:/watch
    restart: unless-stopped

Container logs

Attaching to transmission, wireguard, nextcloud
wireguard       | [custom-init] No custom services found, skipping...
wireguard       | [migrations] started
wireguard       | [migrations] no migrations found
wireguard       | 
wireguard       | -------------------------------------
wireguard       |           _         ()
wireguard       |          | |  ___   _    __
wireguard       |          | | / __| | |  /  \
wireguard       |          | | \__ \ | | | () |
wireguard       |          |_| |___/ |_|  \__/
wireguard       | 
wireguard       | 
wireguard       | Brought to you by linuxserver.io
wireguard       | -------------------------------------
wireguard       | 
wireguard       | To support the app dev(s) visit:
wireguard       | WireGuard: https://www.wireguard.com/donations/
wireguard       | 
wireguard       | To support LSIO projects visit:
wireguard       | https://www.linuxserver.io/donate/
wireguard       | -------------------------------------
wireguard       | GID/UID
wireguard       | -------------------------------------
wireguard       | 
wireguard       | User uid:    501
wireguard       | User gid:    20
wireguard       | -------------------------------------
wireguard       | 
wireguard       | Uname info: Linux 4f304652b532 5.10.76-linuxkit #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
wireguard       | **** It seems the wireguard module is already active. Skipping kernel header install and module compilation. ****
wireguard       | **** As the wireguard module is already active you can remove the SYS_MODULE capability from your container run/compose. ****
wireguard       | **** Client mode selected. ****
wireguard       | [custom-init] No custom files found, skipping...
wireguard       | **** Disabling CoreDNS ****
wireguard       | [#] ip link add wg0 type wireguard
wireguard       | [#] wg setconf wg0 /dev/fd/63
wireguard       | [#] ip -4 address add 10.0.15.253/19 dev wg0
wireguard       | [#] ip -6 address add 2a0c:dd43:1:2000::ffe/64 dev wg0
wireguard       | [#] ip link set mtu 1420 up dev wg0
wireguard       | [#] resolvconf -a wg0 -m 0 -x
wireguard       | [#] wg set wg0 fwmark 51820
wireguard       | [#] ip -6 route add ::/0 dev wg0 table 51820
wireguard       | [#] ip -6 rule add not fwmark 51820 table 51820
wireguard       | [#] ip -6 rule add table main suppress_prefixlength 0
wireguard       | [#] ip6tables-restore -n
wireguard       | [#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
wireguard       | [#] ip -4 rule add not fwmark 51820 table 51820
wireguard       | [#] ip -4 rule add table main suppress_prefixlength 0
wireguard       | [#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
wireguard       | sysctl: setting key "net.ipv4.conf.all.src_valid_mark", ignoring: Read-only file system
wireguard       | [#] iptables-restore -n
wireguard       | [ls.io-init] done.
transmission    | [custom-init] No custom services found, skipping...
transmission    | [migrations] started
transmission    | [migrations] no migrations found
transmission    | 
transmission    | -------------------------------------
transmission    |           _         ()
transmission    |          | |  ___   _    __
transmission    |          | | / __| | |  /  \
transmission    |          | | \__ \ | | | () |
transmission    |          |_| |___/ |_|  \__/
transmission    | 
transmission    | 
transmission    | Brought to you by linuxserver.io
transmission    | -------------------------------------
transmission    | 
transmission    | To support LSIO projects visit:
transmission    | https://www.linuxserver.io/donate/
transmission    | -------------------------------------
transmission    | GID/UID
transmission    | -------------------------------------
transmission    | 
transmission    | User uid:    501
transmission    | User gid:    20
transmission    | -------------------------------------
transmission    | 
transmission    | [custom-init] No custom files found, skipping...
transmission    | [2023-01-05 17:27:28.301] Transmission 3.00 (bb6b5a062e) started (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/session.c:769)
transmission    | [2023-01-05 17:27:28.301] RPC Server Serving RPC and Web requests on 0.0.0.0:9091/transmission/ (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/rpc-server.c:1243)
transmission    | [2023-01-05 17:27:28.301] RPC Server Password required (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/rpc-server.c:1254)
transmission    | [2023-01-05 17:27:28.301] DHT Generating new id (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/tr-dht.c:389)
transmission    | [2023-01-05 17:27:28.301] Using settings from "/config" (/home/buildozer/aports/community/transmission/src/transmission-3.00/daemon/daemon.c:646)
transmission    | [2023-01-05 17:27:28.301] Saved "/config/settings.json" (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/variant.c:1221)
transmission    | [2023-01-05 17:27:28.301] transmission-daemon requiring authentication (/home/buildozer/aports/community/transmission/src/transmission-3.00/daemon/daemon.c:674)
transmission    | [2023-01-05 17:27:28.301] Watching "/watch" for new .torrent files (/home/buildozer/aports/community/transmission/src/transmission-3.00/daemon/daemon.c:698)
transmission    | [2023-01-05 17:27:28.301] Port Forwarding (NAT-PMP) initnatpmp succeeded (0) (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/natpmp.c:73)
transmission    | [2023-01-05 17:27:28.301] Port Forwarding (NAT-PMP) sendpublicaddressrequest succeeded (2) (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/natpmp.c:73)
transmission    | [2023-01-05 17:27:36.299] Port Forwarding State changed from "Not forwarded" to "Starting" (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/port-forwarding.c:106)
transmission    | [2023-01-05 17:27:36.299] Port Forwarding State changed from "Starting" to "???" (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/port-forwarding.c:106)
transmission    | [2023-01-05 17:28:22.303] DHT Attempting bootstrap from dht.transmissionbt.com (/home/buildozer/aports/community/transmission/src/transmission-3.00/libtransmission/tr-dht.c:299)
nextcloud       | [custom-init] No custom services found, skipping...
nextcloud       | s6-rc: info: service s6rc-oneshot-runner: starting
nextcloud       | s6-rc: info: service s6rc-oneshot-runner successfully started
nextcloud       | s6-rc: info: service fix-attrs: starting
nextcloud       | s6-rc: info: service 00-legacy: starting
nextcloud       | s6-rc: info: service 00-legacy successfully started
nextcloud       | s6-rc: info: service fix-attrs successfully started
nextcloud       | s6-rc: info: service legacy-cont-init: starting
nextcloud       | cont-init: info: running /etc/cont-init.d/01-envfile
nextcloud       | cont-init: info: /etc/cont-init.d/01-envfile exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/01-migrations
nextcloud       | [migrations] started
nextcloud       | [migrations] 01-nginx-site-confs-default: executing...
nextcloud       | cont-init: info: /etc/cont-init.d/01-migrations exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/10-adduser
nextcloud       | [migrations] 01-nginx-site-confs-default: succeeded
nextcloud       | [migrations] done
nextcloud       | 
nextcloud       | -------------------------------------
nextcloud       |           _         ()
nextcloud       |          | |  ___   _    __
nextcloud       |          | | / __| | |  /  \
nextcloud       |          | | \__ \ | | | () |
nextcloud       |          |_| |___/ |_|  \__/
nextcloud       | 
nextcloud       | 
nextcloud       | Brought to you by linuxserver.io
nextcloud       | -------------------------------------
nextcloud       | 
nextcloud       | To support LSIO projects visit:
nextcloud       | https://www.linuxserver.io/donate/
nextcloud       | -------------------------------------
nextcloud       | GID/UID
nextcloud       | -------------------------------------
nextcloud       | 
nextcloud       | User uid:    501
nextcloud       | User gid:    20
nextcloud       | -------------------------------------
nextcloud       | 
nextcloud       | cont-init: info: /etc/cont-init.d/10-adduser exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/11-folders
nextcloud       | cont-init: info: /etc/cont-init.d/11-folders exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/12-samples
nextcloud       | cont-init: info: /etc/cont-init.d/12-samples exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/13-nginx
nextcloud       | Setting resolver to  127.0.0.11
nextcloud       | Setting worker_processes to 5
nextcloud       | cont-init: info: /etc/cont-init.d/13-nginx exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/14-php
nextcloud       | cont-init: info: /etc/cont-init.d/14-php exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/15-keygen
nextcloud       | generating self-signed keys in /config/keys, you can replace these with your own keys if required
nextcloud       | Generating a RSA private key
nextcloud       | .....................+++++
nextcloud       | ..........................................+++++
nextcloud       | writing new private key to '/config/keys/cert.key'
nextcloud       | -----
nextcloud       | cont-init: info: /etc/cont-init.d/15-keygen exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/20-permissions
nextcloud       | cont-init: info: /etc/cont-init.d/20-permissions exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/40-config
nextcloud       | cont-init: info: /etc/cont-init.d/40-config exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/50-install
nextcloud       | cont-init: info: /etc/cont-init.d/50-install exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/60-memcache
nextcloud       | cont-init: info: /etc/cont-init.d/60-memcache exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/70-aliases
nextcloud       | cont-init: info: /etc/cont-init.d/70-aliases exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/85-version-checks
nextcloud       | cont-init: info: /etc/cont-init.d/85-version-checks exited 0
nextcloud       | cont-init: info: running /etc/cont-init.d/99-custom-files
nextcloud       | [custom-init] No custom files found, skipping...
nextcloud       | cont-init: info: /etc/cont-init.d/99-custom-files exited 0
nextcloud       | s6-rc: info: service legacy-cont-init successfully started
nextcloud       | s6-rc: info: service init-mods: starting
nextcloud       | s6-rc: info: service init-mods successfully started
nextcloud       | s6-rc: info: service init-mods-package-install: starting
nextcloud       | s6-rc: info: service init-mods-package-install successfully started
nextcloud       | s6-rc: info: service init-mods-end: starting
nextcloud       | s6-rc: info: service init-mods-end successfully started
nextcloud       | s6-rc: info: service init-services: starting
nextcloud       | s6-rc: info: service init-services successfully started
nextcloud       | s6-rc: info: service legacy-services: starting
nextcloud       | services-up: info: copying legacy longrun cron (no readiness notification)
nextcloud       | services-up: info: copying legacy longrun nginx (no readiness notification)
nextcloud       | services-up: info: copying legacy longrun php-fpm (no readiness notification)
nextcloud       | s6-rc: info: service legacy-services successfully started
nextcloud       | s6-rc: info: service 99-ci-service-check: starting
nextcloud       | [ls.io-init] done.
nextcloud       | s6-rc: info: service 99-ci-service-check successfully started
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
nextcloud       | Exception: Not installed in /config/www/nextcloud/lib/base.php:284
nextcloud       | Stack trace:
nextcloud       | #0 /config/www/nextcloud/lib/base.php(680): OC::checkInstalled()
nextcloud       | #1 /config/www/nextcloud/lib/base.php(1144): OC::init()
nextcloud       | #2 /config/www/nextcloud/cron.php(43): require_once('...')
nextcloud       | #3 {main}
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

louis-prudhomme commented 1 year ago

Follow-up : after some tinkering in my configuration & some reading of the nextcloud server source code, here's what I understood:

The 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 ?

Festlandtommy commented 1 year ago

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.

nemchik commented 1 year ago

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.

Festlandtommy commented 1 year ago
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.

louis-prudhomme commented 1 year ago

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 curling nextcloud repeatedly, which triggers installation and eventually marks the container healthy as soon as the login page pops up.Thanks for your help, though !

maxi1134 commented 1 year ago

I have this issue with a fresh install but am unable to access the UI to finish the setup.

Any ideas?

aptalca commented 1 year ago

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.

louis-prudhomme commented 1 year ago

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.

StevenXL commented 1 year ago

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