BookStackApp/BookStack

bookstack after upg doesn't work

balgerion opened this issue · 19 comments

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Good morning,

Yesterday my bookstack updated (it have latest tag on it)

Image
and i wake up with this: :)

Image

there is no error in logs and i dont see any braking changes on github notes.

Image

docker compose:

services:
bookstack:
image: linuxserver/bookstack:arm64v8-latest
deploy:
placement:
constraints:
- node.role == worker
environment:
- APP_DEBUG=true
- PUID=1001
- PGID=988
- DB_HOST=192.168.1.21
- DB_PORT=3306
- DB_DATABASE=bookstack
- DB_USERNAME=
- DB_PASSWORD=""
- APP_URL=https://wiki.balgeriada.com
- APP_KEY=
- CACHE_DRIVER=database
- SESSION_DRIVER=database
volumes:
- uploads:/var/www/bookstack/public/uploads
- storage:/var/www/bookstack/storage/uploads
ports:
- "8186:80"

volumes:
uploads:
driver_opts:
type: nfs
o: nfsvers=4.2,addr=192.168.1.21
device: ":/mnt/Balgeriada1/docker/app/bookstack/uploads"
storage:
driver_opts:
type: nfs
o: nfsvers=4.2,addr=192.168.1.21
device: ":/mnt/Balgeriada1/docker/app/bookstack/storage"

Exact BookStack Version

v24.12.1-ls189

Log Content

No response

Hosting Environment

Docker , docker swarm

Hi @balgerion,
Those are not the expected/intended volume mounts for that container image.

Before anything, be super careful about any changes you make. There's a high potential of data loss.
Backup any storage volumes involved, and maybe the running container data too if existing and/or snapshot/backup the host machine.

The linuxserver image manages things so there's only a single /config volume mount-point to use/manage.
Ideally you should switch over to following the expected convention for the image.
You may need to move existing data.
There's a location mapping in the readme of that container image: https://github.com/linuxserver/docker-bookstack?tab=readme-ov-file#bookstack-file--directory-paths

oohhh you are right but it was working for almost month without issue :). Changed to proper config and still have simillar error

Btw thank you for your help and time

Image

files in correct place:

Image

docker compose:
services:
bookstack:
image: linuxserver/bookstack:arm64v8-latest
deploy:
placement:
constraints:
- node.role == worker
environment:
- APP_DEBUG=true
- PUID=1001
- PGID=988
- DB_HOST=192.168.1.21
- DB_PORT=3306
- DB_DATABASE=bookstack
- DB_USERNAME=
- DB_PASSWORD=""
- APP_URL=https://wiki.balgeriada.com
- APP_KEY=
- CACHE_DRIVER=database
- SESSION_DRIVER=database
volumes:
- config:/config
ports:
- "8186:80"

volumes:
config:
driver_opts:
type: nfs
o: nfsvers=4.2,addr=192.168.1.21
device: ":/mnt/Balgeriada1/docker/app/bookstack/config"

Having the same problem here:

 bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      PUID: 1000
      PGID: 1000
      APP_URL: https://...
      DB_HOST: bookstack_db
      DB_PORT: 3306
      DB_USER: bookstack
      FILE__DB_PASS: /run/secrets/bookstack_db_pass
      DB_DATABASE: bookstackapp
    secrets:
      - bookstack_db_pass
    restart: unless-stopped
    volumes:
      - bookstack_app_data:/config
    networks:
      - bookstack
    depends_on:
      - bookstack_db

  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=/run/secrets/bookstack_db_pass
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=/run/secrets/bookstack_db_pass
    secrets:
      - bookstack_db_pass
    restart: unless-stopped
    volumes:
      - bookstack_db_data:/config
    networks:
      - bookstack

Found this in the container logs:

bookstack  | using keys found in /config/keys
bookstack  | **** The following active confs have different version dates than the samples that are shipped. ****
bookstack  | **** This may be due to user customization or an update to the samples. ****
bookstack  | **** You should compare the following files to the samples in the same folder and update them. ****
bookstack  | **** Use the link at the top of the file to view the changelog. ****
bookstack  | ┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
bookstack  | │  old date  │  new date  │ path                                                                   │
bookstack  | ├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
bookstack  | │ 2023-12-25 │ 2024-07-16 │ /config/nginx/site-confs/default.conf                                  │
bookstack  | │ 2023-04-13 │ 2024-12-17 │ /config/nginx/nginx.conf                                               │
bookstack  | │ 2023-08-13 │ 2024-12-06 │ /config/nginx/ssl.conf                                                 │
bookstack  | └────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
bookstack  | Waiting for DB to be available

But using the newer .conf files didn't change anything.
Found no errors in nginx or bookstack logs. How can I debug this?

I'll spin up a fresh stack myself to check it's not something baked into the image.

@tfeldmann Are you also running on ARM?

A fresh stack on standard x86_64 seems to work okay.

Full compose

