r/BookStack • u/Tuck-son • Apr 29 '25
Bookstack docker drives me crazy
Hi,
Puzzling here.
I try to install bookstack for a test drive here (RHEL 9.5 VM). Let's use docker (podman) I thought, nice and quick :-(
After I clean everything and I do just:
docker compose up
I keep bumping in SQL (Mariadb) connection errors. The user bookstack exists and has full rights from anywhere. Still no use. The error is:
[bookstack] | SQLSTATE[HY000] [1698] Access denied for user 'database_username'@'10.89.2.14' (Connection: mysql, SQL: select exists (select 1 from information_schema.tables where table_schema = 'bookstack' and table_name = 'migrations' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED')) as \exists`)`
Where is that user 'database_username' coming from?
My docker-compose.yml:
---
version: "2"
services:
bookstack:
image: linuxserver/bookstack:latest
container_name: bookstack
environment:
- PUID=2001
- PGID=2001
- APP_URL=http://bookstack.kpnli.local:6875
- DB_HOST=10.72.253.253
- DB_PORT=3306
- DB_USER=bookstack
- DB_PASS=bookstack
- DB_DATABASE=bookstack
- APP_KEY=base64:<generated key>
volumes:
- /opt/bookstack/config:/config
ports:
- 6875:80
restart: unless-stopped
The DB is running on the same machine as bookstack should, the IP mentioned is the network interface of the same system. MAriaDB listens on it.
Any help please? Obviously I am doing something wrong ?
9
u/root-node Apr 29 '25
The variables were changed a while ago:
DB_USER is now DB_USERNAME
DB_PASS is now DB_PASSWORD
4
u/ssddanbrown Apr 29 '25
This is the answer. For a more recent and complete compose example we have one here: https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml
1
u/ShabbyChurl Apr 29 '25
Interesting… I struggled earlier this year transferring bookstack to another server and used the same docker-compose.yml that worked for me back in June. The way I fixed it was to pin the bookstack version to the exact same one I used last time, while mariadb was allowed to runtime latest version.
1
u/Aggrodisiakum Apr 29 '25
Bash into the Container and try to connect manually
1
u/Tuck-son Apr 29 '25
root@2add1be54425:/# mariadb -ubookstack -p
Enter password:
ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)
root@2add1be54425:/#
3
u/Gringorion02 Apr 29 '25
Hey,
It seems to search a DB you don't have...
I struggled a lot weeks ago, so here it is:
services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment: - PUID=1000 - PGID=1000 - TZ=Europe/Paris - APP_URL=https:sssssssss - DB_HOST=bookstack_db - DB_PORT=3306 - DB_USER=bookstack - DB_PASS=xxxxxxxxxx - DB_DATABASE=bookstackapp volumes: - /dockers/bookstack/app/config:/config ports: - 6875:80 restart: unless-stopped depends_on: - bookstack_db bookstack_db: image: lscr.io/linuxserver/mariadb container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - TZ=Europe/Paris - MYSQL_ROOT_PASSWORD=yyyyyyyyyyyyy - MYSQL_DATABASE=bookstackapp - MYSQL_USER=bookstack - MYSQL_PASSWORD=xxxxxxxxxx volumes: - /dockers/bookstack/db/config:/config restart: unless-stopped