[GH-ISSUE #252] [Bug]: Archive files do not show pictures & can not connect with 3mf file #156

Closed
opened 2026-05-06 12:26:30 +02:00 by BreizhHardware · 9 comments

Originally created by @BenGeba on GitHub (Feb 3, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/252

Originally assigned to: @maziggy on GitHub.

Bug Description

When I am in the Archive section and want to assign a .3mf to a GCODE file, I get an error. Images are also not displayed even though they are available.

Expected Behavior

I can see the attached images and link the .3mf files.

Steps to Reproduce

  1. Print something
  2. Go to the archive page
  3. Try to open the photo
  4. Try to connect the .3mf file

Printer Model

P1S

Bambuddy Version

0.1.7

Printer Firmware Version

01.09

Installation Method

Docker

Operating System

Linux (Ubuntu/Debian)

Relevant Logs / Support Package

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/uvicorn/protocols/http/httptools_impl.py", line 416, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.scope, self.receive, self.send
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/fastapi/applications.py", line 1135, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/applications.py", line 107, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 191, in __call__
    with recv_stream, send_stream, collapse_excgroups():
                                   ~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/starlette/_utils.py", line 85, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 193, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/app/main.py", line 2700, in auth_middleware
    return await call_next(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 168, in call_next
    raise app_exc from app_exc.__cause__ or app_exc.__context__
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 144, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.13/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.13/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 115, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 101, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 355, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 243, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/app/api/routes/archives.py", line 2887, in upload_source_3mf
    archive.source_3mf_path = str(source_path.relative_to(settings.base_dir))
                                  ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/pathlib/_local.py", line 385, in relative_to
    raise ValueError(f"{str(self)!r} is not in the subpath of {str(other)!r}")
ValueError: '/app/source/nö-schriftzug.3mf' is not in the subpath of '/app/data'

Screenshots

No response

Additional Context

According to the logs, it saves the file under /app/source/.
However, Bambuddy expects the path to be under settings.base_dir = /app/data and then does:
source_path.relative_to(settings.base_dir)
→ crashes because /app/source/... is not under /app/data/...

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
Originally created by @BenGeba on GitHub (Feb 3, 2026). Original GitHub issue: https://github.com/maziggy/bambuddy/issues/252 Originally assigned to: @maziggy on GitHub. ### Bug Description When I am in the Archive section and want to assign a .3mf to a GCODE file, I get an error. Images are also not displayed even though they are available. ### Expected Behavior I can see the attached images and link the .3mf files. ### Steps to Reproduce 1. Print something 2. Go to the archive page 3. Try to open the photo 4. Try to connect the .3mf file ### Printer Model P1S ### Bambuddy Version 0.1.7 ### Printer Firmware Version 01.09 ### Installation Method Docker ### Operating System Linux (Ubuntu/Debian) ### Relevant Logs / Support Package ```shell ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/uvicorn/protocols/http/httptools_impl.py", line 416, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ self.scope, self.receive, self.send ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.13/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/fastapi/applications.py", line 1135, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/applications.py", line 107, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/usr/local/lib/python3.13/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 191, in __call__ with recv_stream, send_stream, collapse_excgroups(): ~~~~~~~~~~~~~~~~~~^^ File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__ self.gen.throw(value) ~~~~~~~~~~~~~~^^^^^^^ File "/usr/local/lib/python3.13/site-packages/starlette/_utils.py", line 85, in collapse_excgroups raise exc File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 193, in __call__ response = await self.dispatch_func(request, call_next) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/app/main.py", line 2700, in auth_middleware return await call_next(request) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 168, in call_next raise app_exc from app_exc.__cause__ or app_exc.__context__ File "/usr/local/lib/python3.13/site-packages/starlette/middleware/base.py", line 144, in coro await self.app(scope, receive_or_disconnect, send_no_error) File "/usr/local/lib/python3.13/site-packages/starlette/middleware/exceptions.py", line 63, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.13/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/routing.py", line 716, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/routing.py", line 736, in app await route.handle(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/routing.py", line 290, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 115, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app raise exc File "/usr/local/lib/python3.13/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 101, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 355, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... ) ^ File "/usr/local/lib/python3.13/site-packages/fastapi/routing.py", line 243, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/app/api/routes/archives.py", line 2887, in upload_source_3mf archive.source_3mf_path = str(source_path.relative_to(settings.base_dir)) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/pathlib/_local.py", line 385, in relative_to raise ValueError(f"{str(self)!r} is not in the subpath of {str(other)!r}") ValueError: '/app/source/nö-schriftzug.3mf' is not in the subpath of '/app/data' ``` ### Screenshots _No response_ ### Additional Context According to the logs, it saves the file under /app/source/. However, Bambuddy expects the path to be under settings.base_dir = /app/data and then does: source_path.relative_to(settings.base_dir) → crashes because /app/source/... is not under /app/data/... ### 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
BreizhHardware 2026-05-06 12:26:30 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@BenGeba commented on GitHub (Feb 3, 2026):

Also seems to be related to the error https://github.com/maziggy/bambuddy/issues/232

<!-- gh-comment-id:3843291762 --> @BenGeba commented on GitHub (Feb 3, 2026): Also seems to be related to the error https://github.com/maziggy/bambuddy/issues/232
Author
Owner

@maziggy commented on GitHub (Feb 3, 2026):

Did you restart the container after upgrading? To me it looks like the database migration was not done.

<!-- gh-comment-id:3843363538 --> @maziggy commented on GitHub (Feb 3, 2026): Did you restart the container after upgrading? To me it looks like the database migration was not done.
Author
Owner

@BenGeba commented on GitHub (Feb 3, 2026):

It was a fresh install from docker compose

<!-- gh-comment-id:3843368779 --> @BenGeba commented on GitHub (Feb 3, 2026): It was a fresh install from docker compose
Author
Owner

@maziggy commented on GitHub (Feb 3, 2026):

Just to make sure, please rebuild the image.

<!-- gh-comment-id:3843398650 --> @maziggy commented on GitHub (Feb 3, 2026): Just to make sure, please rebuild the image.
Author
Owner

@BenGeba commented on GitHub (Feb 3, 2026):

Apparently, there was an error caused by Komodo (a Portainer alternative). I removed and deleted the container from the compose there and added it again using the installation script. Now it works. But I wonder why there were errors with Komodo?

<!-- gh-comment-id:3843896610 --> @BenGeba commented on GitHub (Feb 3, 2026): Apparently, there was an error caused by Komodo (a Portainer alternative). I removed and deleted the container from the compose there and added it again using the installation script. Now it works. But I wonder why there were errors with Komodo?
Author
Owner

@andretietz commented on GitHub (Feb 3, 2026):

Good that you mention that. I am having the same problem using the P2S. But I am running on the prebuild images from github. @BenGeba did you try if the prebuild one for you has the same problem?
If so, the image build has an issue somehow.

<!-- gh-comment-id:3844412369 --> @andretietz commented on GitHub (Feb 3, 2026): Good that you mention that. I am having the same problem using the P2S. But I am running on the prebuild images from github. @BenGeba did you try if the prebuild one for you has the same problem? If so, the image build has an issue somehow.
Author
Owner

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

Sorry, I don't know Komodo at all.

<!-- gh-comment-id:3845618701 --> @maziggy commented on GitHub (Feb 4, 2026): Sorry, I don't know Komodo at all.
Author
Owner

@andretietz commented on GitHub (Feb 4, 2026):

@maziggy

If the pre built images from bambuddy (the ones you provide) are broken as well, this is not related to komodo.
Please verify at least, that the prebuild images work as intended, they don't work for me though

<!-- gh-comment-id:3849377014 --> @andretietz commented on GitHub (Feb 4, 2026): @maziggy If the pre built images from bambuddy (the ones you provide) are broken as well, this is not related to komodo. Please verify at least, that the prebuild images work as intended, they don't work for me though
Author
Owner

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

The images are not broken. As already said it looks like a migration task was not triggered when you upgraded your installation. I can only suggest to do a clean install and watch the logs for errors.

<!-- gh-comment-id:3849578310 --> @maziggy commented on GitHub (Feb 4, 2026): The images are not broken. As already said it looks like a migration task was not triggered when you upgraded your installation. I can only suggest to do a clean install and watch the logs for errors.
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#156
No description provided.