[GH-ISSUE #592] [Bug]: virtual_printer directories can not be created in the Docker container #385

Closed
opened 2026-05-06 12:28:59 +02:00 by BreizhHardware · 1 comment

Originally created by @bandesz on GitHub (Mar 4, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/592

Originally assigned to: @maziggy on GitHub.

Bug Description

This is what I see in the container logs on the first start:

2026-03-04 12:00:38,364 ERROR [backend.app.services.virtual_printer.manager] Cannot create directory /app/data/virtual_printer/uploads: Permission denied. For Docker: ensure the data volume is writable by the container user. For bare metal: run 'sudo chown -R $(whoami) /app/data/virtual_printer'
2026-03-04 12:00:38,364 ERROR [backend.app.services.virtual_printer.manager] Cannot create directory /app/data/virtual_printer/certs: Permission denied. For Docker: ensure the data volume is writable by the container user. For bare metal: run 'sudo chown -R $(whoami) /app/data/virtual_printer'

If I exec in, I see that the virtual_printer directory is owned by root:

ls -l /app/data/
total 952
drwxr-xr-x 2 1000 1000   4096 Mar  4 12:00 archive
-rw-r--r-- 1 1000 1000   4096 Mar  4 12:00 bambuddy.db
-rw-r--r-- 1 1000 1000  32768 Mar  4 12:00 bambuddy.db-shm
-rw-r--r-- 1 1000 1000 922912 Mar  4 12:00 bambuddy.db-wal
drwxr-xr-x 2 1000 1000   4096 Mar  4 12:00 plate_calibration
drwxr-xr-x 2 root root   4096 Mar  4 11:57 virtual_printer

Expected Behavior

virtual_printer subdirectories are successfully created

Steps to Reproduce

In a Linux environment:

  1. Checkout bambuddy (v0.2.1.1 or current master)
  2. docker compose up -d

Printer Model

P1S

Bambuddy Version

v0.2.1.1

Printer Firmware Version

Installation Method

Manual (git clone)

Operating System

Linux (Ubuntu/Debian)

Relevant Logs / Support Package


Screenshots

No response

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this bug hasn't already been reported
  • I am using the latest version of Bambuddy
  • My printer is set to LAN Only mode
  • My printer has Developer Mode enabled
Originally created by @bandesz on GitHub (Mar 4, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/592 Originally assigned to: @maziggy on GitHub. ### Bug Description This is what I see in the container logs on the first start: ``` 2026-03-04 12:00:38,364 ERROR [backend.app.services.virtual_printer.manager] Cannot create directory /app/data/virtual_printer/uploads: Permission denied. For Docker: ensure the data volume is writable by the container user. For bare metal: run 'sudo chown -R $(whoami) /app/data/virtual_printer' 2026-03-04 12:00:38,364 ERROR [backend.app.services.virtual_printer.manager] Cannot create directory /app/data/virtual_printer/certs: Permission denied. For Docker: ensure the data volume is writable by the container user. For bare metal: run 'sudo chown -R $(whoami) /app/data/virtual_printer' ``` If I exec in, I see that the virtual_printer directory is owned by root: ``` ls -l /app/data/ total 952 drwxr-xr-x 2 1000 1000 4096 Mar 4 12:00 archive -rw-r--r-- 1 1000 1000 4096 Mar 4 12:00 bambuddy.db -rw-r--r-- 1 1000 1000 32768 Mar 4 12:00 bambuddy.db-shm -rw-r--r-- 1 1000 1000 922912 Mar 4 12:00 bambuddy.db-wal drwxr-xr-x 2 1000 1000 4096 Mar 4 12:00 plate_calibration drwxr-xr-x 2 root root 4096 Mar 4 11:57 virtual_printer ``` ### Expected Behavior virtual_printer subdirectories are successfully created ### Steps to Reproduce In a Linux environment: 1. Checkout bambuddy (v0.2.1.1 or current master) 2. docker compose up -d ### Printer Model P1S ### Bambuddy Version v0.2.1.1 ### Printer Firmware Version - ### Installation Method Manual (git clone) ### Operating System Linux (Ubuntu/Debian) ### Relevant Logs / Support Package ```shell ``` ### Screenshots _No response_ ### Additional Context _No response_ ### Checklist - [x] I have searched existing issues to ensure this bug hasn't already been reported - [x] I am using the latest version of Bambuddy - [x] My printer is set to LAN Only mode - [x] My printer has Developer Mode enabled
BreizhHardware 2026-05-06 12:28:59 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@maziggy commented on GitHub (Mar 4, 2026):

This looks like a permissions issue from switching how the container runs. By default, the Bambuddy container runs as root (there's no USER directive in the Dockerfile), so all directories get created without issues.

Your ls output shows most of /app/data/ owned by 1000:1000, but virtual_printer owned by root:root — and with an earlier timestamp (11:57 vs 12:00). This suggests virtual_printer was created during a previous run as root, and then on a subsequent run the container started as UID 1000 (e.g. via user: "1000:1000" in your docker-compose.yml), which can't create subdirectories inside the root-owned folder.

You can fix this on the host by running:

sudo chown -R 1000:1000 /path/to/your/data/virtual_printer

(Replace /path/to/your/data/ with wherever your data volume is mounted from.)


If you find Bambuddy useful, please consider giving it a on GitHub — it helps others discover the project!

<!-- gh-comment-id:3997847321 --> @maziggy commented on GitHub (Mar 4, 2026): This looks like a permissions issue from switching how the container runs. By default, the Bambuddy container runs as root (there's no USER directive in the Dockerfile), so all directories get created without issues. Your ls output shows most of /app/data/ owned by 1000:1000, but virtual_printer owned by root:root — and with an earlier timestamp (11:57 vs 12:00). This suggests virtual_printer was created during a previous run as root, and then on a subsequent run the container started as UID 1000 (e.g. via user: "1000:1000" in your docker-compose.yml), which can't create subdirectories inside the root-owned folder. You can fix this on the host by running: sudo chown -R 1000:1000 /path/to/your/data/virtual_printer (Replace /path/to/your/data/ with wherever your data volume is mounted from.) ----- If you find Bambuddy useful, please consider giving it a ⭐ on [GitHub](https://github.com/bambuman/bambuddy) — it helps others discover the project!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#385
No description provided.