Closed irslon closed 2 years ago
It this consistent? What occurs on restart of the containers?
It this consistent? What occurs on restart of the containers?
Yes, it is consistent. After restart of containers, bookstack tries to retry the missing migrations without any success.
Starting bookstack_db ... done
Starting bookstack ... done
Attaching to bookstack_db, bookstack
bookstack_db | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
bookstack_db | [s6-init] ensuring user provided files have correct perms...exited 0.
bookstack_db | [fix-attrs.d] applying ownership & permissions fixes...
bookstack_db | [fix-attrs.d] done.
bookstack_db | [cont-init.d] executing container initialization scripts...
bookstack_db | [cont-init.d] 01-envfile: executing...
bookstack_db | [cont-init.d] 01-envfile: exited 0.
bookstack_db | [cont-init.d] 02-tamper-check: executing...
bookstack_db | [cont-init.d] 02-tamper-check: exited 0.
bookstack_db | [cont-init.d] 10-adduser: executing...
bookstack_db | usermod: no changes
bookstack_db |
bookstack_db | -------------------------------------
bookstack_db | _ ()
bookstack_db | | | ___ _ __
bookstack_db | | | / __| | | / \
bookstack_db | | | \__ \ | | | () |
bookstack_db | |_| |___/ |_| \__/
bookstack_db |
bookstack_db |
bookstack_db | Brought to you by linuxserver.io
bookstack_db | -------------------------------------
bookstack_db |
bookstack_db | To support LSIO projects visit:
bookstack_db | https://www.linuxserver.io/donate/
bookstack_db | -------------------------------------
bookstack_db | GID/UID
bookstack_db | -------------------------------------
bookstack_db |
bookstack_db | User uid: 1000
bookstack_db | User gid: 1000
bookstack_db | -------------------------------------
bookstack_db |
bookstack_db | [cont-init.d] 10-adduser: exited 0.
bookstack_db | [cont-init.d] 30-config: executing...
bookstack_db | [cont-init.d] 30-config: exited 0.
bookstack_db | [cont-init.d] 40-initialise-db: executing...
bookstack_db | [cont-init.d] 40-initialise-db: exited 0.
bookstack_db | [cont-init.d] 90-custom-folders: executing...
bookstack_db | [cont-init.d] 90-custom-folders: exited 0.
bookstack_db | [cont-init.d] 99-custom-files: executing...
bookstack_db | [custom-init] no custom files found exiting...
bookstack_db | [cont-init.d] 99-custom-files: exited 0.
bookstack_db | [cont-init.d] done.
bookstack_db | [services.d] starting services
bookstack_db | [services.d] done.
bookstack_db | 220613 20:11:08 mysqld_safe Logging to '/config/databases/182390000fb5.err'.
bookstack_db | 220613 20:11:08 mysqld_safe Starting mariadbd daemon with databases from /config/databases
bookstack | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
bookstack | [s6-init] ensuring user provided files have correct perms...exited 0.
bookstack | [fix-attrs.d] applying ownership & permissions fixes...
bookstack | [fix-attrs.d] done.
bookstack | [cont-init.d] executing container initialization scripts...
bookstack | [cont-init.d] 01-envfile: executing...
bookstack | [cont-init.d] 01-envfile: exited 0.
bookstack | [cont-init.d] 02-tamper-check: executing...
bookstack | [cont-init.d] 02-tamper-check: exited 0.
bookstack | [cont-init.d] 10-adduser: executing...
bookstack | usermod: no changes
bookstack |
bookstack | -------------------------------------
bookstack | _ ()
bookstack | | | ___ _ __
bookstack | | | / __| | | / \
bookstack | | | \__ \ | | | () |
bookstack | |_| |___/ |_| \__/
bookstack |
bookstack |
bookstack | Brought to you by linuxserver.io
bookstack | -------------------------------------
bookstack |
bookstack | To support LSIO projects visit:
bookstack | https://www.linuxserver.io/donate/
bookstack | -------------------------------------
bookstack | GID/UID
bookstack | -------------------------------------
bookstack |
bookstack | User uid: 1000
bookstack | User gid: 1000
bookstack | -------------------------------------
bookstack |
bookstack | [cont-init.d] 10-adduser: exited 0.
bookstack | [cont-init.d] 20-config: executing...
bookstack | [cont-init.d] 20-config: exited 0.
bookstack | [cont-init.d] 30-keygen: executing...
bookstack | using keys found in /config/keys
bookstack | [cont-init.d] 30-keygen: exited 0.
bookstack | [cont-init.d] 50-config: executing...
bookstack | App Key found - setting variable for seds
bookstack | Running config - db_user set
bookstack | **** Docker env var APP_URL is not set, setting it to http://37.190.246.141:6875 ****
bookstack | /var/run/s6/etc/cont-init.d/50-config: line 98: warning: command substitution: ignored null byte in input
bookstack | /var/run/s6/etc/cont-init.d/50-config: line 98: warning: command substitution: ignored null byte in input
bookstack | Migrating: 2019_07_07_112515_add_template_support
bookstack |
bookstack | Illuminate\Database\QueryException
bookstack |
bookstack | SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'template' (SQL: alter table `pages` add `template` tinyint(1) not null default '0')
bookstack |
bookstack | at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
bookstack | 708▕ // If an exception occurs when attempting to run a query, we'll format the error
bookstack | 709▕ // message to include the bindings with SQL, which will make this exception a
bookstack | 710▕ // lot more helpful to the developer instead of just the database's errors.
bookstack | 711▕ catch (Exception $e) {
bookstack | ➜ 712▕ throw new QueryException(
bookstack | 713▕ $query, $this->prepareBindings($bindings), $e
bookstack | 714▕ );
bookstack | 715▕ }
bookstack | 716▕ }
bookstack |
bookstack | +9 vendor frames
bookstack | 10 /var/www/html/database/migrations/2019_07_07_112515_add_template_support.php:20
bookstack | Illuminate\Support\Facades\Facade::__callStatic()
bookstack |
bookstack | +22 vendor frames
bookstack | 33 /var/www/html/artisan:37
bookstack | Illuminate\Foundation\Console\Kernel::handle()
bookstack | [cont-init.d] 50-config: exited 0.
bookstack | [cont-init.d] 90-custom-folders: executing...
bookstack | [cont-init.d] 90-custom-folders: exited 0.
bookstack | [cont-init.d] 99-custom-files: executing...
bookstack | [custom-init] no custom files found exiting...
bookstack | [cont-init.d] 99-custom-files: exited 0.
bookstack | [cont-init.d] done.
bookstack | [services.d] starting services
bookstack | [services.d] done.
I've not been able to replicate this with either a new container or upgrading an existing one on a Linux host but a couple of people have reported the same issue specifically on Windows.
I've not been able to replicate this with either a new container or upgrading an existing one on a Linux host but a couple of people have reported the same issue specifically on Windows.
You are correct. After using the same config on linux host the problem disappears.
I just tried to spin up the example Docker compose file on top of Docker Desktop for Windows, got the exact same result. Migration failure with the exact same stack trace. Have yet to find a workaround.
I'd very roughly guess there's potentially an issue with the filesystem not keeping up with DB changes.
I'd very roughly guess there's potentially an issue with the filesystem not keeping up with DB changes.
* Does it work if you don't mount any volumes for the DB container?
Your guess is right. Mounting the Windows directory to a volume breaks the migration. When I use internal docker volume with default driver it works flawlessly on Windows.
Working example configuration for Windows:
---
version: "2"
services:
bookstack:
image: lscr.io/linuxserver/bookstack
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=
- DB_HOST=bookstack_db
- DB_USER=bookstack
- DB_PASS=bookstack
- DB_DATABASE=bookstackapp
volumes:
- bookstackdata:/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
- MYSQL_ROOT_PASSWORD=bookstackroot
- TZ=Europe/Warsaw
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=bookstack
volumes:
- bookstackdbdata:/config
ports:
- 13306:3306
restart: unless-stopped
volumes:
bookstackdata:
bookstackdbdata:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I would like to close this issue because of the working workaround provided by @ssddanbrown
I also have this issue and the workaround does make the app functional for me. It's not ideal but it's not Bookstack's fault.
I would also like to point out that it's also not an issue with our container. Its going to be now docker works on windows and we do not test our containers on windows.
I have a same problem.
I finally got around the problem by using mysql instead of marinadb.
My compose.yml
which I success to launch is below.
services:
bookstack:
image: lscr.io/linuxserver/bookstack:23.02.2
container_name: bookstack
environment:
- PUID=1000
- PGID=1000
- APP_URL=http://192.168.0.220:6875
- APP_DEBUG=true
- APP_LANG=ja
- STORAGE_TYPE=local
- DB_HOST=bookstack_db
- DB_PORT=3306
- DB_USER=bookstack
- DB_PASSWORD=12345678
- DB_DATABASE=bookstackapp
volumes:
- ./bookstackdata:/config
ports:
- 6875:80
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
#image: mariadb:10.6.12
image: mysql:8.0.32
container_name: bookstack_db
ports:
- 3306:3306
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=password
- TZ=Asia/Tokyo
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=12345678
- TERM=dumb
volumes:
- ./bookstackdbdata:/config
- ./db-store:/var/lib/mysql
restart: unless-stopped
Thank you.
This issue is locked due to inactivity
Expected Behavior
Bookstack should start on a clean environment.
Current Behavior
Bookstack fails to run migrations, and thus fails to start the application.
Steps to Reproduce
Environment
OS: Windows 11 CPU architecture: x86_64 How docker service was installed: Docker Desktop
Command used to create docker container (run/create/compose/screenshot)
compose as seen above.
Docker logs