Skip to content

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

@nicontinisio

Description

@nicontinisio

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions