mariadb creates a lot of error-files #5326

Closed
opened 2026-02-05 09:57:59 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @towerplease on GitHub (Jun 23, 2025).

Describe the Bug

Hi there,

i recently noticed, that the mariadb-container within the bookstack-docker-stack is producing *.err files.
The error seems to be inconsintent, as this does not appear every day.
Bookstack functions properly, as of now i cannot see any errors on the front end.

I use a docker compose stack, as of the multitple examples given.
The mariadb-database is bind-mounted to a local directory and i wondered why this is so big (>6 GB)
After investigating, i found some *.err files with some if them are bigger than 200 MB.
The error in there always repeats:
2025-06-23 15:32:12 953 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255). 2025-06-23 15:32:12 954 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').

My docker-compose file:

Details

---
services:
 bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    # Arbeitsspeicher limit
    mem_limit: 1g
    # Priorisierung - 1024 = Default
    cpu_shares: 1024
    environment:
    # Konfiguration über .env File in app_data/www/.env
      - PUID=1000
      - PGID=1000
      - APP_URL=https://sub.domain.tld
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=${MYSQL_PASSWORD}
      - DB_DATABASE=bookstackapp
    volumes:
      - /mnt/docker/volume/bookstack/app_data:/config
    ports:
      - 6875:80
    restart: unless-stopped
    depends_on:
      - bookstack_db
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
 bookstack_db:
    image: lscr.io/linuxserver/mariadb
    # Arbeitsspeicher limit
    mem_limit: 500m
    # Priorisierung - 1024 = Default
    cpu_shares: 1024
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    volumes:
      - /mnt/docker/volume/bookstack/db_data:/config
    restart: unless-stopped
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

it looks like this in the folder:

Image

Hopefully this help to resolve the issue.

Steps to Reproduce

deploy via docker compose
inspect maria-db folder after a while of use.

Expected Behaviour

No creation of such error files. Or alternativly rotating error-files.

Screenshots or Additional Context

No response

Browser Details

firefox/chrome

Exact BookStack Version

25.05.1

Originally created by @towerplease on GitHub (Jun 23, 2025). ### Describe the Bug Hi there, i recently noticed, that the mariadb-container within the bookstack-docker-stack is producing *.err files. The error seems to be inconsintent, as this does not appear every day. Bookstack functions properly, as of now i cannot see any errors on the front end. I use a docker compose stack, as of the multitple examples given. The mariadb-database is bind-mounted to a local directory and i wondered why this is so big (>6 GB) After investigating, i found some *.err files with some if them are bigger than 200 MB. The error in there always repeats: `2025-06-23 15:32:12 953 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255). 2025-06-23 15:32:12 954 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB').` My docker-compose file: <details><summary>Details</summary> <p> ```yml --- services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack # Arbeitsspeicher limit mem_limit: 1g # Priorisierung - 1024 = Default cpu_shares: 1024 environment: # Konfiguration über .env File in app_data/www/.env - PUID=1000 - PGID=1000 - APP_URL=https://sub.domain.tld - DB_HOST=bookstack_db - DB_PORT=3306 - DB_USER=bookstack - DB_PASS=${MYSQL_PASSWORD} - DB_DATABASE=bookstackapp volumes: - /mnt/docker/volume/bookstack/app_data:/config ports: - 6875:80 restart: unless-stopped depends_on: - bookstack_db labels: - "com.centurylinklabs.watchtower.enable=true" bookstack_db: image: lscr.io/linuxserver/mariadb # Arbeitsspeicher limit mem_limit: 500m # Priorisierung - 1024 = Default cpu_shares: 1024 container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - TZ=Europe/Berlin - MYSQL_DATABASE=bookstackapp - MYSQL_USER=bookstack - MYSQL_PASSWORD=${MYSQL_PASSWORD} volumes: - /mnt/docker/volume/bookstack/db_data:/config restart: unless-stopped labels: - "com.centurylinklabs.watchtower.enable=true" ``` </p> </details> it looks like this in the folder: ![Image](https://github.com/user-attachments/assets/cd80340b-5190-48b8-898d-efe1db31581b) Hopefully this help to resolve the issue. ### Steps to Reproduce deploy via docker compose inspect maria-db folder after a while of use. ### Expected Behaviour No creation of such error files. Or alternativly rotating error-files. ### Screenshots or Additional Context _No response_ ### Browser Details firefox/chrome ### Exact BookStack Version 25.05.1
OVERLORD added the 🐛 Bug label 2026-02-05 09:57:59 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jun 23, 2025):

