Thanks @voyzark,
]]>The example docker-compose.yml uses a bind mount for the MariaDB data directory:
services:
mariadb:
volumes:
# You generally only ever need to map this one volume.
# This maps it to a "bookstack_db_data" folder in the same
# directory as this compose config file.
- ./bookstack_db_data:/config
On Windows, this bind-mount path resolves to a case-insensitive filesystem (NTFS). MariaDB detects this at startup and automatically forces lower_case_table_names=2, logging:
[Warning] Setting lower_case_table_names=2 because file system for /config/databases/ is case insensitive
This cannot be overridden via my.cnf — MariaDB ignores the setting when its filesystem detection takes precedence.
lower_case_table_names=2 is a partially broken mode. InnoDB's TRUNCATE TABLE implementation internally tries to rename the .ibd tablespace file, which fails under this mode, producing:
[ERROR] InnoDB: Cannot rename './bookstack/joint_permissions.ibd' to
'./bookstack/#sql-ib70.ibd' because the source file does not exist.
This causes BookStack's migration 2023_01_24_104625_refactor_joint_permissions_storage to fail with:
SQLSTATE[HY000]: General error: 1030 Got error 194 "Tablespace is missing for a table"
SQL: truncate table `joint_permissions`
BookStack becomes unreachable on every fresh install on Windows. The error is not obvious — the containers appear to start successfully. Only after the first login you will see an "Unknown Error" page.
Replace the MariaDB bind mount with a named Docker volume. Docker named volumes reside on the Linux VM filesystem inside Docker Desktop's WSL2 backend, which is case-sensitive. MariaDB initialises correctly and migrations complete without error.
services:
mariadb:
volumes:
- bookstack_db_data:/config # named volume, not a host path
volumes:
bookstack_db_data:
Add a callout/warning in the comments along the lines of:
Windows users: Do not bind-mount the MariaDB data directory to a Windows host path (e.g.
./bookstack_db_data:/config). Use a named Docker volume instead. Bind-mounting to a Windows filesystem forces MariaDB intolower_case_table_names=2mode, which causes InnoDB errors and breaks database migrations.
| Component | Version |
|---|---|
| Host OS | Windows 25H2 (Build 26200.8037) |
| Docker Engine | 29.2.1 |
lscr.io/linuxserver/bookstack |
26.03.3 |
lscr.io/linuxserver/mariadb |
11.4.9 |
]]>AI Disclaimer: The analysis and description of this issue were developed with the assistance of an AI tool (GitHub Copilot). However, the issue itself is real and was encountered and verified by me on an actual Windows installation. The root cause, error messages, and fix have all been confirmed through hands-on testing.
For #47
]]>Found this
]]>I could try it that way, although I did already try to delete only the bookstack container and volume dir, and then re-run docker-compose up -d. had the same error occur again.
Hi @OscarLundberg,
]]>i've been trying to get the docker-compose example running, but for whatever reason i can't get it to work.
https://codeberg.org/bookstack/devops/src/branch/main/config/lsio-docker/docker-compose.yml
I followed the link on https://www.bookstackapp.com/docs/admin/installation/ which led me here.
here are the steps i followed
mkdir bookstack_db_data and mkdir bookstack_app_datadocker-compose.yml as linked aboveAPP_KEY with the output from the command docker run -it --rm --entrypoint /bin/bash lscr.io/linuxserver/bookstack:latest appkeydocker-compose up -dresulting error (logs from bookstack container)
SQLSTATE[HY000] [2002] Operation timed out (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`)
at /app/www/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
821▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
822▕ );
823▕ }
824▕
➜ 825▕ throw new QueryException(
826▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
827▕ );
828▕ }
829▕ }
+38 vendor frames
39 /app/www/artisan:35
Illuminate\Foundation\Console\Kernel::handle()
No visible errors from mariadb.
Not sure if i'm missing anything but I would expect the example to work as-is.
using synology dsm fwiw
Okay, thanks for responding.
I'll therefore close this off since re-running the script worked okay, but I'll keep this in mind if I get further reports, or if there's specific errors to address.
]]>Hi Dan,
The failure occurred when installing on Ubuntu Server 24.04.3 VM. It failed starting the mysql service and the script stopped. It complained the mysql.service did not exist. I tried to recreate it to get you an install log, but for some reason in the new VM the script ran correctly, so I am not sure what the original issue was.
I also had issues with DOMAIN=$1 which also caused it to error out. I cannot remember what the error was though.
]]>