storage/uploads folder not persisted between restarts on docker. Public/uploads is correctly persisted #1837

Closed
opened 2026-02-05 02:01:16 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @MarsWarrior on GitHub (Sep 2, 2020).

Describe the bug
According to the documentation about backup/restore, the following folders should be backuped:

  • public/uploads
  • storage/uploads

The public/uploads folder is symlinked to the config folder. This is also the folder that is persisted using a volume.
The storage/uploads folder is NOT symlinked to the config folder, hence has no persistence in a docker volume.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create a folder or file in the storage/uploads folder
  2. Re-create/redeploy the bookstack apps (app, database, backup, redis)
  3. Check the storage/uploads folder by connecting the console to the bookstack app container
  4. The in step 1 created folder or file is gone ;-)

Expected behavior
The storage/uploads folder is persisted. If possible using the same solution as the public/uploads folder.

Screenshots
public/uploads symlinked to config folder:
image

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.29.3
  • PHP Version: 7.3.18
  • Hosting Method (Nginx/Apache/Docker): linuxserver/bookstack docker image

Additional context
Part of docker stack:

 app:
    image: linuxserver/bookstack
    volumes:
      - bookstack_config:/config
Originally created by @MarsWarrior on GitHub (Sep 2, 2020). **Describe the bug** According to the documentation about backup/restore, the following folders should be backuped: - public/uploads - storage/uploads The public/uploads folder is symlinked to the config folder. This is also the folder that is persisted using a volume. The storage/uploads folder is NOT symlinked to the config folder, hence has no persistence in a docker volume. **Steps To Reproduce** Steps to reproduce the behavior: 1. Create a folder or file in the storage/uploads folder 2. Re-create/redeploy the bookstack apps (app, database, backup, redis) 3. Check the storage/uploads folder by connecting the console to the bookstack app container 4. The in step 1 created folder or file is gone ;-) **Expected behavior** The storage/uploads folder is persisted. If possible using the same solution as the public/uploads folder. **Screenshots** public/uploads symlinked to config folder: ![image](https://user-images.githubusercontent.com/1220775/91993756-0e2bf480-ed36-11ea-9c33-a22716871211.png) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v0.29.3 - PHP Version: 7.3.18 - Hosting Method (Nginx/Apache/Docker): linuxserver/bookstack docker image **Additional context** Part of docker stack: ``` app: image: linuxserver/bookstack volumes: - bookstack_config:/config ```
Author
Owner

@mr-vinn commented on GitHub (Sep 3, 2020):

I just checked my running instance—/var/www/html/storage/uploads contains symlinks to /config/www/files and /config/www/images, but no regular files. Do you have an example of a file that Bookstack saves in storage/uploads that doesn't really live in the config volume?

@mr-vinn commented on GitHub (Sep 3, 2020): I just checked my running instance—`/var/www/html/storage/uploads` contains symlinks to `/config/www/files` and `/config/www/images`, but no regular files. Do you have an example of a file that Bookstack saves in `storage/uploads` that doesn't really live in the `config` volume?
Author
Owner

@MarsWarrior commented on GitHub (Sep 4, 2020):

I just checked the friends installation again which was created from backup, and also created my own docker instance, and it seems to be a completely different problem!

The 'problematic' Bookstack instance was created from backup. So it seemed that after the re-creation of the Bookstack app, the storage folder had a problem with persistence. And that is what I tested and made the PR from.

However, after creating my own environment (app, database and backup containers), I just found out that as long as you don't upload an attachment, NO symlinks are made. Only after uploading a file/image two folders are created in the storage folder: files - symlinking to /config/www/files and images - symlinking to/config/www/images.

However the backup container was saving /config/www/uploads and /config/www/storage. The last one just doesn't exist!

So it is actually a problem with the documentation, resulting in a wrongly setup backup container. This one should, apart from the database itself, backup the following folders in a docker environment:

  • /config/www/uploads
  • /config/www/files
  • /config/www/images

So I will close this issue, and check the documentation.

@MarsWarrior commented on GitHub (Sep 4, 2020): I just checked the friends installation again which was created from backup, and also created my own docker instance, and it seems to be a completely different problem! The 'problematic' Bookstack instance was created from backup. So it seemed that after the re-creation of the Bookstack app, the `storage` folder had a problem with persistence. And that is what I tested and made the PR from. However, after creating my own environment (app, database and backup containers), I just found out that as long as you don't upload an attachment, NO symlinks are made. Only after uploading a file/image two folders are created in the `storage` folder: `files` - symlinking to `/config/www/files` and `images` - symlinking to`/config/www/images`. However the backup container was saving `/config/www/uploads` and `/config/www/storage`. The last one just doesn't exist! So it is actually a problem with the documentation, resulting in a wrongly setup backup container. This one should, apart from the database itself, backup the following folders in a docker environment: - `/config/www/uploads` - `/config/www/files` - `/config/www/images` So I will close this issue, and check the documentation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1837