linuxserver / docker-bookstack

A Docker container for the BookStack documentation wiki
GNU General Public License v3.0
725 stars 105 forks source link

[BUG] bookstack-system-cli backup can't be run #170

Closed cdrfun closed 1 year ago

cdrfun commented 1 year ago

Is there an existing issue for this?

Current Behavior

When running bookstack-system-cli backup from command line while in /app/www an error occurs: The "zip" PHP extension is required to run this command

grafik

Expected Behavior

The command should be able to create a backup file.

Steps To Reproduce

  1. Log into Docker container
  2. cd /app/www
  3. ./bookstack-system-cli backup

Environment

- OS: Ubuntu 22.04
- How docker service was installed: Docker repo

CPU architecture

x86-64

Docker creation

version: "2"
services:
  adminer:
    image: adminer
    container_name: adminer
    restart: always
    ports:
      - 9005:8080
    environment:
      - ADMINER_DEFAULT_SERVER=mariadb
  bookstack_ldap:
    image: lscr.io/linuxserver/bookstack:latest
    container_name: bookstack_ldap
    environment:
      - [...]
    volumes:
      - bookstack:/config
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
    depends_on:
      - bookstack_db
      - drawio
  drawio:
    image: jgraph/drawio:latest
    restart: unless-stopped
    container_name: drawio
    ports:
      - 8080:8080
      - 8443:8443
  bookstack_db:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: MariaDB
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=[...]
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=bookstack
      - MYSQL_PASSWORD=[...]
    volumes:
      - mariadb:/config
    ports:
      - 3306:3306
    restart: unless-stopped
volumes:
  mariadb:
   external: true
   name: mariadb
  bookstack:
   external: true
   name: bookstack

Container logs

[migrations] started
[migrations] 01-nginx-site-confs-default: skipped
[migrations] 02-default-location: skipped
[migrations] done
───────────────────────────────────────
      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
using keys found in /config/keys
App Key found - setting variable for seds
Running config - DB_HOST set
Waiting for DB to be available
   INFO  Nothing to migrate.  
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2018-03-06 │ 2023-04-13 │ /config/nginx/site-confs/default.conf                                  │
│            │ 2023-04-13 │ /config/nginx/nginx.conf                                               │
│ 2022-08-05 │ 2022-08-20 │ /config/nginx/ssl.conf                                                 │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
[custom-init] No custom files found, skipping...
[ls.io-init] done.
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

ssddanbrown commented 1 year ago

For context, this is a new CLI I added in the BookStack may release. Details on blog here.

Supporting this tool, I also designated the <app>/storage/backups folder as a default backup output folder, so it'd probably be good to expose this to /config for persistence/access.

The CLI does do updates, which is a bit awkward in this context since I'd consider updating via the CLI the wrong approach, so it might be better if that specific command fails/stops early in some way. Might be an idea for me to build in some handling on the CLI side of things.

If I find a spare moment I'll look to test the CLI in the image myself and put a PR together.


Update

Started on this on my fork/branch here. Since this requires mysqldump, this does inflate the image a tad. About 30MB, or ~10% image size increase. Can be handy to have mariadb-client available, inside this image, for additional purposes upon the CLI's usage though. There are a few bugs/quirks that ideally need to be handled on the CLI project side, which I've opened as issues to deal with:

I'll look to get those points addressed for the next BookStack patch release.

ssddanbrown commented 1 year ago

Just an update, today's BookStack patch release did make many CLI updates to get us closer for this, and I was aiming to create a PR today, but I came across some extra issues while testing the ARM64 image build. The combination of symlinks, multiple different system storage volumes/filesystems really brings out the edge-case problems in the CLI.

I could create the PR now, but I think it's better to wait so that that the CLI is erroring early as reported, rather than missing content in backups. Will be a future BookStack patch release before I come back to this for a PR (May end up being a few weeks out).

thespad commented 1 year ago

If you haven't already handled it, my suggestion would be an env we can set to tell the cli that it's running in docker and not to try and run updates.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

cdrfun commented 1 year ago

The PR (https://github.com/linuxserver/docker-bookstack/pull/173) seems to get merged soon. I'll test the issue if when it is.