---
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack:latest
    container_name: bookstack_20250121
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - APP_URL=http://localhost:6875
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USERNAME=bookstack
      - DB_PASSWORD=dbpass
      - DB_DATABASE=bookstackapp
      - APP_KEY=base64:HPTxCk+r+a8ly2S7tJG7ItNiJlJLr9mzT0t67FrcXIw=
    volumes:
      - ./bookstack_app_data:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
    

  bookstack_db:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: bookstack_db_20250121
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - MYSQL_ROOT_PASSWORD=dbpass
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=dbpass
    volumes:
      - ./bookstack_db_data:/config
    restart: unless-stopped

@balgerion Are you running docker on Windows? If so, is the Windows host also ARM? Just getting thrown off by the Windows screenshot, but not sure if you're just viewing a remote mounted folder or something.

On Linux - dietpiOS on radxa zero3 - I have ten of them running docker swarm for many apps.

I noticed I‘m missing an APP_KEY. Will try this out.

Doesn't work. How would you debug this? The docker logs look fine :/

bookstack  | [migrations] started
bookstack  | [env-init] Your secret: FILE__DB_PASS
bookstack  |            contains a trailing newline and may not work as expected
bookstack  | [migrations] 01-nginx-site-confs-default: skipped
bookstack  | [env-init] DB_PASS set from FILE__DB_PASS
bookstack  | [migrations] 02-default-location: skipped
bookstack  | [migrations] done
bookstack  | [env-init] Your secret: FILE__MAIL_PASSWORD
bookstack  |            contains a trailing newline and may not work as expected
bookstack  | [env-init] MAIL_PASSWORD set from FILE__MAIL_PASSWORD
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  | ───────────────────────────────────────
bookstack  | GID/UID
bookstack  | ───────────────────────────────────────
bookstack  |
bookstack  | User UID:    1000
bookstack  | User GID:    1000
bookstack  | ───────────────────────────────────────
bookstack  | Linuxserver.io version: v24.12.1-ls189
bookstack  | Build-date: 2025-01-21T02:42:43+00:00
bookstack  | ───────────────────────────────────────
bookstack  |
bookstack  | using keys found in /config/keys
bookstack  | **** The following site-confs have extensions other than .conf ****
bookstack  | **** This may be due to user customization. ****
bookstack  | **** You should review the files and rename them to use the .conf extension or remove them. ****
bookstack  | **** nginx.conf will only include site-confs with the .conf extension. ****
bookstack  | /config/nginx/site-confs/default.conf.bak
bookstack  | Waiting for DB to be available
bookstack  |
bookstack  |    INFO  Nothing to migrate.
bookstack  |
bookstack  | [custom-init] No custom files found, skipping...
bookstack  | [ls.io-init] done.

@tfeldmann Yeah, the logs will look fine for this.
I think I've seen this before in issues with specific write access, but the paths I'm thinking of should be in-container.
Are you also running on ARM?

I'd also be interested to know if everything works okay if you set the image & version to be lscr.io/linuxserver/bookstack:v24.12.1-ls187. That's their build from last week.

I'd also be interested to know if everything works okay if you set the image & version to be lscr.io/linuxserver/bookstack:v24.12.1-ls187. That's their build from last week.

Its working! almost shit my pants here :)

Image

I am also seeing this error on an ARM based machine and can confirm that moving to that build solved the issue for me as well.

Just now tested this tag is working fine for ARM64 : lscr.io/linuxserver/bookstack:v24.12.1-ls187. That means something is wrong with latest one linuxserver/bookstack:24.12.1 .

Okay, I've been doing a lot of testing on ARM.
It seems that this is at the PHP level of things in the container rather than in at the BookStack level, since I tracked down the exact logic to create a simplistic test case:

echo token_get_all('cat')[0][0] === T_INLINE_HTML ? 'pass' : 'fail';

This would then fail on the PHP CLI inside the container, but succeed in all other PHP environments I ran it in.
This reflected a fundamental issue in PHP tokenization for PHP in the container.

Despite the image project files reporting PHP 8.3.16 was in use, PHP 8.3.15 was reported within the container. That said, some packages do appear to be 8.3.16. I think these are ones installed specifically for the BookStack container upon base.

Either there's an issue in the alpine PHP 8.3.15 packages, or this was due to mixing PHP 8.3.15/8.3.16 packages within one installation (I suspect the latter) but I could not confirm this as I had trouble specifically installing PHP 8.3.15 alone within an alpine system.

Running apk upgrade within the container, and clearing cached view files, got things working again.

I'll gather my findings and report them to the linuxserver project to make them aware this issue exists so they can maybe plan/implement a solution.

Linuxserver team are now on it, fixed image now being built: linuxserver/docker-bookstack#260 (comment)

It's working again 👍 Thanks for the quick support!

No worries.

Thanks all for reporting/sharing details to help debug.
Since this has now been fixed elsewhere I'll go ahead and close this off.