Skip to content
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

Changing the DB username and password makes container continuously restart #494

Open
dac1976 opened this issue Nov 22, 2024 · 0 comments
Open

Comments

@dac1976
Copy link

dac1976 commented Nov 22, 2024

Using the 10.15 docker image and I can successfully edit the docker-compose.yml to set a custom admin user and password for owncloud server this works and I can access owncloud through a browser.

I tried to do the same sort for the DB elements so that I had stronger passwords and not use the default user name in the example yml file. But when I do this and try and start a brand new container, having remvoed all traces of any previous versions, the containers start up for the DB, Redis and owncloud but the owncloud server container keeps restarting every few seconds.

I see the following error in the log.

An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'hgl'@'172.18.0.4' (using password: YES) in /var/www/owncloud/lib/private/DB/Connection.php:62

Here is the yml file I was using with my alterations (I am using a .env file as well)

volumes:
files:
driver: local
mysql:
driver: local
redis:
driver: local

services:
owncloud:
image: owncloud/server:${OWNCLOUD_VERSION} # by default we were 10.15
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=${DB_NAME} # Default is owncloud
- OWNCLOUD_DB_USERNAME=${DB_USERNAME}
- OWNCLOUD_DB_PASSWORD=${DB_PASSWORD}
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
- OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
- 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:
- files:/mnt/data

mariadb:
image: mariadb:${MARIADB_VERSION} # minimum required ownCloud version is 10.9, we had 10.11 by default
container_name: owncloud_mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_USER=${DB_USERNAME}
- MYSQL_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
- MARIADB_AUTO_UPGRADE=1
command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=${DB_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- mysql:/var/lib/mysql

redis:
image: redis:${REDIS_VERSION} # by default version 6
container_name: owncloud_redis
restart: always
command: ["--databases", "1"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- redis:/data

And here is my redacted .env file:

OWNCLOUD_VERSION=10.15
OWNCLOUD_DOMAIN=XXXXX
OWNCLOUD_TRUSTED_DOMAINS=XXXXX,YYYYY
DB_NAME=owncloud
DB_USERNAME=xxx
DB_PASSWORD=yyyyyyyyyy
DB_ROOT_PASSWORD=zzzzzzzzzz
ADMIN_USERNAME=tttt
ADMIN_PASSWORD=wwwwwwwwww
HTTP_PORT=8189
MARIADB_VERSION=10.11
REDIS_VERSION=6

@dac1976 dac1976 changed the title Changing the DB username and password makes continer continuously restart Changing the DB username and password makes container continuously restart Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant