[GH-ISSUE #10976] Image generation turned on does not pass the generated image to the LLM. #16098

Closed
opened 2026-04-19 22:07:37 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @xblaauw on GitHub (Feb 28, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/10976

Image

yields this error log:

open-webui-1  | 2025-02-28 11:12:00.261 | INFO     | open_webui.routers.files:upload_file:42 - file.content_type: image/png - {}
open-webui-1  | 2025-02-28 11:12:00.735 | ERROR    | open_webui.routers.retrieval:process_file:1071 - Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png - {}
open-webui-1  | Traceback (most recent call last):
open-webui-1  | 
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 43, in lazy_load
open-webui-1  |     text = f.read()
open-webui-1  |            │ └ <method 'read' of '_io.TextIOWrapper' objects>
open-webui-1  |            └ <_io.TextIOWrapper name='/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png' mode='r' encodin...
open-webui-1  |   File "<frozen codecs>", line 322, in decode
open-webui-1  | 
open-webui-1  | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
open-webui-1  | 
open-webui-1  | 
open-webui-1  | During handling of the above exception, another exception occurred:
open-webui-1  | 
open-webui-1  | 
open-webui-1  | Traceback (most recent call last):
open-webui-1  | 
open-webui-1  |   File "/usr/local/bin/uvicorn", line 10, in <module>
open-webui-1  |     sys.exit(main())
open-webui-1  |     │   │    └ <Command main>
open-webui-1  |     │   └ <built-in function exit>
open-webui-1  |     └ <module 'sys' (built-in)>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
open-webui-1  |     return self.main(*args, **kwargs)
open-webui-1  |            │    │     │       └ {}
open-webui-1  |            │    │     └ ()
open-webui-1  |            │    └ <function BaseCommand.main at 0x7f9f4b751da0>
open-webui-1  |            └ <Command main>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main
open-webui-1  |     rv = self.invoke(ctx)
open-webui-1  |          │    │      └ <click.core.Context object at 0x7f9f4c438c90>
open-webui-1  |          │    └ <function Command.invoke at 0x7f9f4b752980>
open-webui-1  |          └ <Command main>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
open-webui-1  |     return ctx.invoke(self.callback, **ctx.params)
open-webui-1  |            │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'...
open-webui-1  |            │   │      │    │           └ <click.core.Context object at 0x7f9f4c438c90>
open-webui-1  |            │   │      │    └ <function main at 0x7f9f4b232d40>
open-webui-1  |            │   │      └ <Command main>
open-webui-1  |            │   └ <function Context.invoke at 0x7f9f4b751300>
open-webui-1  |            └ <click.core.Context object at 0x7f9f4c438c90>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke
open-webui-1  |     return __callback(*args, **kwargs)
open-webui-1  |                        │       └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'...
open-webui-1  |                        └ ()
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main
open-webui-1  |     run(
open-webui-1  |     └ <function run at 0x7f9f4b6a7ce0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 577, in run
open-webui-1  |     server.run()
open-webui-1  |     │      └ <function Server.run at 0x7f9f4b5d9080>
open-webui-1  |     └ <uvicorn.server.Server object at 0x7f9f4b778a50>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
open-webui-1  |     return asyncio.run(self.serve(sockets=sockets))
open-webui-1  |            │       │   │    │             └ None
open-webui-1  |            │       │   │    └ <function Server.serve at 0x7f9f4b5d9120>
open-webui-1  |            │       │   └ <uvicorn.server.Server object at 0x7f9f4b778a50>
open-webui-1  |            │       └ <function run at 0x7f9f4baecb80>
open-webui-1  |            └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
open-webui-1  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
open-webui-1  |     return runner.run(main)
open-webui-1  |            │      │   └ <coroutine object Server.serve at 0x7f9f4b505f30>
open-webui-1  |            │      └ <function Runner.run at 0x7f9f4b958720>
open-webui-1  |            └ <asyncio.runners.Runner object at 0x7f9f4b237a50>
open-webui-1  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
open-webui-1  |     return self._loop.run_until_complete(task)
open-webui-1  |            │    │     │                  └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:69> wai...
open-webui-1  |            │    │     └ <cyfunction Loop.run_until_complete at 0x7f9f4b274380>
open-webui-1  |            │    └ <uvloop.Loop running=True closed=False debug=False>
open-webui-1  |            └ <asyncio.runners.Runner object at 0x7f9f4b237a50>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
open-webui-1  |     await self.app(scope, receive_or_disconnect, send_no_error)
open-webui-1  |           │    │   │      │                      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0>
open-webui-1  |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90>
open-webui-1  |           └ <open_webui.main.RedirectMiddleware object at 0x7f9f173e1650>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
open-webui-1  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
open-webui-1  |           │                            │    │    │     │      │        └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0>
open-webui-1  |           │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │                            │    │    └ <starlette.requests.Request object at 0x7f9f15bd7790>
open-webui-1  |           │                            │    └ <fastapi.routing.APIRouter object at 0x7f9f18378b10>
open-webui-1  |           │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90>
open-webui-1  |           └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
open-webui-1  |     await app(scope, receive, sender)
open-webui-1  |           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           └ <fastapi.routing.APIRouter object at 0x7f9f18378b10>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
open-webui-1  |     await self.middleware_stack(scope, receive, send)
open-webui-1  |           │    │                │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f9f18378b10>>
open-webui-1  |           └ <fastapi.routing.APIRouter object at 0x7f9f18378b10>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
open-webui-1  |     await route.handle(scope, receive, send)
open-webui-1  |           │     │      │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │     └ <function Route.handle at 0x7f9f48abba60>
open-webui-1  |           └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
open-webui-1  |     await self.app(scope, receive, send)
open-webui-1  |           │    │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │    └ <function request_response.<locals>.app at 0x7f9f16f718a0>
open-webui-1  |           └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
open-webui-1  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
open-webui-1  |           │                            │    │        │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │                            │    └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |           │                            └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860>
open-webui-1  |           └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
open-webui-1  |     await app(scope, receive, sender)
open-webui-1  |           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375120>
open-webui-1  |           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
open-webui-1  |     response = await f(request)
open-webui-1  |                      │ └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |                      └ <function get_request_handler.<locals>.app at 0x7f9f16f72980>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
open-webui-1  |     raw_response = await run_endpoint_function(
open-webui-1  |                          └ <function run_endpoint_function at 0x7f9f48c698a0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
open-webui-1  |     return await dependant.call(**values)
open-webui-1  |                  │         │      └ {'user': UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profi...
open-webui-1  |                  │         └ <function chat_completion at 0x7f9f16fe1a80>
open-webui-1  |                  └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/main.py", line 1039, in chat_completion
open-webui-1  |     form_data, metadata, events = await process_chat_payload(
open-webui-1  |     │          │                        └ <function process_chat_payload at 0x7f9f18360c20>
open-webui-1  |     │          └ {'user_id': 'ca7dc3d6-c831-4c4d-b55b-265d227c3359', 'chat_id': 'cf61100c-5108-451f-a4d2-f30dc8012b1f', 'message_id': '1798f3d...
open-webui-1  |{'stream': True, 'model': 'anthropic.claude-3-5-haiku-latest', 'messages': [{'role': 'user', 'content': 'a circus elephant ba...
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/utils/middleware.py", line 728, in process_chat_payload
open-webui-1  |     form_data = await chat_image_generation_handler(
open-webui-1  |                       └ <function chat_image_generation_handler at 0x7f9f18360e00>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/utils/middleware.py", line 472, in chat_image_generation_handler
open-webui-1  |     images = await image_generations(
open-webui-1  |                    └ <function image_generations at 0x7f9f1b811800>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/images.py", line 521, in image_generations
open-webui-1  |     url = upload_image(request, data, image_data, content_type, user)
open-webui-1  |           │            │        │     │           │             └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_...
open-webui-1  |           │            │        │     │           └ 'image/png'
open-webui-1  |           │            │        │     └ b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x...
open-webui-1  |           │            │        └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ...
open-webui-1  |           │            └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |           └ <function upload_image at 0x7f9f1b8116c0>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/images.py", line 462, in upload_image
open-webui-1  |     file_item = upload_file(request, file, user, file_metadata=image_metadata)
open-webui-1  |                 │           │        │     │                   └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ...
open-webui-1  |                 │           │        │     └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_...
open-webui-1  |                 │           │        └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'})
open-webui-1  |                 │           └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |                 └ <function upload_file at 0x7f9f2304a520>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/files.py", line 85, in upload_file
open-webui-1  |     process_file(request, ProcessFileForm(file_id=id), user=user)
open-webui-1  |     │            │        │                       │         └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_...
open-webui-1  |     │            │        │                       └ '587d7b2e-a089-4ca4-b478-555c6e8bd09d'
open-webui-1  |     │            │        └ <class 'open_webui.routers.retrieval.ProcessFileForm'>
open-webui-1  |     │            └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |     └ <function process_file at 0x7f9f1b94c220>
open-webui-1  | 
open-webui-1  | > File "/app/backend/open_webui/routers/retrieval.py", line 990, in process_file
open-webui-1  |     docs = loader.load(
open-webui-1  |            │      └ <function Loader.load at 0x7f9f20b22ac0>
open-webui-1  |            └ <open_webui.retrieval.loaders.main.Loader object at 0x7f9f14f09f10>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/retrieval/loaders/main.py", line 129, in load
open-webui-1  |     docs = loader.load()
open-webui-1  |            │      └ <function BaseLoader.load at 0x7f9f217b4b80>
open-webui-1  |            └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0>
open-webui-1  | 
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_core/document_loaders/base.py", line 31, in load
open-webui-1  |     return list(self.lazy_load())
open-webui-1  |                 │    └ <function TextLoader.lazy_load at 0x7f9f20b20e00>
open-webui-1  |                 └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 46, in lazy_load
open-webui-1  |     detected_encodings = detect_file_encodings(self.file_path)
open-webui-1  |                          │                     │    └ '/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png'
open-webui-1  |                          │                     └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0>
open-webui-1  |                          └ <function detect_file_encodings at 0x7f9f217b5d00>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/helpers.py", line 50, in detect_file_encodings
open-webui-1  |     raise RuntimeError(f"Could not detect encoding for {file_path}")
open-webui-1  | 
open-webui-1  | RuntimeError: Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png
open-webui-1  | 2025-02-28 11:12:00.747 | ERROR    | open_webui.routers.files:upload_file:89 - 400: Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png - {}
open-webui-1  | Traceback (most recent call last):
open-webui-1  | 
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 43, in lazy_load
open-webui-1  |     text = f.read()
open-webui-1  |            │ └ <method 'read' of '_io.TextIOWrapper' objects>
open-webui-1  |            └ <_io.TextIOWrapper name='/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png' mode='r' encodin...
open-webui-1  |   File "<frozen codecs>", line 322, in decode
open-webui-1  | 
open-webui-1  | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
open-webui-1  | 
open-webui-1  | 
open-webui-1  | During handling of the above exception, another exception occurred:
open-webui-1  | 
open-webui-1  | 
open-webui-1  | Traceback (most recent call last):
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/retrieval.py", line 990, in process_file
open-webui-1  |     docs = loader.load(
open-webui-1  |            │      └ <function Loader.load at 0x7f9f20b22ac0>
open-webui-1  |            └ <open_webui.retrieval.loaders.main.Loader object at 0x7f9f14f09f10>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/retrieval/loaders/main.py", line 129, in load
open-webui-1  |     docs = loader.load()
open-webui-1  |            │      └ <function BaseLoader.load at 0x7f9f217b4b80>
open-webui-1  |            └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0>
open-webui-1  | 
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_core/document_loaders/base.py", line 31, in load
open-webui-1  |     return list(self.lazy_load())
open-webui-1  |                 │    └ <function TextLoader.lazy_load at 0x7f9f20b20e00>
open-webui-1  |                 └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 46, in lazy_load
open-webui-1  |     detected_encodings = detect_file_encodings(self.file_path)
open-webui-1  |                          │                     │    └ '/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png'
open-webui-1  |                          │                     └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0>
open-webui-1  |                          └ <function detect_file_encodings at 0x7f9f217b5d00>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/helpers.py", line 50, in detect_file_encodings
open-webui-1  |     raise RuntimeError(f"Could not detect encoding for {file_path}")
open-webui-1  | 
open-webui-1  | RuntimeError: Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png
open-webui-1  | 
open-webui-1  | 
open-webui-1  | During handling of the above exception, another exception occurred:
open-webui-1  | 
open-webui-1  | 
open-webui-1  | Traceback (most recent call last):
open-webui-1  | 
open-webui-1  |   File "/usr/local/bin/uvicorn", line 10, in <module>
open-webui-1  |     sys.exit(main())
open-webui-1  |     │   │    └ <Command main>
open-webui-1  |     │   └ <built-in function exit>
open-webui-1  |     └ <module 'sys' (built-in)>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
open-webui-1  |     return self.main(*args, **kwargs)
open-webui-1  |            │    │     │       └ {}
open-webui-1  |            │    │     └ ()
open-webui-1  |            │    └ <function BaseCommand.main at 0x7f9f4b751da0>
open-webui-1  |            └ <Command main>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main
open-webui-1  |     rv = self.invoke(ctx)
open-webui-1  |          │    │      └ <click.core.Context object at 0x7f9f4c438c90>
open-webui-1  |          │    └ <function Command.invoke at 0x7f9f4b752980>
open-webui-1  |          └ <Command main>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
open-webui-1  |     return ctx.invoke(self.callback, **ctx.params)
open-webui-1  |            │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'...
open-webui-1  |            │   │      │    │           └ <click.core.Context object at 0x7f9f4c438c90>
open-webui-1  |            │   │      │    └ <function main at 0x7f9f4b232d40>
open-webui-1  |            │   │      └ <Command main>
open-webui-1  |            │   └ <function Context.invoke at 0x7f9f4b751300>
open-webui-1  |            └ <click.core.Context object at 0x7f9f4c438c90>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke
open-webui-1  |     return __callback(*args, **kwargs)
open-webui-1  |                        │       └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'...
open-webui-1  |                        └ ()
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main
open-webui-1  |     run(
open-webui-1  |     └ <function run at 0x7f9f4b6a7ce0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 577, in run
open-webui-1  |     server.run()
open-webui-1  |     │      └ <function Server.run at 0x7f9f4b5d9080>
open-webui-1  |     └ <uvicorn.server.Server object at 0x7f9f4b778a50>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
open-webui-1  |     return asyncio.run(self.serve(sockets=sockets))
open-webui-1  |            │       │   │    │             └ None
open-webui-1  |            │       │   │    └ <function Server.serve at 0x7f9f4b5d9120>
open-webui-1  |            │       │   └ <uvicorn.server.Server object at 0x7f9f4b778a50>
open-webui-1  |            │       └ <function run at 0x7f9f4baecb80>
open-webui-1  |            └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
open-webui-1  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
open-webui-1  |     return runner.run(main)
open-webui-1  |            │      │   └ <coroutine object Server.serve at 0x7f9f4b505f30>
open-webui-1  |            │      └ <function Runner.run at 0x7f9f4b958720>
open-webui-1  |            └ <asyncio.runners.Runner object at 0x7f9f4b237a50>
open-webui-1  |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
open-webui-1  |     return self._loop.run_until_complete(task)
open-webui-1  |            │    │     │                  └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:69> wai...
open-webui-1  |            │    │     └ <cyfunction Loop.run_until_complete at 0x7f9f4b274380>
open-webui-1  |            │    └ <uvloop.Loop running=True closed=False debug=False>
open-webui-1  |            └ <asyncio.runners.Runner object at 0x7f9f4b237a50>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
open-webui-1  |     await self.app(scope, receive_or_disconnect, send_no_error)
open-webui-1  |           │    │   │      │                      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0>
open-webui-1  |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90>
open-webui-1  |           └ <open_webui.main.RedirectMiddleware object at 0x7f9f173e1650>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
open-webui-1  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
open-webui-1  |           │                            │    │    │     │      │        └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0>
open-webui-1  |           │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │                            │    │    └ <starlette.requests.Request object at 0x7f9f15bd7790>
open-webui-1  |           │                            │    └ <fastapi.routing.APIRouter object at 0x7f9f18378b10>
open-webui-1  |           │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90>
open-webui-1  |           └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
open-webui-1  |     await app(scope, receive, sender)
open-webui-1  |           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           └ <fastapi.routing.APIRouter object at 0x7f9f18378b10>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
open-webui-1  |     await self.middleware_stack(scope, receive, send)
open-webui-1  |           │    │                │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f9f18378b10>>
open-webui-1  |           └ <fastapi.routing.APIRouter object at 0x7f9f18378b10>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
open-webui-1  |     await route.handle(scope, receive, send)
open-webui-1  |           │     │      │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │     └ <function Route.handle at 0x7f9f48abba60>
open-webui-1  |           └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
open-webui-1  |     await self.app(scope, receive, send)
open-webui-1  |           │    │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │    └ <function request_response.<locals>.app at 0x7f9f16f718a0>
open-webui-1  |           └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
open-webui-1  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
open-webui-1  |           │                            │    │        │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60>
open-webui-1  |           │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           │                            │    └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |           │                            └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860>
open-webui-1  |           └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
open-webui-1  |     await app(scope, receive, sender)
open-webui-1  |           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375120>
open-webui-1  |           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560>
open-webui-1  |           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c...
open-webui-1  |           └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
open-webui-1  |     response = await f(request)
open-webui-1  |                      │ └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |                      └ <function get_request_handler.<locals>.app at 0x7f9f16f72980>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
open-webui-1  |     raw_response = await run_endpoint_function(
open-webui-1  |                          └ <function run_endpoint_function at 0x7f9f48c698a0>
open-webui-1  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
open-webui-1  |     return await dependant.call(**values)
open-webui-1  |                  │         │      └ {'user': UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profi...
open-webui-1  |                  │         └ <function chat_completion at 0x7f9f16fe1a80>
open-webui-1  |                  └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/main.py", line 1039, in chat_completion
open-webui-1  |     form_data, metadata, events = await process_chat_payload(
open-webui-1  |     │          │                        └ <function process_chat_payload at 0x7f9f18360c20>
open-webui-1  |     │          └ {'user_id': 'ca7dc3d6-c831-4c4d-b55b-265d227c3359', 'chat_id': 'cf61100c-5108-451f-a4d2-f30dc8012b1f', 'message_id': '1798f3d...
open-webui-1  |{'stream': True, 'model': 'anthropic.claude-3-5-haiku-latest', 'messages': [{'role': 'user', 'content': 'a circus elephant ba...
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/utils/middleware.py", line 728, in process_chat_payload
open-webui-1  |     form_data = await chat_image_generation_handler(
open-webui-1  |                       └ <function chat_image_generation_handler at 0x7f9f18360e00>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/utils/middleware.py", line 472, in chat_image_generation_handler
open-webui-1  |     images = await image_generations(
open-webui-1  |                    └ <function image_generations at 0x7f9f1b811800>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/images.py", line 521, in image_generations
open-webui-1  |     url = upload_image(request, data, image_data, content_type, user)
open-webui-1  |           │            │        │     │           │             └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_...
open-webui-1  |           │            │        │     │           └ 'image/png'
open-webui-1  |           │            │        │     └ b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x...
open-webui-1  |           │            │        └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ...
open-webui-1  |           │            └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |           └ <function upload_image at 0x7f9f1b8116c0>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/images.py", line 462, in upload_image
open-webui-1  |     file_item = upload_file(request, file, user, file_metadata=image_metadata)
open-webui-1  |                 │           │        │     │                   └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ...
open-webui-1  |                 │           │        │     └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_...
open-webui-1  |                 │           │        └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'})
open-webui-1  |                 │           └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |                 └ <function upload_file at 0x7f9f2304a520>
open-webui-1  | 
open-webui-1  | > File "/app/backend/open_webui/routers/files.py", line 85, in upload_file
open-webui-1  |     process_file(request, ProcessFileForm(file_id=id), user=user)
open-webui-1  |     │            │        │                       │         └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_...
open-webui-1  |     │            │        │                       └ '587d7b2e-a089-4ca4-b478-555c6e8bd09d'
open-webui-1  |     │            │        └ <class 'open_webui.routers.retrieval.ProcessFileForm'>
open-webui-1  |     │            └ <starlette.requests.Request object at 0x7f9f15bd62d0>
open-webui-1  |     └ <function process_file at 0x7f9f1b94c220>
open-webui-1  | 
open-webui-1  |   File "/app/backend/open_webui/routers/retrieval.py", line 1078, in process_file
open-webui-1  |     raise HTTPException(
open-webui-1  |           └ <class 'fastapi.exceptions.HTTPException'>
Originally created by @xblaauw on GitHub (Feb 28, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/10976 ![Image](https://github.com/user-attachments/assets/ab0d90b4-55a1-46ff-8de8-91779c7776e1) yields this error log: ```sh open-webui-1 | 2025-02-28 11:12:00.261 | INFO | open_webui.routers.files:upload_file:42 - file.content_type: image/png - {} open-webui-1 | 2025-02-28 11:12:00.735 | ERROR | open_webui.routers.retrieval:process_file:1071 - Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png - {} open-webui-1 | Traceback (most recent call last): open-webui-1 | open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 43, in lazy_load open-webui-1 | text = f.read() open-webui-1 | │ └ <method 'read' of '_io.TextIOWrapper' objects> open-webui-1 | └ <_io.TextIOWrapper name='/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png' mode='r' encodin... open-webui-1 | File "<frozen codecs>", line 322, in decode open-webui-1 | open-webui-1 | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte open-webui-1 | open-webui-1 | open-webui-1 | During handling of the above exception, another exception occurred: open-webui-1 | open-webui-1 | open-webui-1 | Traceback (most recent call last): open-webui-1 | open-webui-1 | File "/usr/local/bin/uvicorn", line 10, in <module> open-webui-1 | sys.exit(main()) open-webui-1 | │ │ └ <Command main> open-webui-1 | │ └ <built-in function exit> open-webui-1 | └ <module 'sys' (built-in)> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__ open-webui-1 | return self.main(*args, **kwargs) open-webui-1 | │ │ │ └ {} open-webui-1 | │ │ └ () open-webui-1 | │ └ <function BaseCommand.main at 0x7f9f4b751da0> open-webui-1 | └ <Command main> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main open-webui-1 | rv = self.invoke(ctx) open-webui-1 | │ │ └ <click.core.Context object at 0x7f9f4c438c90> open-webui-1 | │ └ <function Command.invoke at 0x7f9f4b752980> open-webui-1 | └ <Command main> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke open-webui-1 | return ctx.invoke(self.callback, **ctx.params) open-webui-1 | │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'... open-webui-1 | │ │ │ │ └ <click.core.Context object at 0x7f9f4c438c90> open-webui-1 | │ │ │ └ <function main at 0x7f9f4b232d40> open-webui-1 | │ │ └ <Command main> open-webui-1 | │ └ <function Context.invoke at 0x7f9f4b751300> open-webui-1 | └ <click.core.Context object at 0x7f9f4c438c90> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke open-webui-1 | return __callback(*args, **kwargs) open-webui-1 | │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'... open-webui-1 | └ () open-webui-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main open-webui-1 | run( open-webui-1 | └ <function run at 0x7f9f4b6a7ce0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 577, in run open-webui-1 | server.run() open-webui-1 | │ └ <function Server.run at 0x7f9f4b5d9080> open-webui-1 | └ <uvicorn.server.Server object at 0x7f9f4b778a50> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run open-webui-1 | return asyncio.run(self.serve(sockets=sockets)) open-webui-1 | │ │ │ │ └ None open-webui-1 | │ │ │ └ <function Server.serve at 0x7f9f4b5d9120> open-webui-1 | │ │ └ <uvicorn.server.Server object at 0x7f9f4b778a50> open-webui-1 | │ └ <function run at 0x7f9f4baecb80> open-webui-1 | └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> open-webui-1 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run open-webui-1 | return runner.run(main) open-webui-1 | │ │ └ <coroutine object Server.serve at 0x7f9f4b505f30> open-webui-1 | │ └ <function Runner.run at 0x7f9f4b958720> open-webui-1 | └ <asyncio.runners.Runner object at 0x7f9f4b237a50> open-webui-1 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run open-webui-1 | return self._loop.run_until_complete(task) open-webui-1 | │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:69> wai... open-webui-1 | │ │ └ <cyfunction Loop.run_until_complete at 0x7f9f4b274380> open-webui-1 | │ └ <uvloop.Loop running=True closed=False debug=False> open-webui-1 | └ <asyncio.runners.Runner object at 0x7f9f4b237a50> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro open-webui-1 | await self.app(scope, receive_or_disconnect, send_no_error) open-webui-1 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90> open-webui-1 | └ <open_webui.main.RedirectMiddleware object at 0x7f9f173e1650> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ open-webui-1 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) open-webui-1 | │ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0> open-webui-1 | │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ │ │ └ <starlette.requests.Request object at 0x7f9f15bd7790> open-webui-1 | │ │ └ <fastapi.routing.APIRouter object at 0x7f9f18378b10> open-webui-1 | │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90> open-webui-1 | └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app open-webui-1 | await app(scope, receive, sender) open-webui-1 | │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | └ <fastapi.routing.APIRouter object at 0x7f9f18378b10> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ open-webui-1 | await self.middleware_stack(scope, receive, send) open-webui-1 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f9f18378b10>> open-webui-1 | └ <fastapi.routing.APIRouter object at 0x7f9f18378b10> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app open-webui-1 | await route.handle(scope, receive, send) open-webui-1 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <function Route.handle at 0x7f9f48abba60> open-webui-1 | └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle open-webui-1 | await self.app(scope, receive, send) open-webui-1 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <function request_response.<locals>.app at 0x7f9f16f718a0> open-webui-1 | └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app open-webui-1 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) open-webui-1 | │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | │ └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860> open-webui-1 | └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app open-webui-1 | await app(scope, receive, sender) open-webui-1 | │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375120> open-webui-1 | │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app open-webui-1 | response = await f(request) open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function get_request_handler.<locals>.app at 0x7f9f16f72980> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app open-webui-1 | raw_response = await run_endpoint_function( open-webui-1 | └ <function run_endpoint_function at 0x7f9f48c698a0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function open-webui-1 | return await dependant.call(**values) open-webui-1 | │ │ └ {'user': UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profi... open-webui-1 | │ └ <function chat_completion at 0x7f9f16fe1a80> open-webui-1 | └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... open-webui-1 | open-webui-1 | File "/app/backend/open_webui/main.py", line 1039, in chat_completion open-webui-1 | form_data, metadata, events = await process_chat_payload( open-webui-1 | │ │ └ <function process_chat_payload at 0x7f9f18360c20> open-webui-1 | │ └ {'user_id': 'ca7dc3d6-c831-4c4d-b55b-265d227c3359', 'chat_id': 'cf61100c-5108-451f-a4d2-f30dc8012b1f', 'message_id': '1798f3d... open-webui-1 | └ {'stream': True, 'model': 'anthropic.claude-3-5-haiku-latest', 'messages': [{'role': 'user', 'content': 'a circus elephant ba... open-webui-1 | open-webui-1 | File "/app/backend/open_webui/utils/middleware.py", line 728, in process_chat_payload open-webui-1 | form_data = await chat_image_generation_handler( open-webui-1 | └ <function chat_image_generation_handler at 0x7f9f18360e00> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/utils/middleware.py", line 472, in chat_image_generation_handler open-webui-1 | images = await image_generations( open-webui-1 | └ <function image_generations at 0x7f9f1b811800> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/images.py", line 521, in image_generations open-webui-1 | url = upload_image(request, data, image_data, content_type, user) open-webui-1 | │ │ │ │ │ └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_... open-webui-1 | │ │ │ │ └ 'image/png' open-webui-1 | │ │ │ └ b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x... open-webui-1 | │ │ └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ... open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function upload_image at 0x7f9f1b8116c0> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/images.py", line 462, in upload_image open-webui-1 | file_item = upload_file(request, file, user, file_metadata=image_metadata) open-webui-1 | │ │ │ │ └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ... open-webui-1 | │ │ │ └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_... open-webui-1 | │ │ └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'}) open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function upload_file at 0x7f9f2304a520> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/files.py", line 85, in upload_file open-webui-1 | process_file(request, ProcessFileForm(file_id=id), user=user) open-webui-1 | │ │ │ │ └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_... open-webui-1 | │ │ │ └ '587d7b2e-a089-4ca4-b478-555c6e8bd09d' open-webui-1 | │ │ └ <class 'open_webui.routers.retrieval.ProcessFileForm'> open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function process_file at 0x7f9f1b94c220> open-webui-1 | open-webui-1 | > File "/app/backend/open_webui/routers/retrieval.py", line 990, in process_file open-webui-1 | docs = loader.load( open-webui-1 | │ └ <function Loader.load at 0x7f9f20b22ac0> open-webui-1 | └ <open_webui.retrieval.loaders.main.Loader object at 0x7f9f14f09f10> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/retrieval/loaders/main.py", line 129, in load open-webui-1 | docs = loader.load() open-webui-1 | │ └ <function BaseLoader.load at 0x7f9f217b4b80> open-webui-1 | └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0> open-webui-1 | open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_core/document_loaders/base.py", line 31, in load open-webui-1 | return list(self.lazy_load()) open-webui-1 | │ └ <function TextLoader.lazy_load at 0x7f9f20b20e00> open-webui-1 | └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 46, in lazy_load open-webui-1 | detected_encodings = detect_file_encodings(self.file_path) open-webui-1 | │ │ └ '/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png' open-webui-1 | │ └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0> open-webui-1 | └ <function detect_file_encodings at 0x7f9f217b5d00> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/helpers.py", line 50, in detect_file_encodings open-webui-1 | raise RuntimeError(f"Could not detect encoding for {file_path}") open-webui-1 | open-webui-1 | RuntimeError: Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png open-webui-1 | 2025-02-28 11:12:00.747 | ERROR | open_webui.routers.files:upload_file:89 - 400: Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png - {} open-webui-1 | Traceback (most recent call last): open-webui-1 | open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 43, in lazy_load open-webui-1 | text = f.read() open-webui-1 | │ └ <method 'read' of '_io.TextIOWrapper' objects> open-webui-1 | └ <_io.TextIOWrapper name='/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png' mode='r' encodin... open-webui-1 | File "<frozen codecs>", line 322, in decode open-webui-1 | open-webui-1 | UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte open-webui-1 | open-webui-1 | open-webui-1 | During handling of the above exception, another exception occurred: open-webui-1 | open-webui-1 | open-webui-1 | Traceback (most recent call last): open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/retrieval.py", line 990, in process_file open-webui-1 | docs = loader.load( open-webui-1 | │ └ <function Loader.load at 0x7f9f20b22ac0> open-webui-1 | └ <open_webui.retrieval.loaders.main.Loader object at 0x7f9f14f09f10> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/retrieval/loaders/main.py", line 129, in load open-webui-1 | docs = loader.load() open-webui-1 | │ └ <function BaseLoader.load at 0x7f9f217b4b80> open-webui-1 | └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0> open-webui-1 | open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_core/document_loaders/base.py", line 31, in load open-webui-1 | return list(self.lazy_load()) open-webui-1 | │ └ <function TextLoader.lazy_load at 0x7f9f20b20e00> open-webui-1 | └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/text.py", line 46, in lazy_load open-webui-1 | detected_encodings = detect_file_encodings(self.file_path) open-webui-1 | │ │ └ '/app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png' open-webui-1 | │ └ <langchain_community.document_loaders.text.TextLoader object at 0x7f9f14f0b4d0> open-webui-1 | └ <function detect_file_encodings at 0x7f9f217b5d00> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/langchain_community/document_loaders/helpers.py", line 50, in detect_file_encodings open-webui-1 | raise RuntimeError(f"Could not detect encoding for {file_path}") open-webui-1 | open-webui-1 | RuntimeError: Could not detect encoding for /app/backend/data/uploads/587d7b2e-a089-4ca4-b478-555c6e8bd09d_generated-image.png open-webui-1 | open-webui-1 | open-webui-1 | During handling of the above exception, another exception occurred: open-webui-1 | open-webui-1 | open-webui-1 | Traceback (most recent call last): open-webui-1 | open-webui-1 | File "/usr/local/bin/uvicorn", line 10, in <module> open-webui-1 | sys.exit(main()) open-webui-1 | │ │ └ <Command main> open-webui-1 | │ └ <built-in function exit> open-webui-1 | └ <module 'sys' (built-in)> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__ open-webui-1 | return self.main(*args, **kwargs) open-webui-1 | │ │ │ └ {} open-webui-1 | │ │ └ () open-webui-1 | │ └ <function BaseCommand.main at 0x7f9f4b751da0> open-webui-1 | └ <Command main> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main open-webui-1 | rv = self.invoke(ctx) open-webui-1 | │ │ └ <click.core.Context object at 0x7f9f4c438c90> open-webui-1 | │ └ <function Command.invoke at 0x7f9f4b752980> open-webui-1 | └ <Command main> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke open-webui-1 | return ctx.invoke(self.callback, **ctx.params) open-webui-1 | │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'... open-webui-1 | │ │ │ │ └ <click.core.Context object at 0x7f9f4c438c90> open-webui-1 | │ │ │ └ <function main at 0x7f9f4b232d40> open-webui-1 | │ │ └ <Command main> open-webui-1 | │ └ <function Context.invoke at 0x7f9f4b751300> open-webui-1 | └ <click.core.Context object at 0x7f9f4c438c90> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke open-webui-1 | return __callback(*args, **kwargs) open-webui-1 | │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'... open-webui-1 | └ () open-webui-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main open-webui-1 | run( open-webui-1 | └ <function run at 0x7f9f4b6a7ce0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 577, in run open-webui-1 | server.run() open-webui-1 | │ └ <function Server.run at 0x7f9f4b5d9080> open-webui-1 | └ <uvicorn.server.Server object at 0x7f9f4b778a50> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run open-webui-1 | return asyncio.run(self.serve(sockets=sockets)) open-webui-1 | │ │ │ │ └ None open-webui-1 | │ │ │ └ <function Server.serve at 0x7f9f4b5d9120> open-webui-1 | │ │ └ <uvicorn.server.Server object at 0x7f9f4b778a50> open-webui-1 | │ └ <function run at 0x7f9f4baecb80> open-webui-1 | └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> open-webui-1 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run open-webui-1 | return runner.run(main) open-webui-1 | │ │ └ <coroutine object Server.serve at 0x7f9f4b505f30> open-webui-1 | │ └ <function Runner.run at 0x7f9f4b958720> open-webui-1 | └ <asyncio.runners.Runner object at 0x7f9f4b237a50> open-webui-1 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run open-webui-1 | return self._loop.run_until_complete(task) open-webui-1 | │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:69> wai... open-webui-1 | │ │ └ <cyfunction Loop.run_until_complete at 0x7f9f4b274380> open-webui-1 | │ └ <uvloop.Loop running=True closed=False debug=False> open-webui-1 | └ <asyncio.runners.Runner object at 0x7f9f4b237a50> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro open-webui-1 | await self.app(scope, receive_or_disconnect, send_no_error) open-webui-1 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90> open-webui-1 | └ <open_webui.main.RedirectMiddleware object at 0x7f9f173e1650> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ open-webui-1 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) open-webui-1 | │ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f9f15376ca0> open-webui-1 | │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ │ │ └ <starlette.requests.Request object at 0x7f9f15bd7790> open-webui-1 | │ │ └ <fastapi.routing.APIRouter object at 0x7f9f18378b10> open-webui-1 | │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f9f16b2cb90> open-webui-1 | └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app open-webui-1 | await app(scope, receive, sender) open-webui-1 | │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | └ <fastapi.routing.APIRouter object at 0x7f9f18378b10> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ open-webui-1 | await self.middleware_stack(scope, receive, send) open-webui-1 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f9f18378b10>> open-webui-1 | └ <fastapi.routing.APIRouter object at 0x7f9f18378b10> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app open-webui-1 | await route.handle(scope, receive, send) open-webui-1 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <function Route.handle at 0x7f9f48abba60> open-webui-1 | └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle open-webui-1 | await self.app(scope, receive, send) open-webui-1 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ └ <function request_response.<locals>.app at 0x7f9f16f718a0> open-webui-1 | └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app open-webui-1 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) open-webui-1 | │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375c60> open-webui-1 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | │ │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | │ └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860> open-webui-1 | └ <function wrap_app_handling_exceptions at 0x7f9f48aba3e0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app open-webui-1 | await app(scope, receive, sender) open-webui-1 | │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f9f15375120> open-webui-1 | │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f9f15377560> open-webui-1 | │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.4'}, 'http_version': '1.1', 'server': ('172.18.0.3', 8080), 'c... open-webui-1 | └ <function request_response.<locals>.app.<locals>.app at 0x7f9f15374860> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app open-webui-1 | response = await f(request) open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function get_request_handler.<locals>.app at 0x7f9f16f72980> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app open-webui-1 | raw_response = await run_endpoint_function( open-webui-1 | └ <function run_endpoint_function at 0x7f9f48c698a0> open-webui-1 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function open-webui-1 | return await dependant.call(**values) open-webui-1 | │ │ └ {'user': UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profi... open-webui-1 | │ └ <function chat_completion at 0x7f9f16fe1a80> open-webui-1 | └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... open-webui-1 | open-webui-1 | File "/app/backend/open_webui/main.py", line 1039, in chat_completion open-webui-1 | form_data, metadata, events = await process_chat_payload( open-webui-1 | │ │ └ <function process_chat_payload at 0x7f9f18360c20> open-webui-1 | │ └ {'user_id': 'ca7dc3d6-c831-4c4d-b55b-265d227c3359', 'chat_id': 'cf61100c-5108-451f-a4d2-f30dc8012b1f', 'message_id': '1798f3d... open-webui-1 | └ {'stream': True, 'model': 'anthropic.claude-3-5-haiku-latest', 'messages': [{'role': 'user', 'content': 'a circus elephant ba... open-webui-1 | open-webui-1 | File "/app/backend/open_webui/utils/middleware.py", line 728, in process_chat_payload open-webui-1 | form_data = await chat_image_generation_handler( open-webui-1 | └ <function chat_image_generation_handler at 0x7f9f18360e00> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/utils/middleware.py", line 472, in chat_image_generation_handler open-webui-1 | images = await image_generations( open-webui-1 | └ <function image_generations at 0x7f9f1b811800> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/images.py", line 521, in image_generations open-webui-1 | url = upload_image(request, data, image_data, content_type, user) open-webui-1 | │ │ │ │ │ └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_... open-webui-1 | │ │ │ │ └ 'image/png' open-webui-1 | │ │ │ └ b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x08\x06\x06\x07\x06\x05\x08\x07\x07\x... open-webui-1 | │ │ └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ... open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function upload_image at 0x7f9f1b8116c0> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/images.py", line 462, in upload_image open-webui-1 | file_item = upload_file(request, file, user, file_metadata=image_metadata) open-webui-1 | │ │ │ │ └ {'model': 'black-forest-labs/FLUX.1-dev', 'prompt': "A majestic gray circus elephant carefully balancing on a bright red and ... open-webui-1 | │ │ │ └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_... open-webui-1 | │ │ └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'}) open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function upload_file at 0x7f9f2304a520> open-webui-1 | open-webui-1 | > File "/app/backend/open_webui/routers/files.py", line 85, in upload_file open-webui-1 | process_file(request, ProcessFileForm(file_id=id), user=user) open-webui-1 | │ │ │ │ └ UserModel(id='ca7dc3d6-c831-4c4d-b55b-265d227c3359', name='Xander', email='xander@painapple.nl', role='admin', profile_image_... open-webui-1 | │ │ │ └ '587d7b2e-a089-4ca4-b478-555c6e8bd09d' open-webui-1 | │ │ └ <class 'open_webui.routers.retrieval.ProcessFileForm'> open-webui-1 | │ └ <starlette.requests.Request object at 0x7f9f15bd62d0> open-webui-1 | └ <function process_file at 0x7f9f1b94c220> open-webui-1 | open-webui-1 | File "/app/backend/open_webui/routers/retrieval.py", line 1078, in process_file open-webui-1 | raise HTTPException( open-webui-1 | └ <class 'fastapi.exceptions.HTTPException'> ```
Author
Owner

@xblaauw commented on GitHub (Feb 28, 2025):

I just realized, i took the screenshot, realized i had done a few messy attempts. I redid it using claude haiku to get a clean error log. So there is a small discrepancy there.

<!-- gh-comment-id:2690388617 --> @xblaauw commented on GitHub (Feb 28, 2025): I just realized, i took the screenshot, realized i had done a few messy attempts. I redid it using claude haiku to get a clean error log. So there is a small discrepancy there.
Author
Owner

@spammenotinoz commented on GitHub (Feb 28, 2025):

Ideally it would not call the LLM at all, or at worst the task model. Current setup if someone has a thinking model open, it keep calling the thinking model.

I like the picture though

<!-- gh-comment-id:2690493665 --> @spammenotinoz commented on GitHub (Feb 28, 2025): Ideally it would not call the LLM at all, or at worst the task model. Current setup if someone has a thinking model open, it keep calling the thinking model. I like the picture though
Author
Owner

@xblaauw commented on GitHub (Feb 28, 2025):

That would be a quick way to get rid of the error yes. But using a vision enabled model - it would be nice to discuss the generation with the model, and suggest changes. For that usecase, including the image in the message history correctly would be required.

<!-- gh-comment-id:2690505053 --> @xblaauw commented on GitHub (Feb 28, 2025): That would be a quick way to get rid of the error yes. But using a vision enabled model - it would be nice to discuss the generation with the model, and suggest changes. For that usecase, including the image in the message history correctly would be required.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#16098