Steps to reproduce
- New install on a remote Debian 10 host
- Using docker-compose from the official doc or using a standalone docker install
- Bring up the stack first time and everything works fine, reboot and owncloud logs complain of βThe username is already being usedβ and refuses to start (Duplicate of this issue 104 in GitHub for own cloud-docker).
- I can get it to start by logging into the MariaDB container and dropping the owncloud database
- I was suspecting that I was not linking the volumes from your container to the host properly. I tried with volume as well as the bind mount with the same result.
Observations
- The official docs talk about mapping /mnt/data from the container to the local host. When doing that the following 4 folder are mapped to the local host
drwxr-xr-x 2 www-data root 4096 Feb 19 12:50 apps
drwxr-xr-x 2 www-data root 4096 Feb 19 12:50 config
drwxrwx--- 4 www-data root 4096 Feb 19 13:07 files
drwxr-xr-x 2 www-data root 4096 Feb 19 12:52 sessions
The config folder has the following 2 files
-rw-r--r-- 1 www-data root 1038 Feb 19 12:50 objectstore.config.php
-rw-r--r-- 1 www-data root 18749 Feb 19 12:51 overwrite.config.php
What I canβt understand is why is config.php not being mapped to the local host ? I think it is because of this that every time the container restarts it looses its state and wants to create the DB again and therefore throws up the error. The user data on the other hand is persisting across reboots and behaving normally.
I tried doing a standalone install (without docker-compose) with the same result. The config.php is only on the container and not mapped to the local host. Every reboot I have to edit it to add the trusted_domains.
Anyone has any clues ?
Note:
Below docker-compose shows bind mounts, I am getting the same result for volumes also.
version: "3.6"
services:
owncloud:
image: owncloud/server:${OWNCLOUD_VERSION}
container_name: owncloud_server
restart: always
ports:
- ${HTTP_PORT}:8080
depends_on:
- mariadb
- redis
environment:
- OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
- OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_TRUSTED_DOMAINS}
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=owncloud
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- type: bind
source: /mnt/oc
target: /mnt/data
mariadb:
image: mariadb:10.6 # minimum required ownCloud version is 10.9
container_name: owncloud_mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=owncloud
- MYSQL_USER=owncloud
- MYSQL_PASSWORD=owncloud
- MYSQL_DATABASE=owncloud
command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- type: bind
source: /mnt/mariadb
target: /var/lib/mysql
redis:
image: redis:6
container_name: owncloud_redis
restart: always
command: ["--databases", "1"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- type: bind
source: /mnt/redis
target: /data
Server configuration
Debian 10 LXC on a promox machine. The container is running in privellaged mode with nesting on.
Database:
MariaDB10.6
ownCloud version: (see ownCloud admin page)
owncloud/server:latest 10.11
Updated from an older ownCloud or fresh install:
Fresh Install
Where did you install ownCloud from:
Official docs for docker-compose