Upload Image problem: could not be uploaded to. Ensure it is writable to the server. #3819

Closed
opened 2026-02-05 07:33:49 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @nicontinisio on GitHub (May 25, 2023).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I followed the instructions to install bookstack inside docker but I have this error:
Screenshot 2023-05-25 at 13 48 49

The docker compose configuration is this:

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

    environment:
      - PUID=1000
      - PGID=1000
      - APP_URL=https://example.com
      - DB_HOST=bookstack_db
      - DB_PORT=3306
      - DB_USER=bookstack
      - DB_PASS=PASSWD
      - DB_DATABASE=bookstackapp
    volumes:
      - /mnt/docker/bookstack:/config
    restart: unless-stopped
    depends_on:
      - bookstack_db
    labels:
       - "traefik.enable=true"
     #Routers
       - "traefik.http.routers.bookstack.rule=Host(`example.com`)"
       - "traefik.http.routers.bookstack.entrypoints=web"
      #- "traefik.http.routers.bookstack.service=bookstack"
       - "traefik.http.routers.bookstack.middlewares=test-redirectscheme"
     #Routers Secure
       - "traefik.http.routers.bookstack-secure.rule=Host(`example.com`)"
       - "traefik.http.routers.bookstack-secure.entrypoints=websecure"
       - "traefik.http.routers.bookstack-secure.tls.certresolver=production"     
     #Services
       - "traefik.http.services.bookstack-secure.loadbalancer.server.port=80"
       
  bookstack_db:
    image: lscr.io/linuxserver/mariadb
    container_name: bookstack_db
    environment:
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=PASSWD
      - TZ=Europe/Rome
      - MYSQL_DATABASE=bookstackapp
      - MYSQL_USER=USER
      - MYSQL_PASSWORD=PASSWD
    volumes:
      - /mnt/docker/bookstack/db:/config
    restart: unless-stopped

PUID and PGID of my docker host user
Screenshot 2023-05-25 at 13 57 31

Bookstack volume permissions, I set my user and group from root path just to be safe.

Screenshot 2023-05-25 at 13 58 11

I tried excluding traefik but i have the same problem, i booted a new machine with clean docker to try again but i still have the same problem.

Am I wrong in something?

Exact BookStack Version

V23.05.2

Log Content

2023-05-25 11:48:24] production.ERROR: Error when attempting image upload:Unable to create a directory at /app/www/public/uploads/images/user/2023-05.  
[2023-05-25 11:48:24] production.ERROR: File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. {"userId":1,"exception":"[object] (BookStack\\Exceptions\\ImageUploadException(code: 0): File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. at /app/www/app/Uploads/ImageService.php:174)
[stacktrace]

PHP Version

8.1.19

Hosting Environment

Proxmox LXC Container Debian 11

Originally created by @nicontinisio on GitHub (May 25, 2023). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario I followed the instructions to install bookstack inside docker but I have this error: <img width="1440" alt="Screenshot 2023-05-25 at 13 48 49" src="https://github.com/BookStackApp/BookStack/assets/64996602/01ecf68e-2d25-4553-b149-33d5b872c4a6"> The docker compose configuration is this: ```yaml version: "2" services: bookstack: image: lscr.io/linuxserver/bookstack:23.05.2 container_name: bookstack environment: - PUID=1000 - PGID=1000 - APP_URL=https://example.com - DB_HOST=bookstack_db - DB_PORT=3306 - DB_USER=bookstack - DB_PASS=PASSWD - DB_DATABASE=bookstackapp volumes: - /mnt/docker/bookstack:/config restart: unless-stopped depends_on: - bookstack_db labels: - "traefik.enable=true" #Routers - "traefik.http.routers.bookstack.rule=Host(`example.com`)" - "traefik.http.routers.bookstack.entrypoints=web" #- "traefik.http.routers.bookstack.service=bookstack" - "traefik.http.routers.bookstack.middlewares=test-redirectscheme" #Routers Secure - "traefik.http.routers.bookstack-secure.rule=Host(`example.com`)" - "traefik.http.routers.bookstack-secure.entrypoints=websecure" - "traefik.http.routers.bookstack-secure.tls.certresolver=production" #Services - "traefik.http.services.bookstack-secure.loadbalancer.server.port=80" bookstack_db: image: lscr.io/linuxserver/mariadb container_name: bookstack_db environment: - PUID=1000 - PGID=1000 - MYSQL_ROOT_PASSWORD=PASSWD - TZ=Europe/Rome - MYSQL_DATABASE=bookstackapp - MYSQL_USER=USER - MYSQL_PASSWORD=PASSWD volumes: - /mnt/docker/bookstack/db:/config restart: unless-stopped ``` PUID and PGID of my docker host user <img width="734" alt="Screenshot 2023-05-25 at 13 57 31" src="https://github.com/BookStackApp/BookStack/assets/64996602/770a9e6b-4cf0-48d9-840e-a3dd62184983"> Bookstack volume permissions, I set my user and group from root path just to be safe. <img width="734" alt="Screenshot 2023-05-25 at 13 58 11" src="https://github.com/BookStackApp/BookStack/assets/64996602/7d6f66a9-1425-4f3d-bb19-810bafc45880"> I tried excluding traefik but i have the same problem, i booted a new machine with clean docker to try again but i still have the same problem. Am I wrong in something? ### Exact BookStack Version V23.05.2 ### Log Content ``` 2023-05-25 11:48:24] production.ERROR: Error when attempting image upload:Unable to create a directory at /app/www/public/uploads/images/user/2023-05. [2023-05-25 11:48:24] production.ERROR: File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. {"userId":1,"exception":"[object] (BookStack\\Exceptions\\ImageUploadException(code: 0): File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. at /app/www/app/Uploads/ImageService.php:174) [stacktrace] ``` ### PHP Version 8.1.19 ### Hosting Environment Proxmox LXC Container Debian 11
OVERLORD added the 🐕 Support label 2026-02-05 07:33:49 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 25, 2023):