Hi @towerplease,
This isn't really something that's specific to BookStack, the tables in the errors are not BookStack tables.

From what I can tell, this can occur if mariadb version has changed but the data has not been upgraded to match (where needed).

Backup your container data/files first! Ideally snapshot/backup the host machine if possible too. The following is somewhat sensitive/dangerous.

The linuxserver/mariadb image readme has a section on upgrading: https://github.com/linuxserver/docker-mariadb?tab=readme-ov-file#upgrading
Following that, from a stopped stack, you could start up the bookstack_db service then, in the startup logs check if there are any messages advising to run an upgrade.
If so, you'd probably want to access the container and run that upgrade following their guidance.

Let me know if you'd need help/guidance on any of those steps.

@ssddanbrown commented on GitHub (Jun 23, 2025): Hi @towerplease, This isn't really something that's specific to BookStack, the tables in the errors are not BookStack tables. From what I can tell, this can occur if mariadb version has changed but the data has not been upgraded to match (where needed). _**Backup your container data/files first!** Ideally snapshot/backup the host machine if possible too. The following is somewhat sensitive/dangerous._ The linuxserver/mariadb image readme has a section on upgrading: https://github.com/linuxserver/docker-mariadb?tab=readme-ov-file#upgrading Following that, from a stopped stack, you could start up the `bookstack_db` service then, in the startup logs check if there are any messages advising to run an upgrade. If so, you'd probably want to access the container and run that upgrade following their guidance. Let me know if you'd need help/guidance on any of those steps.
Author
Owner

@towerplease commented on GitHub (Jun 23, 2025):

Hi @ssddanbrown
ah alright. So its more of an issue of mariadb image itself.

Thank you for clarification. I will have a look and try to find/solve this issue within the mariadb-container.

I will post the result, when i have one.

@towerplease commented on GitHub (Jun 23, 2025): Hi @ssddanbrown ah alright. So its more of an issue of mariadb image itself. Thank you for clarification. I will have a look and try to find/solve this issue within the mariadb-container. I will post the result, when i have one.
Author
Owner

@towerplease commented on GitHub (Jun 23, 2025):

Hey again,

so i ran the steps you mentioned as written in https://github.com/linuxserver/docker-mariadb?tab=readme-ov-file#upgrading
Looks like there are no errors now.

Steps to reproduce:

  1. Stop the Docker-Stack of bookstack
  2. Take Snapshot of the whole VM
  3. Start the Docker-Stack of bookstack
  4. Manually stop the App-Container, so only the database-container is running
  5. Connect to the Database-Container
  6. Run: mariadb-check -u root -p<PASSWORD> -c -A -> No errors Found
  7. Run: mariadb-check -u root -p<PASSWORD> -r -A -> Did something (i guess)
  8. Run: mariadb-upgrade -u root -p<PASSWORD> -> Ran successfull
  9. Startup the App-Container (bookstack) again.

I finally cleared up all *.err files and went on clicking on all kind of contents in my bookstack-instance.
No more .err-Files are generated.

So, this did the trick for me.
Thank you again @ssddanbrown !!

EDIT:

Dont forget to remove your snapshot after everything works fine.

@towerplease commented on GitHub (Jun 23, 2025): Hey again, so i ran the steps you mentioned as written in https://github.com/linuxserver/docker-mariadb?tab=readme-ov-file#upgrading Looks like there are no errors now. Steps to reproduce: 1. Stop the Docker-Stack of bookstack 2. Take Snapshot of the whole VM 3. Start the Docker-Stack of bookstack 4. Manually stop the App-Container, so only the database-container is running 5. Connect to the Database-Container 6. Run: `mariadb-check -u root -p<PASSWORD> -c -A` -> No errors Found 7. Run: `mariadb-check -u root -p<PASSWORD> -r -A` -> Did something (i guess) 8. Run: `mariadb-upgrade -u root -p<PASSWORD>` -> Ran successfull 9. Startup the App-Container (bookstack) again. I finally cleared up all *.err files and went on clicking on all kind of contents in my bookstack-instance. No more .err-Files are generated. So, this did the trick for me. Thank you again @ssddanbrown !! EDIT: Dont forget to remove your snapshot after everything works fine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5326