Hallo zusammen,
aktuell komme ich nicht mehr weiter. Mein Ziel ist es, dass ich via Docker/Portainer eine Nextcloud Instanz betreiben kann. Zuerst hatte ich vorgehabt, die AIO Variante zu installieren, aber dies war nicht von Erfolg gekrönt, da ich Traefik als Proxy betreibe und der Apache mir hier Probleme bereitet hatte, die ich nicht gelöst bekommen habe. Da daneben auch einige Container hochgefahren wurden, versuche ich nun den âold-schoolâ Way mit einem schlanken eigenen Nextcloud-Stack.
version: "3.9"
services:
nextcloudpostgres:
# UTF8 de_DE
# **********
#
# Unter IMAGES wurde ein eigenes Image zu Postres zum Setzen von de_DE erzeugt. Dort kann man die Version entsprechend
# anheben.
#
# Inhalt zum Erstellen des Images:
#
# FROM postgres:15
# RUN sed -i 's/^# *\(en_US.UTF-8\|de_DE.UTF-8\)/\1/' /etc/locale.gen && locale-gen
# ENV LANG de_DE.utf8
#
image: postgres-de
container_name: nextcloud-db
restart: always
hostname: nextcloudpostgres
environment:
TZ: "Europe/Berlin"
POSTGRES_DB: "nextcloud"
POSTGRES_USER: "nchubdbu"
POSTGRES_PASSWORD: "****"
# https://www.postgresql.org/docs/current/app-initdb.html <-- alle Optionen
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
networks:
- jarvis-proxy-network
volumes:
- nextcloudhub-postgres-volume:/var/lib/postgresql/data
nextcloudredis:
image: redis:7
container_name: nextcloud-redis
restart: always
hostname: nextcloudredis
command: /bin/sh -c "redis-server --requirepass '****'"
networks:
- jarvis-proxy-network
volumes:
- nextcloudhub-redis-volume:/data
nextcloudhub:
image: nextcloud:27
container_name: nextcloud-hub
restart: always
hostname: nextcloud.mydomain.de
environment:
TZ: "Europe/Berlin"
POSTGRES_HOST: "nextcloudpostgres"
POSTGRES_DB: "nextcloud"
POSTGRES_USER: "nchubdbu"
POSTGRES_PASSWORD: "****"
# NEXTCLOUD_ADMIN_PASSWORD: "****"
# NEXTCLOUD_ADMIN_USER: "ncadmin"
NEXTCLOUD_TRUSTED_DOMAINS: "nextcloud.mydomain.de"
TRUSTED_PROXIES: "traefik"
OVERWRITEPROTOCOL: "https"
# NC_default_phone_region: "<EU>"
REDIS_HOST: "nextcloudredis"
REDIS_HOST_PASSWORD: "****"
networks:
- jarvis-proxy-network
volumes:
- nextcloudhub-data-volume:/var/www/html
depends_on:
- nextcloudpostgres
- nextcloudredis
volumes:
nextcloudhub-data-volume:
external: true
nextcloudhub-postgres-volume:
external: true
nextcloudhub-redis-volume:
external: true
networks:
jarvis-proxy-network:
name: jarvis-proxy-network
- Als Datenbank möchte ich eine Postgres nutzen. Zwecks Verwendung von de_DE.utf8 habe ich hier nach Recherche ein eigenes Images erstellt.
- Redis als Memory Data Store find ich recht spannend, welches ich neben der eigentlichen Nextcloud HUB Instanz betreiben möchte
- Wie oben bereits geschrieben hĂ€ngt ein Traefik Proxy vor all meinen Services, so dass ich mittels verschiedenen Sub-Domains sauber via https (SSL Cert ĂŒber meine eigene Domain) auf die einzelnen Dienste zugreifen kann
Hier die Traefik Config, welche ich mir anhand der vorhandenen AIO Doku erstellt habe:
# DYNAMIC CONFIGURATION
#######################
http:
routers:
nextcloud:
service: nextcloud-service
entryPoints:
- websecure
# middlewares:
# - nextcloud-chain
rule: "Host(`nextcloud.mydomain.de`)"
tls:
options: default
...
traefik-dashboard:
service: api@internal
rule: "Host(`proxydashboard.mydomain.de`)"
tls:
options: default
...
middlewares:
nextcloud-secure-headers:
headers:
hostsProxyHeaders:
- "X-Forwarded-Host"
referrerPolicy: "same-origin"
customResponseHeaders:
X-Robots-Tag: "none"
https-redirect:
redirectscheme:
scheme: https
nextcloud-chain:
chain:
middlewares:
# - ... (e.g. rate limiting middleware)
- https-redirect
- nextcloud-secure-headers
services:
nextcloud-service:
loadBalancer:
servers:
- url: "http://nextcloudhub:80"
...
tls:
certificates:
- certFile: /etc/certs/live/mydomain.de/fullchain.pem
keyFile: /etc/certs/live/mydomain.de/privkey.pem
Beim erstmaligen Aufruf ĂŒber https://nextcloud.mydomain.de werde ich aufgefordert, ein Admin Account anzulegen. Nach dem Anlegen bleibt die UI auf der gleichen View und neben einem laufenden Spinner wird âInstalliereâŠâ angezeigt. Dies lĂ€uft nun eine kleine Weile.
Danach werde ich auf folgende Seite redirected: https://nextcloud.mydomain.de/login?redirect_url=/index.php/core/apps/recommended um mich anzumelden. HIer nutze ich nun das eben erstellte Admin Konto. Nach dem Klick auf Anmelden wird die Login View erneut geladen und soll mich wieder anmelden (SCHLEIFE / PROBLEM).
Die Web-Console liefert mir lediglich:
JQMIGRATE: Migrate is installed, version 3.4.1
index.es.js:2337 Proxying an event bus of version 3.0.2 with 1.3.0
e @ index.es.js:2337
68668 @ index.es.js:3314
a @ bootstrap:19
46631 @ requesttoken.js:11
a @ bootstrap:19
44332 @ index.js:25
a @ bootstrap:19
4820 @ index.js:14
a @ bootstrap:19
22152 @ PasswordLessLoginForm.vue:1
a @ bootstrap:19
(anonymous) @ startup:4
a.O @ chunk loaded:25
(anonymous) @ startup:5
(anonymous) @ startup:5
session-heartbeat.js:103 session heartbeat polling started
Via Network Tab lassen sich auch keine FAIL Calls feststellen. Es startet mit einem:
-
https://nextcloud.mydomain.de/login (POST)
â Status Code: 303 -
https://nextcloud.mydomain.de/login?redirect_url=/index.php/core/apps/recommended&direct=1&user=ncadmin (GET)
â Status Code: 200
Im Nextcloud-HUB Server Log finde ich lediglich Folgendes:
127.0.0.1 - - [21/Aug/2023:23:23:12 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:13 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:14 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:15 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:16 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:17 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:18 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:19 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:20 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:21 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:22 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:23 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:24 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:25 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:26 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:27 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:28 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:29 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:30 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:31 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:32 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:33 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:34 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:35 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:36 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:37 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:38 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:39 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:40 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:41 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
127.0.0.1 - - [21/Aug/2023:23:23:42 +0200] "OPTIONS * HTTP/1.0" 200 126 "-" "Apache/2.4.57 (Debian) PHP/8.2.8 (internal dummy connection)"
172.29.4.2 - - [21/Aug/2023:23:24:53 +0200] "POST /login HTTP/1.1" 303 1401 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203"
172.29.4.2 - - [21/Aug/2023:23:24:53 +0200] "GET /login?redirect_url=/index.php/core/apps/recommended&direct=1&user=ncadmin HTTP/1.1" 200 5665 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203"
172.29.4.2 - - [21/Aug/2023:23:24:53 +0200] "GET /core/js/oc.js?v=429cbcac HTTP/1.1" 200 2178 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203"
172.29.4.2 - - [21/Aug/2023:23:24:54 +0200] "GET /core/css/guest.css.map HTTP/1.1" 200 1642 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203"
172.29.4.2 - - [21/Aug/2023:23:24:54 +0200] "GET /core/css/server.css.map HTTP/1.1" 200 5497 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203"
172.29.4.2 - - [21/Aug/2023:23:24:55 +0200] "GET /cron.php HTTP/1.1" 200 750 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203"
Im DB-Server Log liegt Folgendes vor:
Die Dateien, die zu diesem Datenbanksystem gehören, werden dem Benutzer
»postgres« gehören. Diesem Benutzer muss auch der Serverprozess gehören.
Der Datenbankcluster wird mit der Locale »de_DE.utf8« initialisiert werden.
Die Standardtextsuchekonfiguration wird auf »german« gesetzt.
DatenseitenprĂŒfsummen sind ausgeschaltet.
berichtige Zugriffsrechte des bestehenden Verzeichnisses /var/lib/postgresql/data ... ok
erzeuge Unterverzeichnisse ... ok
wÀhle Implementierung von dynamischem Shared Memory ... posix
wĂ€hle Vorgabewert fĂŒr max_connections ... 100
wĂ€hle Vorgabewert fĂŒr shared_buffers ... 128MB
wĂ€hle Vorgabewert fĂŒr Zeitzone ... Europe/Berlin
erzeuge Konfigurationsdateien ... ok
fĂŒhre Bootstrap-Skript aus ... ok
fĂŒhre Post-Bootstrap-Initialisierung durch ... ok
synchronisiere Daten auf Festplatte ... ok
initdb: Warnung: Authentifizierung fĂŒr lokale Verbindungen auf »trust« gesetzt
initdb: Tipp: Sie können dies Àndern, indem Sie pg_hba.conf bearbeiten oder beim nÀchsten Aufruf von initdb die Option -A, oder --auth-local und --auth-host, verwenden.
Erfolg. Sie können den Datenbankserver jetzt mit
pg_ctl -D /var/lib/postgresql/data -l logdatei start
starten.
warte auf Start des Servers....2023-08-21 22:54:25.281 CEST [48] LOG: PostgreSQL 15.3 (Debian 15.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit startet
2023-08-21 22:54:25.320 CEST [48] LOG: erwarte Verbindungen auf Unix-Socket »/var/run/postgresql/.s.PGSQL.5432«
2023-08-21 22:54:25.427 CEST [51] LOG: Datenbanksystem wurde am 2023-08-21 22:54:22 CEST heruntergefahren
2023-08-21 22:54:25.509 CEST [48] LOG: Datenbanksystem ist bereit, um Verbindungen anzunehmen
fertig
Server gestartet
CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
warte auf Herunterfahren des Servers....2023-08-21 22:54:27.495 CEST [48] LOG: schnelles Herunterfahren verlangt
2023-08-21 22:54:27.796 CEST [48] LOG: etwaige aktive Transaktionen werden abgebrochen
2023-08-21 22:54:27.809 CEST [48] LOG: Background-Worker »logical replication launcher« (PID 54) beendete mit Status 1
2023-08-21 22:54:27.809 CEST [49] LOG: fahre herunter
2023-08-21 22:54:28.193 CEST [49] LOG: Checkpoint beginnt: shutdown immediate
......2023-08-21 22:54:34.428 CEST [49] LOG: Checkpoint komplett: 918 Puffer geschrieben (5.6%); 0 WAL-Datei(en) hinzugefĂŒgt, 0 entfernt, 0 wiederverwendet; Schreiben=2,172 s, Sync=2,176 s, gesamt=6,618 s; sync. Dateien=250, lĂ€ngste=1,182 s, Durchschnitt=0.009 s; Entfernung=4224 kB, SchĂ€tzung=4224 kB
2023-08-21 22:54:34.437 CEST [48] LOG: Datenbanksystem ist heruntergefahren
fertig
Server angehalten
PostgreSQL init process complete; ready for start up.
2023-08-21 22:54:34.627 CEST [1] LOG: PostgreSQL 15.3 (Debian 15.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit startet
2023-08-21 22:54:34.628 CEST [1] LOG: erwarte Verbindungen auf IPv4-Adresse »0.0.0.0«, Port 5432
2023-08-21 22:54:34.628 CEST [1] LOG: erwarte Verbindungen auf IPv6-Adresse »::«, Port 5432
2023-08-21 22:54:34.707 CEST [1] LOG: erwarte Verbindungen auf Unix-Socket »/var/run/postgresql/.s.PGSQL.5432«
2023-08-21 22:54:34.778 CEST [64] LOG: Datenbanksystem wurde am 2023-08-21 22:54:34 CEST heruntergefahren
2023-08-21 22:54:34.824 CEST [1] LOG: Datenbanksystem ist bereit, um Verbindungen anzunehmen
2023-08-21 22:59:34.877 CEST [62] LOG: Checkpoint beginnt: time
2023-08-21 22:59:37.093 CEST [62] LOG: Checkpoint komplett: 22 Puffer geschrieben (0.1%); 0 WAL-Datei(en) hinzugefĂŒgt, 0 entfernt, 0 wiederverwendet; Schreiben=1,973 s, Sync=0,053 s, gesamt=2,216 s; sync. Dateien=11, lĂ€ngste=0,051 s, Durchschnitt=0.005 s; Entfernung=36 kB, SchĂ€tzung=36 kB
2023-08-21 23:23:12.154 CEST [147] FEHLER: doppelter SchlĂŒsselwert verletzt Unique-Constraint »fs_storage_path_hash«
2023-08-21 23:23:12.154 CEST [147] DETAIL: SchlĂŒssel »(storage, path_hash)=(2, 328b8cd02585429e3b991d31959a0799)« existiert bereits.
2023-08-21 23:23:12.154 CEST [147] ANWEISUNG: INSERT INTO "oc_filecache" ("mimepart", "mimetype", "mtime", "size", "etag", "storage_mtime", "permissions", "name", "parent", "checksum", "path_hash", "path", "storage") VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
2023-08-21 23:24:34.585 CEST [62] LOG: Checkpoint beginnt: time
2023-08-21 23:25:32.800 CEST [62] LOG: Checkpoint komplett: 573 Puffer geschrieben (3.5%); 1 WAL-Datei(en) hinzugefĂŒgt, 0 entfernt, 0 wiederverwendet; Schreiben=57,708 s, Sync=0,142 s, gesamt=58,215 s; sync. Dateien=243, lĂ€ngste=0,055 s, Durchschnitt=0.001 s; Entfernung=3591 kB, SchĂ€tzung=3591 kB
Hier gibt es den Fehler: âFEHLER: doppelter SchlĂŒsselwert verletzt Unique-Constraintâ.
Der VollstÀndigkeit Halber hier das REDIS Log:
9:C 21 Aug 2023 20:54:20.433 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9:C 21 Aug 2023 20:54:20.433 # Redis version=7.0.12, bits=64, commit=00000000, modified=0, pid=9, just started
9:C 21 Aug 2023 20:54:20.433 # Configuration loaded
9:M 21 Aug 2023 20:54:20.434 * monotonic clock: POSIX clock_gettime
9:M 21 Aug 2023 20:54:20.435 * Running mode=standalone, port=6379.
9:M 21 Aug 2023 20:54:20.435 # Server initialized
9:M 21 Aug 2023 20:54:20.435 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
9:M 21 Aug 2023 20:54:20.436 * Ready to accept connections
Um AuszuschlieĂen, ob es etwas mit dem Proxy zu tun hat, habe ich den 80ziger Port direkt nach AuĂen freigegeben (1234:80) und nach Löschen der Volumes es erneut probiert. Es bleibt aber beim Gleichen.
Hat hier jemand eine Idee zu, woran es hÀngt?
Ich bin gespannt.