Hi @nicontinisio,
Not really sure what might be going on. Some thoughts/questions:

  • The database container volume is mounted in a sub-folder of the mounted app container volume. I'd use seperate paths to be safe (Not nest on within another) since they may set their own permissions upon boot.
  • Is /mnt/docker/bookstack a mount of a different/external filesystem? If so, that might be complicating matters.
  • What type of storage are you using for LXC container in proxmox?
  • Are you seeing folders and files in /mnt/docker/bookstack created by the container?
@ssddanbrown commented on GitHub (May 25, 2023): Hi @nicontinisio, Not really sure what might be going on. Some thoughts/questions: - The database container volume is mounted in a sub-folder of the mounted app container volume. I'd use seperate paths to be safe (Not nest on within another) since they may set their own permissions upon boot. - Is `/mnt/docker/bookstack` a mount of a different/external filesystem? If so, that might be complicating matters. - What type of storage are you using for LXC container in proxmox? - Are you seeing folders and files in `/mnt/docker/bookstack` created by the container?
Author
Owner

@felixlu07 commented on GitHub (May 26, 2023):

I'm having this same issue as well! Tried a ton of things but still not working out..
This issue clearly surfaced when AFTER I starting using S3 as a storage service. All other uploads, images or videos within pages works fine. Attachments get successfully created in S3. But ONLY with the profile picture I'm getting that error.

Things that I have tried/searching for:

  1. I don't have any config.php file in bootstrap/cache/config.php
  2. Based on the error message, I tried clearing/delete everything in the folders that wasshowing up in the error message --> An Error Occurred
    File path /uploads/images/user/2023-05/C5xfriskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2aaa1.png could not be uploaded to. Ensure it is writable to the server.
- sudo rm -rf /var/www/bookstack/public/uploads/images/system/2023-05/
- sudo rm -rf /var/www/bookstack/public/uploads/images/user/2023-05/
- There is absolutely no files in /var/www/bookstack/storage/uploads/images

The funny thing is that the error still shows the same folder with the picture name in it.
My laravel logs look similar to @nicontinisio

Logs

