Hello everyone,
I’m currently working on my own AIO, with only what I want in it.
For that I’m using a compose file with my microservices in it
But I got the same error for the automatic installation…
There is the current state (I still have a lot to do in it)
#######################################
## Nextcloud - Self Hosted Cloud ##
#######################################
---
services:
nextcloud_db:
image: mariadb:10.11
container_name: nextcloud_db
restart: unless-stopped
command: [
"--transaction-isolation=READ-COMMITTED",
"--binlog-format=ROW"
]
env_file: .env
environment:
- MARIADB_RANDOM_ROOT_PASSWORD=true
volumes:
- ${DB_DATA_PATH}:/var/lib/mysql
networks:
- default
nextcloud_redis:
image: redis:latest
container_name: nextcloud_redis
restart: unless-stopped
env_file: .env
volumes:
- ${REDIS_CACHE_PATH}:/data:rw
networks:
- default
sysctls:
- net.core.somaxconn=511
nextcloud:
image: nextcloud:latest
container_name: nextcloud
restart: unless-stopped
env_file: .env
volumes:
- ${NEXTCLOUD_STORAGE_PATH}:/var/www/html/data
- ./config/hooks:/docker-entrypoint-hooks.d:ro
depends_on:
- nextcloud_db
- nextcloud_redis
networks:
- default
environment:
- NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_PUBLIC_DOMAIN} localhost
hostname: ${NEXTCLOUD_PUBLIC_DOMAIN}
ports:
- 127.0.0.1:50090:80
nextcloud_collabora:
image: collabora/code:latest
container_name: nextcloud_collabora
restart: unless-stopped
env_file: .env
environment:
- domain=${NEXTCLOUD_PUBLIC_DOMAIN}
- extra_params=--o:ssl.enable=true
networks:
- default
ports:
- 127.0.0.1:50091:9980
nextcloud_imaginary:
image: h2non/imaginary:latest
container_name: nextcloud_imaginary
restart: unless-stopped
env_file: .env
command: -enable-url-source
cap_add:
- SYS_NICE
networks:
- default
networks:
default:
I just have a hook to ensure the DB is ready before the automatic installation (In the hook pre-installation)
#!/bin/sh
echo "Waiting for database..."
until php -r '
try {
$dsn = sprintf("mysql:host=%s;port=%d", getenv("MYSQL_HOST") ?: "127.0.0.1", getenv("MYSQL_PORT") ?: 3306);
new PDO($dsn, getenv("MYSQL_USER"), getenv("MYSQL_PASSWORD"), [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
exit(0);
} catch (PDOException $e) {
exit(1);
}
' >/dev/null 2>&1; do
echo "Database not ready, retrying in 5 secondes..."
sleep 5
done
echo "Database connection successful."
The problem is, when I add these vars in my .env (to allow the automatic installation)
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=Z!zeg6EPZz+6A3-VN
There is my .env for example (its a test env, so np for the pass)
# MISCS
TZ=Europe/Paris
PUID=983
PGID=983
# Data Binding
DB_DATA_PATH=./data/db
REDIS_CACHE_PATH=./data/cache
NEXTCLOUD_STORAGE_PATH=./data/nextcloud
# Service Binding
MYSQL_HOST=nextcloud_db
REDIS_HOST=nextcloud_redis
IMAGINARY_HOST=http://nextcloud_imaginary:8088
# Database
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
MYSQL_PASSWORD=-df+!3ty+erd-dfVKz
# Nextcloud
NEXTCLOUD_PUBLIC_DOMAIN=cloud.xxxxx.tld
NEXTCLOUD_ADMIN_USER=admin
NEXTCLOUD_ADMIN_PASSWORD=Z!zeg6EPZz+6A3-VN
PHP_MEMORY_LIMIT=1G
PHP_UPLOAD_LIMIT=10G
TRUSTED_PROXIES=0.0.0.0/0
I got this kind of error during the installation (for information, I got the same error without my hook)
[root@rhel-01 nextcloud]# docker logs nextcloud -f
Configuring Redis as session handler
Initializing nextcloud 31.0.4.1 ...
New nextcloud instance
Installing with MySQL database
=> Searching for hook scripts (*.sh) to run, located in the folder "/docker-entrypoint-hooks.d/pre-installation"
==> Running the script (cwd: /var/www/html): "/docker-entrypoint-hooks.d/pre-installation/00-wait-db.sh"
Waiting for database...
Database not ready, retrying in 5 secondes...
Database not ready, retrying in 5 secondes...
Database not ready, retrying in 5 secondes...
Database connection successful.
==> Finished executing the script: "/docker-entrypoint-hooks.d/pre-installation/00-wait-db.sh"
=> Completed executing scripts in the "pre-installation" folder
Starting nextcloud installation
The "-d" option does not exist.
maintenance:install [--database DATABASE] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-port DATABASE
-PORT] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-space [DATABASE-TABLE-SPACE]] [--admin-u
ser ADMIN-USER] [--admin-pass ADMIN-PASS] [--admin-email [ADMIN-EMAIL]] [--data-dir DATA-DIR]
Retrying install...
The "-d" option does not exist.
maintenance:install [--database DATABASE] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-port DATABASE
-PORT] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-space [DATABASE-TABLE-SPACE]] [--admin-u
ser ADMIN-USER] [--admin-pass ADMIN-PASS] [--admin-email [ADMIN-EMAIL]] [--data-dir DATA-DIR]
Retrying install...
The "-d" option does not exist.
maintenance:install [--database DATABASE] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-port DATABASE
-PORT] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-space [DATABASE-TABLE-SPACE]] [--admin-u
ser ADMIN-USER] [--admin-pass ADMIN-PASS] [--admin-email [ADMIN-EMAIL]] [--data-dir DATA-DIR]
Retrying install...
Etc, until it display installation failed message...
If I restart the docker, the web page with the intaller will be available, so it’s just the automatic installation that get an error, have you already encounter this kind of things ?
I’ve tried a lot of things during the last 5 hours
Thank you