BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.29k stars 1.9k forks source link

Upload image doesn't get uploaded for books or shelves #4275

Open piraterx opened 1 year ago

piraterx commented 1 year ago

Describe the Bug

I tried installing docker version of bookstack twice and both time, eventhough I upload cover image for shelves or book, it doesn't get uploaded. It happens with uploading image in chapter as well.

I am using this docker: https://github.com/linuxserver/docker-bookstack

I believe it is recommended version on your blog.

Steps to Reproduce

Go to any shelves or book, click upload image for cover, upload image you desire, and see if you can see that image in list of shelves or cover.

Expected Behaviour

There should be a cover image.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v23.05.2-ls81

PHP Version

No response

Hosting Environment

Debian 11

ssddanbrown commented 1 year ago

Hi @piraterx,

piraterx commented 1 year ago

Yes, Debain 11 instance is running for sure otherwise I wouldn't be able to access bookstack at all. Here is docker-compose.yml file:

version: "2" services: bookstack: image: lscr.io/linuxserver/bookstack container_name: bookstack environment:

  • PUID=1000
  • PGID=1000
  • APP_URL= https://10.0.30.50:6875
  • DB_HOST=bookstack_db
  • DB_PORT=3306
  • DB_USER=bookstack
  • DB_PASS=RANDOM
  • DB_DATABASE=bookstackapp volumes:
  • ./bookstack:/config ports:
  • 6875:80 restart: unless-stopped depends_on:
  • bookstack_db bookstack_db: image: lscr.io/linuxserver/mariadb container_name: bookstack_db environment:
  • PUID=1000
  • PGID=1000
  • MYSQL_ROOT_PASSWORD=RANDOM1
  • TZ=America/New_York
  • MYSQL_DATABASE=bookstackapp
  • MYSQL_USER=bookstack
  • MYSQL_PASSWORD=RANDOM volumes:
  • ./mariadb:/config restart: unless-stopped
ssddanbrown commented 1 year ago

@piraterx Thanks for the compose file.

Yes, Debain 11 instance is running for sure

Sure, but can you specify how it's running? Are you running on bare-metal? A virtual machine? On Proxmox? LXC container? Online VPS service? What architecture (ARM or x86_64)?

piraterx commented 1 year ago

@piraterx Thanks for the compose file.

Yes, Debain 11 instance is running for sure

Sure, but can you specify how it's running? Are you running on bare-metal? A virtual machine? On Proxmox? LXC container? Online VPS service? What architecture (ARM or x86_64)?

Sorry, completely forgot to read How.. lol I am running is VM on proxmox.

ssddanbrown commented 1 year ago

@piraterx Thanks.

piraterx commented 1 year ago

@piraterx Thanks.

* Is it for sure a VM on proxmox and not an LXC container?

* What type of storage are you using for this specific container/VM on proxmox? ZFS or LVM?

It is sure VM on proxmox and I use ZFS storage for it in mirror vdev - separate for all VMs. .

ssddanbrown commented 1 year ago

Okay, reason I ask is that I've seen very similar things recently for users running on docker on LXC on Proxmox on ZFS. The same setup on a different storage type did not have issues. See here for reference. Wondering if the same thing is at play for VMs.

piraterx commented 1 year ago

Okay, reason I ask is that I've seen very similar things recently for users running on docker on LXC on Proxmox on ZFS. The same setup on a different storage type did not have issues. See here for reference. Wondering if the same thing is at play for VMs.

But, I have another instance working on VM direct install created on ZFS but VM disk itself is LVM.

ssddanbrown commented 1 year ago

Alright, I've just created a Debian 11.7 VM instance in proxmox, running a LSIO bookstack docker-compose setup using the default readme compose file, and book/shelf images worked fine. The VM's disk is on ZFS proxmox storage, but the VM OS was installed with Ext4 for the root directory (Where containers exist).

Can you confirm the filesystem type used within the VM? For wherever the docker container and/or mounted volumes exist.

piraterx commented 1 year ago

Can you confirm the filesystem type used within the VM? For wherever the docker container and/or mounted volumes exist.

It is ext4. I can see image I uploaded under

ls bookstack/www/uploads/images/cover_bookshelf/

but on website itself, no luck.

ssddanbrown commented 1 year ago

Can you check your bookstack/www/laravel.log file, if existing, and confirm if lines are logged when uploading such an image. If so, can you share those logged lines?

piraterx commented 1 year ago

Can you check your bookstack/www/laravel.log file, if existing, and confirm if lines are logged when uploading such an image. If so, can you share those logged lines?

No such a file.

AvrumFeldman commented 1 year ago

@piraterx since you are running on linuxserver/docker-bookstack the laravel.log is located in /app/www/storage/logs/laravel.log

piraterx commented 1 year ago

@piraterx since you are running on linuxserver/docker-bookstack the laravel.log is located in /app/www/storage/logs/laravel.log

Hey thanks, but I am not seeing this file anywhere in any folder. I went though each folders. this is what is if I do ls in there.

https://imgur.com/a/AeJkYL6

ssddanbrown commented 1 year ago

If you run ls -alh bookstack/www/uploads/images/cover_bookshelf/ within your stack folder, what do the permissions look like?

Does the uploaded image file have the same user/group set as the directory in which that file exists?

piraterx commented 1 year ago

If you run ls -alh bookstack/www/uploads/images/cover_bookshelf/ within your stack folder, what do the permissions look like?

Does the uploaded image file have the same user/group set as the directory in which that file exists?

Hey so yes, whatever GUID and PUID is set in docker compose file, it has same permissions user/group for all folders and files.

I appreciate you looking into this.

ssddanbrown commented 1 year ago

@piraterx Just to confirm, does that remain the case right after uploading an image? (Without restarting the container stack at all). Just want to confirm that point because I think the container scripts set permissions on start-up, which may be affecting what's observed here.

piraterx commented 1 year ago

@piraterx Just to confirm, does that remain the case right after uploading an image? (Without restarting the container stack at all). Just want to confirm that point because I think the container scripts set permissions on start-up, which may be affecting what's observed here.

Yes, I created new book and uploaded new cover image for that. User and group is same as what defined in docker-compose file.