[2023-05-26 13:04:13] production.ERROR: Error when attempting image upload:Unable to set visibility for file uploads/images/user/2023-05/friskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2a.png.
[2023-05-26 13:04:13] production.ERROR: File path /uploads/images/user/2023-05/friskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2a.png could not be uploaded to. Ensure it is writable to the server. {"userId":1,"exception":"[object] (BookStack\Exceptions\ImageUploadException(code: 0): File path /uploads/images/user/2023-05/friskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2a.png could not be uploaded to. Ensure it is writable to the server. at /var/www/bookstack/app/Uploads/ImageService.php:174)
[stacktrace]
#0 /var/www/bookstack/app/Uploads/ImageService.php(128): BookStack\Uploads\ImageService->saveNew()
#1 /var/www/bookstack/app/Uploads/ImageRepo.php(125): BookStack\Uploads\ImageService->saveNewFromUpload()

Images

image
image
image
image
image

@felixlu07 commented on GitHub (May 26, 2023): I'm having this same issue as well! Tried a ton of things but still not working out.. This issue clearly surfaced when AFTER I starting using S3 as a storage service. All other uploads, images or videos within pages works fine. Attachments get successfully created in S3. But ONLY with the profile picture I'm getting that error. **Things that I have tried/searching for:** 1) I don't have any `config.ph`p file in `bootstrap/cache/config.php` 2) Based on the error message, I tried clearing/delete everything in the folders that wasshowing up in the error message --> An Error Occurred File path `/uploads/images/user/2023-05/`C5xfriskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2aaa1.png could not be uploaded to. Ensure it is writable to the server. ``` - sudo rm -rf /var/www/bookstack/public/uploads/images/system/2023-05/ - sudo rm -rf /var/www/bookstack/public/uploads/images/user/2023-05/ - There is absolutely no files in /var/www/bookstack/storage/uploads/images ``` The funny thing is that the error still shows the same folder with the picture name in it. My laravel logs look similar to @nicontinisio <details><summary>Logs</summary> <p> > [2023-05-26 13:04:13] production.ERROR: Error when attempting image upload:Unable to set visibility for file uploads/images/user/2023-05/friskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2a.png. > [2023-05-26 13:04:13] production.ERROR: File path /uploads/images/user/2023-05/friskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2a.png could not be uploaded to. Ensure it is writable to the server. {"userId":1,"exception":"[object] (BookStack\\Exceptions\\ImageUploadException(code: 0): File path /uploads/images/user/2023-05/friskylu-capture-the-joy-of-your-mid-journey-with-a-high-qualit-84b3c019-3775-4cff-81cc-717dd9a2a.png could not be uploaded to. Ensure it is writable to the server. at /var/www/bookstack/app/Uploads/ImageService.php:174) > [stacktrace] > #0 /var/www/bookstack/app/Uploads/ImageService.php(128): BookStack\\Uploads\\ImageService->saveNew() > #1 /var/www/bookstack/app/Uploads/ImageRepo.php(125): BookStack\\Uploads\\ImageService->saveNewFromUpload() </p> </details> <details><summary>Images</summary> <p> ![image](https://github.com/BookStackApp/BookStack/assets/44922675/d54b7e2c-82b7-42af-b22f-444d56cc3d2f) ![image](https://github.com/BookStackApp/BookStack/assets/44922675/23b42775-5228-4fc9-b641-e2bdac2a19e0) ![image](https://github.com/BookStackApp/BookStack/assets/44922675/e062f8f4-3d13-44de-9ccc-c423d2ae53f5) ![image](https://github.com/BookStackApp/BookStack/assets/44922675/ca6607aa-af08-4bc9-86fa-78592bff2030) ![image](https://github.com/BookStackApp/BookStack/assets/44922675/7cbf75e1-0e44-47e3-b7db-09f756bba3f4) </p> </details>
Author
Owner

@nicontinisio commented on GitHub (May 27, 2023):

@ssddanbrown I deleted the container and recreated by changing the volume to:

  • /docker-volume/bookstack:/config
    And
  • /docker-volume/bookstack_db:/config

They are two folders created on the container disk
Screenshot from 2023-05-27 10-14-16

But the result doesn't change

Screenshot from 2023-05-27 10-28-42

Logs

