bookstack-system-cli restore fails #5186

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

Originally created by @wiknesta on GitHub (Feb 15, 2025).

Describe the Bug

Use the system cli to execute a restore. For example:
/app/www/bookstack-system-cli restore /backups/bookstack.zip

Now the process fails with the following message:
_Extracting ZIP into temporary directory...
Restoring and merging .env file...

An error occurred when attempting to run a command:

Could not find a working database configuration_

Steps to Reproduce

Use the system cli to execute a restore
For example: /app/www/bookstack-system-cli restore /backups/bookstack.zip

Expected Behaviour

The restore ends with the message: "Restore operation complete"

Screenshots or Additional Context

We use a Docker installation (lscr.io/linuxserver/bookstack). The restore is executed in the docker container of bookstack.
If bookstack is reset to version 24.05.3, the same restore works without any problems.

Browser Details

No response

Exact BookStack Version

v24.12.1

Originally created by @wiknesta on GitHub (Feb 15, 2025). ### Describe the Bug Use the system cli to execute a restore. For example: _/app/www/bookstack-system-cli restore /backups/bookstack.zip_ Now the process fails with the following message: _Extracting ZIP into temporary directory... Restoring and merging .env file... An error occurred when attempting to run a command: Could not find a working database configuration_ ### Steps to Reproduce Use the system cli to execute a restore For example: /app/www/bookstack-system-cli restore /backups/bookstack.zip ### Expected Behaviour The restore ends with the message: "Restore operation complete" ### Screenshots or Additional Context We use a Docker installation (lscr.io/linuxserver/bookstack). The restore is executed in the docker container of bookstack. If bookstack is reset to version 24.05.3, the same restore works without any problems. ### Browser Details _No response_ ### Exact BookStack Version v24.12.1
OVERLORD added the 🐛 Bug label 2026-02-05 09:46:46 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 15, 2025):

Hi @wiknesta,
The CLI will throw that error if it can't find a working database connect from details it finds.

  • In this environment, where exactly would working database connection details be found?
  • Is the database running and connectable during this attempted restore?
@ssddanbrown commented on GitHub (Feb 15, 2025): Hi @wiknesta, The CLI will throw that error if it can't find a working database connect from details it finds. - In this environment, where exactly would working database connection details be found? - Is the database running and connectable during this attempted restore?
Author
Owner

@wiknesta commented on GitHub (Feb 15, 2025):

Hi @ssddanbrown
This problem may be related to issue #5373 (backup)

The database is running and connectable during this attempted restore.
Bookstack is installed with the folling docker-compose.yml:

version: "2"
services:
  bookstack:
    image: lscr.io/linuxserver/bookstack
    container_name: bookstack
    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=http://192.168.1.136:6875
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=dummypassword
      - DB_DATABASE=bookstackapp
      - TZ=Europe/Zurich
      
    volumes:
      - /home/xabano/docker/bookstack_app_data:/config
      - /etc/localtime:/etc/localtime:ro 
    ports:
      - 6875:80
    restart: always
    depends_on:
      - bookstack_db
  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=dummypassword
      - TZ=Europe/Zurich
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=dummypassword
    volumes:
      - /home/xabano/docker/bookstack_db_data:/config
      - /etc/localtime:/etc/localtime:ro 

    restart: unless-stopped

If an older docker-image is used for bookstack, there is no error. In this case, the restore is carried out correctly

@wiknesta commented on GitHub (Feb 15, 2025): Hi @ssddanbrown This problem may be related to issue #5373 (backup) The database is running and connectable during this attempted restore. Bookstack is installed with the folling docker-compose.yml: ``` version: "2" services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment: - PUID=1000 - PGID=1000 - APP_URL=http://192.168.1.136:6875 - DB_HOST=bookstack_db - DB_PORT=3306 - DB_USER=bookstack - DB_PASS=dummypassword - DB_DATABASE=bookstackapp - TZ=Europe/Zurich volumes: - /home/xabano/docker/bookstack_app_data:/config - /etc/localtime:/etc/localtime:ro ports: - 6875:80 restart: always depends_on: - bookstack_db bookstack_db: image: lscr.io/linuxserver/mariadb container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD=dummypassword - TZ=Europe/Zurich - MYSQL_DATABASE=bookstackapp - MYSQL_USER=bookstack - MYSQL_PASSWORD=dummypassword volumes: - /home/xabano/docker/bookstack_db_data:/config - /etc/localtime:/etc/localtime:ro restart: unless-stopped ``` If an older docker-image is used for bookstack, there is no error. In this case, the restore is carried out correctly
Author
Owner

@ssddanbrown commented on GitHub (Mar 12, 2025):

Okay, the backup command was not taking the environment into account when testing/validating config files.
This has been addressed within the changes of https://codeberg.org/bookstack/system-cli/pulls/21, which will be part of the next patch release.

Thanks @wiknesta for reporting.

@ssddanbrown commented on GitHub (Mar 12, 2025): Okay, the backup command was not taking the environment into account when testing/validating config files. This has been addressed within the changes of https://codeberg.org/bookstack/system-cli/pulls/21, which will be part of the next patch release. Thanks @wiknesta for reporting.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5186