[2023-05-25 11:48:24] production.ERROR: Error when attempting image upload:Unable to create a directory at /app/www/public/uploads/images/user/2023-05.  
[2023-05-25 11:48:24] production.ERROR: File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. {"userId":1,"exception":"[object] (BookStack\\Exceptions\\ImageUploadException(code: 0): File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. at /app/www/app/Uploads/ImageService.php:174)
[stacktrace]
#0 /app/www/app/Uploads/ImageService.php(128): BookStack\\Uploads\\ImageService->saveNew()
#1 /app/www/app/Uploads/ImageRepo.php(125): BookStack\\Uploads\\ImageService->saveNewFromUpload()
#2 /app/www/app/Http/Controllers/UserController.php(159): BookStack\\Uploads\\ImageRepo->saveNew()
#3 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\\Http\\Controllers\\UserController->update()
#4 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#5 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#6 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#7 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#8 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#9 /app/www/app/Http/Middleware/Authenticate.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#10 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\Authenticate->handle()
#11 /app/www/app/Http/Middleware/Localization.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#12 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\Localization->handle()
#13 /app/www/app/Http/Middleware/RunThemeActions.php(26): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#14 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\RunThemeActions->handle()
#15 /app/www/app/Http/Middleware/CheckEmailConfirmed.php(47): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\CheckEmailConfirmed->handle()
#17 /app/www/app/Http/Middleware/PreventAuthenticatedResponseCaching.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\PreventAuthenticatedResponseCaching->handle()
#19 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#21 /app/www/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#23 /app/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /app/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#25 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#26 /app/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#27 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#28 /app/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#30 /app/www/app/Http/Middleware/ApplyCspRules.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#31 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\ApplyCspRules->handle()
#32 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#33 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Pipeline\\Pipeline->then()
#34 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack()
#35 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute()
#36 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute()
#37 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch()
#38 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#39 /app/www/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 /app/www/app/Http/Middleware/TrustProxies.php(41): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#41 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\TrustProxies->handle()
#42 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#44 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#45 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#47 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#48 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#49 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#51 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#52 /app/www/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle()
#53 {main}
"} 

Screenshot from 2023-05-27 10-37-48
Screenshot from 2023-05-27 10-38-33

I created this container now and the logs extracted immediately after but the date of the logs is 2023-05-25
both in the LXC container and in the bookstack bash the date is correct
Screenshot from 2023-05-27 10-35-49
Screenshot from 2023-05-27 10-36-16

Regarding /mnt/docker/bookstack I added a disk to the LXC container directly from proxmox
Screenshot from 2023-05-27 10-23-06

In /mnt/docker/bookstack I could see created folders and files
Screenshot from 2023-05-27 10-22-45

@nicontinisio commented on GitHub (May 27, 2023): @ssddanbrown I deleted the container and recreated by changing the volume to: - /docker-volume/bookstack:/config And - /docker-volume/bookstack_db:/config They are two folders created on the container disk ![Screenshot from 2023-05-27 10-14-16](https://github.com/BookStackApp/BookStack/assets/64996602/845b85ac-261e-4920-8497-6b51f5b7ae0b) But the result doesn't change ![Screenshot from 2023-05-27 10-28-42](https://github.com/BookStackApp/BookStack/assets/64996602/6f417d43-37b4-48f8-8990-860d35db1529) <details><summary>Logs</summary> <p> ``` [2023-05-25 11:48:24] production.ERROR: Error when attempting image upload:Unable to create a directory at /app/www/public/uploads/images/user/2023-05. [2023-05-25 11:48:24] production.ERROR: File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. {"userId":1,"exception":"[object] (BookStack\\Exceptions\\ImageUploadException(code: 0): File path /uploads/images/user/2023-05/foto-mia.jpeg could not be uploaded to. Ensure it is writable to the server. at /app/www/app/Uploads/ImageService.php:174) [stacktrace] #0 /app/www/app/Uploads/ImageService.php(128): BookStack\\Uploads\\ImageService->saveNew() #1 /app/www/app/Uploads/ImageRepo.php(125): BookStack\\Uploads\\ImageService->saveNewFromUpload() #2 /app/www/app/Http/Controllers/UserController.php(159): BookStack\\Uploads\\ImageRepo->saveNew() #3 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): BookStack\\Http\\Controllers\\UserController->update() #4 /app/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction() #5 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch() #6 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController() #7 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run() #8 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}() #9 /app/www/app/Http/Middleware/Authenticate.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #10 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\Authenticate->handle() #11 /app/www/app/Http/Middleware/Localization.php(45): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #12 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\Localization->handle() #13 /app/www/app/Http/Middleware/RunThemeActions.php(26): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #14 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\RunThemeActions->handle() #15 /app/www/app/Http/Middleware/CheckEmailConfirmed.php(47): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #16 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\CheckEmailConfirmed->handle() #17 /app/www/app/Http/Middleware/PreventAuthenticatedResponseCaching.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #18 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\PreventAuthenticatedResponseCaching->handle() #19 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #20 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle() #21 /app/www/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #22 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle() #23 /app/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #24 /app/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest() #25 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle() #26 /app/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #27 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle() #28 /app/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #29 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle() #30 /app/www/app/Http/Middleware/ApplyCspRules.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #31 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\ApplyCspRules->handle() #32 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #33 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Pipeline\\Pipeline->then() #34 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack() #35 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute() #36 /app/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute() #37 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch() #38 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}() #39 /app/www/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #40 /app/www/app/Http/Middleware/TrustProxies.php(41): Illuminate\\Http\\Middleware\\TrustProxies->handle() #41 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BookStack\\Http\\Middleware\\TrustProxies->handle() #42 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #43 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #44 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle() #45 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #46 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle() #47 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #48 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle() #49 /app/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #50 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then() #51 /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter() #52 /app/www/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle() #53 {main} "} ``` </p> </details> ![Screenshot from 2023-05-27 10-37-48](https://github.com/BookStackApp/BookStack/assets/64996602/6556fabe-cf64-422f-8555-bb533d3dd18a) ![Screenshot from 2023-05-27 10-38-33](https://github.com/BookStackApp/BookStack/assets/64996602/e64b7a98-a1a8-4655-8d90-cbf027b3f582) I created this container now and the logs extracted immediately after but the date of the logs is 2023-05-25 both in the LXC container and in the bookstack bash the date is correct ![Screenshot from 2023-05-27 10-35-49](https://github.com/BookStackApp/BookStack/assets/64996602/166d9391-25e5-48cc-acbd-6f31d9f8d6b4) ![Screenshot from 2023-05-27 10-36-16](https://github.com/BookStackApp/BookStack/assets/64996602/0502d7f2-bfc3-4539-a051-60bdddacc438) Regarding /mnt/docker/bookstack I added a disk to the LXC container directly from proxmox ![Screenshot from 2023-05-27 10-23-06](https://github.com/BookStackApp/BookStack/assets/64996602/c6f258dc-1647-48a1-9288-6ea713523587) In /mnt/docker/bookstack I could see created folders and files ![Screenshot from 2023-05-27 10-22-45](https://github.com/BookStackApp/BookStack/assets/64996602/784b96fb-71ef-472b-bdf6-d0187780a545)
Author
Owner

@ssddanbrown commented on GitHub (May 27, 2023):

Thanks for the extra info @nicontinisio.
I specifically asked for storage type information since I've seen issues arise from user running with LXC and ZFS. Then docker is adding an extra layer of complexity/abstraction.

I've just spent some time doing some testing to check my assumptions.
I created two LXC containers on my proxmox system, both LSIO-image bookstack docker-compose setups running on Debian 11, but with one running with the LXC volume on ZFS and the other running on LVM-Thin. The ZFS environment would replicate your exact scenario, whereas the LVM-Thin environment worked as expected.

While I could delve into exactly why this occurs, it'd take a lot more time to research and debug.
From my experience, I'd instead advise not using ZFS for LXC containers, at least for this scenario.


@felixlu07 While you observed error may look similar your root cause will be fundamentally different here. Please can you raise via your own separate dedicated support thread? Assigned permission of the AWS credentials used (For the STORAGE_S3_* options) would be ideal when raising that thread.

@ssddanbrown commented on GitHub (May 27, 2023): Thanks for the extra info @nicontinisio. I specifically asked for storage type information since I've [seen issues arise](https://stackoverflow.com/questions/73186360/innodb-redo0-is-not-a-multiple-of-innodb-page-size/73200473#73200473) from user running with LXC and ZFS. Then docker is adding an extra layer of complexity/abstraction. I've just spent some time doing some testing to check my assumptions. I created two LXC containers on my proxmox system, both LSIO-image bookstack docker-compose setups running on Debian 11, but with one running with the LXC volume on ZFS and the other running on LVM-Thin. The ZFS environment would replicate your exact scenario, whereas the LVM-Thin environment worked as expected. While I could delve into exactly why this occurs, it'd take a lot more time to research and debug. From my experience, I'd instead advise not using ZFS for LXC containers, at least for this scenario. --- @felixlu07 While you observed error may look similar your root cause will be fundamentally different here. Please can you raise via your own separate dedicated support thread? Assigned permission of the AWS credentials used (For the `STORAGE_S3_*` options) would be ideal when raising that thread.
Author
Owner

@nicontinisio commented on GitHub (May 27, 2023):

@ssddanbrown
I currently only have a zfs pool installed on my lab machine and one usb hdd for backups.

I created a LXC with ubuntu and installed bookstack from script.
That's okay the only change was in the traefik configuration, if ZFS doesn't give problems in the future I'll try to use it with docker
Screenshot from 2023-05-27 14-48-08
thanks for the support!

@nicontinisio commented on GitHub (May 27, 2023): @ssddanbrown I currently only have a zfs pool installed on my lab machine and one usb hdd for backups. I created a LXC with ubuntu and installed bookstack from script. That's okay the only change was in the traefik configuration, if ZFS doesn't give problems in the future I'll try to use it with docker ![Screenshot from 2023-05-27 14-48-08](https://github.com/BookStackApp/BookStack/assets/64996602/ce5ffcb0-715a-450e-a304-1c7b8f623af3) thanks for the support!
Author
Owner

@ssddanbrown commented on GitHub (May 27, 2023):

@nicontinisio Good to see you got things going. Will therefore close this off.

@ssddanbrown commented on GitHub (May 27, 2023): @nicontinisio Good to see you got things going. Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3819