[GH-ISSUE #14191] issue: Allowed File Extensions prevent images from being generated #55844

Closed
opened 2026-05-05 18:09:14 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @kemnitzs on GitHub (May 22, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14191

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.6.10

Ollama Version (if applicable)

0.7.0

Operating System

ubuntu 22.04

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

image gets generated

Actual Behavior

it fails with
An error occurred while generating an image

Steps to Reproduce

  1. Go to setting
  2. Documents
  3. Set Allowed File Extensions to pdf

Logs & Screenshots

2025-05-22 19:47:31.853 | ERROR | open_webui.routers.files:upload_file:189 - 400: [ERROR: File type .png is not allowed] - {}
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module>
uvicorn.main()
│ └ <Command main>
└ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
return self.main(*args, **kwargs)
│ │ │ └ {}
│ │ └ ()
│ └ <function Command.main at 0x7f69bbd16700>
└ <Command main>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x7f69bca04a50>
│ └ <function Command.invoke at 0x7f69bbd163e0>
└ <Command main>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
│ │ │ │ └ <click.core.Context object at 0x7f69bca04a50>
│ │ │ └ <function main at 0x7f69bb93cc20>
│ │ └ <Command main>
│ └ <function Context.invoke at 0x7f69bbd15620>
└ <click.core.Context object at 0x7f69bca04a50>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
│ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
│ └ ()
└ <function main at 0x7f69bb93cc20>
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main
run(
└ <function run at 0x7f69bbd53740>
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
server.run()
│ └ <function Server.run at 0x7f69bbbd4860>
└ <uvicorn.server.Server object at 0x7f69bbd60090>
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
│ │ │ │ └ None
│ │ │ └ <function Server.serve at 0x7f69bbbd4900>
│ │ └ <uvicorn.server.Server object at 0x7f69bbd60090>
│ └ <function run at 0x7f69bc0b1300>
└ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
│ │ └ <coroutine object Server.serve at 0x7f69bbaf88b0>
│ └ <function Runner.run at 0x7f69bbf20ea0>
└ <asyncio.runners.Runner object at 0x7f69bb923290>
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
│ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:70> wai...
│ │ └ <cyfunction Loop.run_until_complete at 0x7f69bb927370>
│ └ <uvloop.Loop running=True closed=False debug=False>
└ <asyncio.runners.Runner object at 0x7f69bb923290>
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
│ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790>
└ <open_webui.main.RedirectMiddleware object at 0x7f6951703290>
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
│ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80>
│ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ │ │ └ <starlette.requests.Request object at 0x7f691a898e10>
│ │ └ <fastapi.routing.APIRouter object at 0x7f6952bb3290>
│ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790>
└ <function wrap_app_handling_exceptions at 0x7f69b8e549a0>
File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
│ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
└ <fastapi.routing.APIRouter object at 0x7f6952bb3290>
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
await self.middleware_stack(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f6952bb3290>>
└ <fastapi.routing.APIRouter object at 0x7f6952bb3290>
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
await route.handle(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <function Route.handle at 0x7f69b8e56020>
└ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
await self.app(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <function request_response.<locals>.app at 0x7f6951765e40>
└ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
│ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ │ └ <starlette.requests.Request object at 0x7f691a7ecad0>
│ └ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40>
└ <function wrap_app_handling_exceptions at 0x7f69b8e549a0>
File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
│ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135fe20>
│ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
└ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40>
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
response = await f(request)
│ └ <starlette.requests.Request object at 0x7f691a7ecad0>
└ <function get_request_handler.<locals>.app at 0x7f69517659e0>
File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
raw_response = await run_endpoint_function(
└ <function run_endpoint_function at 0x7f69b8e57e20>
File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
return await dependant.call(**values)
│ │ └ {'user': UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role...
│ └ <function chat_completion at 0x7f6951bd2840>
└ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
File "/app/backend/open_webui/main.py", line 1212, in chat_completion
form_data, metadata, events = await process_chat_payload(
│ │ └ <function process_chat_payload at 0x7f6952b1c680>
│ └ {'user_id': 'abf844f6-5622-426e-8017-8826826bad6b', 'chat_id': '2a97edb6-fd15-4cb5-933d-ff7098ffb351', 'message_id': 'ba89b4b...
└ {'stream': True, 'model': 'gemma3:27b', 'messages': [{'role': 'user', 'content': 'a cat'}, {'role': 'assistant', 'content': "...
File "/app/backend/open_webui/utils/middleware.py", line 783, in process_chat_payload
form_data = await chat_image_generation_handler(
└ <function chat_image_generation_handler at 0x7f6952b1c7c0>
File "/app/backend/open_webui/utils/middleware.py", line 500, in chat_image_generation_handler
images = await image_generations(
└ <function image_generations at 0x7f69597c8900>
File "/app/backend/open_webui/routers/images.py", line 529, in image_generations
image_data, content_type = load_b64_image_data(image["b64_json"])
│ │ └ {'b64_json': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTg...
│ └ <function load_b64_image_data at 0x7f695992a7a0>
└ 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...
File "/app/backend/open_webui/routers/images.py", line 462, in upload_image
file_item = upload_file(request, file, user, file_metadata=image_metadata)
│ │ │ │ └ {'model': 'black-forest-labs/FLUX.1-schnell', 'prompt': 'a ca', 'n': 1, 'size': '512x512', 'response_format': 'b64_json'}
│ │ │ └ UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role='admin',...
│ │ └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'})
│ └ <starlette.requests.Request object at 0x7f691a7ecad0>
└ <function upload_file at 0x7f695cc4af20>
> File "/app/backend/open_webui/routers/files.py", line 105, in upload_file
raise HTTPException(
└ <class 'fastapi.exceptions.HTTPException'>
fastapi.exceptions.HTTPException: 400: [ERROR: File type .png is not allowed]
2025-05-22 19:47:31.859 | ERROR | open_webui.utils.middleware:chat_image_generation_handler:530 - 400: [ERROR: 400: [ERROR: 400: [ERROR: File type .png is not allowed]]] - {}
Traceback (most recent call last):
File "/app/backend/open_webui/routers/files.py", line 105, in upload_file
raise HTTPException(
└ <class 'fastapi.exceptions.HTTPException'>
fastapi.exceptions.HTTPException: 400: [ERROR: File type .png is not allowed]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/backend/open_webui/routers/images.py", line 529, in image_generations
image_data, content_type = load_b64_image_data(image["b64_json"])
│ │ └ {'b64_json': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTg...
│ └ <function load_b64_image_data at 0x7f695992a7a0>
└ 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...
File "/app/backend/open_webui/routers/images.py", line 462, in upload_image
file_item = upload_file(request, file, user, file_metadata=image_metadata)
│ │ │ │ └ {'model': 'black-forest-labs/FLUX.1-schnell', 'prompt': 'a ca', 'n': 1, 'size': '512x512', 'response_format': 'b64_json'}
│ │ │ └ UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role='admin',...
│ │ └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'})
│ └ <starlette.requests.Request object at 0x7f691a7ecad0>
└ <function upload_file at 0x7f695cc4af20>
File "/app/backend/open_webui/routers/files.py", line 190, in upload_file
raise HTTPException(
└ <class 'fastapi.exceptions.HTTPException'>
fastapi.exceptions.HTTPException: 400: [ERROR: 400: [ERROR: File type .png is not allowed]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module>
uvicorn.main()
│ └ <Command main>
└ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
return self.main(*args, **kwargs)
│ │ │ └ {}
│ │ └ ()
│ └ <function Command.main at 0x7f69bbd16700>
└ <Command main>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x7f69bca04a50>
│ └ <function Command.invoke at 0x7f69bbd163e0>
└ <Command main>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
│ │ │ │ └ <click.core.Context object at 0x7f69bca04a50>
│ │ │ └ <function main at 0x7f69bb93cc20>
│ │ └ <Command main>
│ └ <function Context.invoke at 0x7f69bbd15620>
└ <click.core.Context object at 0x7f69bca04a50>
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke
return callback(*args, **kwargs)
│ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
│ └ ()
└ <function main at 0x7f69bb93cc20>
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main
run(
└ <function run at 0x7f69bbd53740>
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
server.run()
│ └ <function Server.run at 0x7f69bbbd4860>
└ <uvicorn.server.Server object at 0x7f69bbd60090>
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
│ │ │ │ └ None
│ │ │ └ <function Server.serve at 0x7f69bbbd4900>
│ │ └ <uvicorn.server.Server object at 0x7f69bbd60090>
│ └ <function run at 0x7f69bc0b1300>
└ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
│ │ └ <coroutine object Server.serve at 0x7f69bbaf88b0>
│ └ <function Runner.run at 0x7f69bbf20ea0>
└ <asyncio.runners.Runner object at 0x7f69bb923290>
File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
│ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:70> wai...
│ │ └ <cyfunction Loop.run_until_complete at 0x7f69bb927370>
│ └ <uvloop.Loop running=True closed=False debug=False>
└ <asyncio.runners.Runner object at 0x7f69bb923290>
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
│ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790>
└ <open_webui.main.RedirectMiddleware object at 0x7f6951703290>
File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
│ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80>
│ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ │ │ └ <starlette.requests.Request object at 0x7f691a898e10>
│ │ └ <fastapi.routing.APIRouter object at 0x7f6952bb3290>
│ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790>
└ <function wrap_app_handling_exceptions at 0x7f69b8e549a0>
File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
│ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
└ <fastapi.routing.APIRouter object at 0x7f6952bb3290>
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
await self.middleware_stack(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f6952bb3290>>
└ <fastapi.routing.APIRouter object at 0x7f6952bb3290>
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
await route.handle(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <function Route.handle at 0x7f69b8e56020>
└ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
await self.app(scope, receive, send)
│ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ └ <function request_response.<locals>.app at 0x7f6951765e40>
└ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST'])
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
│ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00>
│ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
│ │ └ <starlette.requests.Request object at 0x7f691a7ecad0>
│ └ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40>
└ <function wrap_app_handling_exceptions at 0x7f69b8e549a0>
File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
│ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135fe20>
│ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480>
│ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ...
└ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40>
File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
response = await f(request)
│ └ <starlette.requests.Request object at 0x7f691a7ecad0>
└ <function get_request_handler.<locals>.app at 0x7f69517659e0>
File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
raw_response = await run_endpoint_function(
└ <function run_endpoint_function at 0x7f69b8e57e20>
File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
return await dependant.call(**values)
│ │ └ {'user': UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role...
│ └ <function chat_completion at 0x7f6951bd2840>
└ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
File "/app/backend/open_webui/main.py", line 1212, in chat_completion
form_data, metadata, events = await process_chat_payload(
│ │ └ <function process_chat_payload at 0x7f6952b1c680>
│ └ {'user_id': 'abf844f6-5622-426e-8017-8826826bad6b', 'chat_id': '2a97edb6-fd15-4cb5-933d-ff7098ffb351', 'message_id': 'ba89b4b...
└ {'stream': True, 'model': 'gemma3:27b', 'messages': [{'role': 'user', 'content': 'a cat'}, {'role': 'assistant', 'content': "...
File "/app/backend/open_webui/utils/middleware.py", line 783, in process_chat_payload
form_data = await chat_image_generation_handler(
└ <function chat_image_generation_handler at 0x7f6952b1c7c0>
> File "/app/backend/open_webui/utils/middleware.py", line 500, in chat_image_generation_handler
images = await image_generations(
└ <function image_generations at 0x7f69597c8900>
File "/app/backend/open_webui/routers/images.py", line 680, in image_generations
if "error" in data:
└ {'created': 1747943251, 'data': [{'b64_json': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHB...
fastapi.exceptions.HTTPException: 400: [ERROR: 400: [ERROR: 400: [ERROR: File type .png is not allowed]]]
submitPrompt a dog 2a97edb6-fd15-4cb5-933d-ff7098ffb351
Chat.svelte:193 saveSessionSelectedModels ['gemma3:27b'] ["gemma3:27b"]
ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​</div>​flex
Chat.svelte:1468 modelId gemma3:27b
Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}}
+layout.svelte:113 usage {models: Array(1)}
+layout.svelte:113 usage {models: Array(1)}
Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}}
+layout.svelte:113 usage {models: Array(1)}
+layout.svelte:113 usage {models: Array(1)}
Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}}
Chat.svelte:1283 {content: 'You'}
Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}}
Chat.svelte:1283 {content: 'You are'}

Additional Information

Image generation works like a charm with our own openai style image generation api, but as soon as
you set the file allowed file extensions to pdf only it stops to work.

interestingly adding png to the list does NOT resolve the problem.

Originally created by @kemnitzs on GitHub (May 22, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14191 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.6.10 ### Ollama Version (if applicable) 0.7.0 ### Operating System ubuntu 22.04 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior image gets generated ### Actual Behavior it fails with An error occurred while generating an image ### Steps to Reproduce 1. Go to setting 2. Documents 3. Set Allowed File Extensions to pdf ### Logs & Screenshots ``` 2025-05-22 19:47:31.853 | ERROR | open_webui.routers.files:upload_file:189 - 400: [ERROR: File type .png is not allowed] - {} Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module> uvicorn.main() │ └ <Command main> └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function Command.main at 0x7f69bbd16700> └ <Command main> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main rv = self.invoke(ctx) │ │ └ <click.core.Context object at 0x7f69bca04a50> │ └ <function Command.invoke at 0x7f69bbd163e0> └ <Command main> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke return ctx.invoke(self.callback, **ctx.params) │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ │ │ │ └ <click.core.Context object at 0x7f69bca04a50> │ │ │ └ <function main at 0x7f69bb93cc20> │ │ └ <Command main> │ └ <function Context.invoke at 0x7f69bbd15620> └ <click.core.Context object at 0x7f69bca04a50> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke return callback(*args, **kwargs) │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ └ () └ <function main at 0x7f69bb93cc20> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main run( └ <function run at 0x7f69bbd53740> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0x7f69bbbd4860> └ <uvicorn.server.Server object at 0x7f69bbd60090> File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run return asyncio.run(self.serve(sockets=sockets)) │ │ │ │ └ None │ │ │ └ <function Server.serve at 0x7f69bbbd4900> │ │ └ <uvicorn.server.Server object at 0x7f69bbd60090> │ └ <function run at 0x7f69bc0b1300> └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) │ │ └ <coroutine object Server.serve at 0x7f69bbaf88b0> │ └ <function Runner.run at 0x7f69bbf20ea0> └ <asyncio.runners.Runner object at 0x7f69bb923290> File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:70> wai... │ │ └ <cyfunction Loop.run_until_complete at 0x7f69bb927370> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0x7f69bb923290> File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro await self.app(scope, receive_or_disconnect, send_no_error) │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790> └ <open_webui.main.RedirectMiddleware object at 0x7f6951703290> File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) │ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ │ │ └ <starlette.requests.Request object at 0x7f691a898e10> │ │ └ <fastapi.routing.APIRouter object at 0x7f6952bb3290> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790> └ <function wrap_app_handling_exceptions at 0x7f69b8e549a0> File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... └ <fastapi.routing.APIRouter object at 0x7f6952bb3290> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f6952bb3290>> └ <fastapi.routing.APIRouter object at 0x7f6952bb3290> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app await route.handle(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <function Route.handle at 0x7f69b8e56020> └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <function request_response.<locals>.app at 0x7f6951765e40> └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ │ └ <starlette.requests.Request object at 0x7f691a7ecad0> │ └ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40> └ <function wrap_app_handling_exceptions at 0x7f69b8e549a0> File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135fe20> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... └ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0x7f691a7ecad0> └ <function get_request_handler.<locals>.app at 0x7f69517659e0> File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app raw_response = await run_endpoint_function( └ <function run_endpoint_function at 0x7f69b8e57e20> File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function return await dependant.call(**values) │ │ └ {'user': UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role... │ └ <function chat_completion at 0x7f6951bd2840> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/main.py", line 1212, in chat_completion form_data, metadata, events = await process_chat_payload( │ │ └ <function process_chat_payload at 0x7f6952b1c680> │ └ {'user_id': 'abf844f6-5622-426e-8017-8826826bad6b', 'chat_id': '2a97edb6-fd15-4cb5-933d-ff7098ffb351', 'message_id': 'ba89b4b... └ {'stream': True, 'model': 'gemma3:27b', 'messages': [{'role': 'user', 'content': 'a cat'}, {'role': 'assistant', 'content': "... File "/app/backend/open_webui/utils/middleware.py", line 783, in process_chat_payload form_data = await chat_image_generation_handler( └ <function chat_image_generation_handler at 0x7f6952b1c7c0> File "/app/backend/open_webui/utils/middleware.py", line 500, in chat_image_generation_handler images = await image_generations( └ <function image_generations at 0x7f69597c8900> File "/app/backend/open_webui/routers/images.py", line 529, in image_generations image_data, content_type = load_b64_image_data(image["b64_json"]) │ │ └ {'b64_json': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTg... │ └ <function load_b64_image_data at 0x7f695992a7a0> └ 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... File "/app/backend/open_webui/routers/images.py", line 462, in upload_image file_item = upload_file(request, file, user, file_metadata=image_metadata) │ │ │ │ └ {'model': 'black-forest-labs/FLUX.1-schnell', 'prompt': 'a ca', 'n': 1, 'size': '512x512', 'response_format': 'b64_json'} │ │ │ └ UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role='admin',... │ │ └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'}) │ └ <starlette.requests.Request object at 0x7f691a7ecad0> └ <function upload_file at 0x7f695cc4af20> > File "/app/backend/open_webui/routers/files.py", line 105, in upload_file raise HTTPException( └ <class 'fastapi.exceptions.HTTPException'> fastapi.exceptions.HTTPException: 400: [ERROR: File type .png is not allowed] 2025-05-22 19:47:31.859 | ERROR | open_webui.utils.middleware:chat_image_generation_handler:530 - 400: [ERROR: 400: [ERROR: 400: [ERROR: File type .png is not allowed]]] - {} Traceback (most recent call last): File "/app/backend/open_webui/routers/files.py", line 105, in upload_file raise HTTPException( └ <class 'fastapi.exceptions.HTTPException'> fastapi.exceptions.HTTPException: 400: [ERROR: File type .png is not allowed] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/backend/open_webui/routers/images.py", line 529, in image_generations image_data, content_type = load_b64_image_data(image["b64_json"]) │ │ └ {'b64_json': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTg... │ └ <function load_b64_image_data at 0x7f695992a7a0> └ 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... File "/app/backend/open_webui/routers/images.py", line 462, in upload_image file_item = upload_file(request, file, user, file_metadata=image_metadata) │ │ │ │ └ {'model': 'black-forest-labs/FLUX.1-schnell', 'prompt': 'a ca', 'n': 1, 'size': '512x512', 'response_format': 'b64_json'} │ │ │ └ UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role='admin',... │ │ └ UploadFile(filename='generated-image.png', size=None, headers={'content-type': 'image/png'}) │ └ <starlette.requests.Request object at 0x7f691a7ecad0> └ <function upload_file at 0x7f695cc4af20> File "/app/backend/open_webui/routers/files.py", line 190, in upload_file raise HTTPException( └ <class 'fastapi.exceptions.HTTPException'> fastapi.exceptions.HTTPException: 400: [ERROR: 400: [ERROR: File type .png is not allowed]] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module> uvicorn.main() │ └ <Command main> └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function Command.main at 0x7f69bbd16700> └ <Command main> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main rv = self.invoke(ctx) │ │ └ <click.core.Context object at 0x7f69bca04a50> │ └ <function Command.invoke at 0x7f69bbd163e0> └ <Command main> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke return ctx.invoke(self.callback, **ctx.params) │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ │ │ │ └ <click.core.Context object at 0x7f69bca04a50> │ │ │ └ <function main at 0x7f69bb93cc20> │ │ └ <Command main> │ └ <function Context.invoke at 0x7f69bbd15620> └ <click.core.Context object at 0x7f69bca04a50> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke return callback(*args, **kwargs) │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ └ () └ <function main at 0x7f69bb93cc20> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main run( └ <function run at 0x7f69bbd53740> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0x7f69bbbd4860> └ <uvicorn.server.Server object at 0x7f69bbd60090> File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 66, in run return asyncio.run(self.serve(sockets=sockets)) │ │ │ │ └ None │ │ │ └ <function Server.serve at 0x7f69bbbd4900> │ │ └ <uvicorn.server.Server object at 0x7f69bbd60090> │ └ <function run at 0x7f69bc0b1300> └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) │ │ └ <coroutine object Server.serve at 0x7f69bbaf88b0> │ └ <function Runner.run at 0x7f69bbf20ea0> └ <asyncio.runners.Runner object at 0x7f69bb923290> File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:70> wai... │ │ └ <cyfunction Loop.run_until_complete at 0x7f69bb927370> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0x7f69bb923290> File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro await self.app(scope, receive_or_disconnect, send_no_error) │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790> └ <open_webui.main.RedirectMiddleware object at 0x7f6951703290> File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) │ │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x7f694f752e80> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ │ │ └ <starlette.requests.Request object at 0x7f691a898e10> │ │ └ <fastapi.routing.APIRouter object at 0x7f6952bb3290> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f6952365790> └ <function wrap_app_handling_exceptions at 0x7f69b8e549a0> File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... └ <fastapi.routing.APIRouter object at 0x7f6952bb3290> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ await self.middleware_stack(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f6952bb3290>> └ <fastapi.routing.APIRouter object at 0x7f6952bb3290> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app await route.handle(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <function Route.handle at 0x7f69b8e56020> └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ └ <function request_response.<locals>.app at 0x7f6951765e40> └ APIRoute(path='/api/chat/completions', name='chat_completion', methods=['POST']) File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135ce00> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... │ │ └ <starlette.requests.Request object at 0x7f691a7ecad0> │ └ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40> └ <function wrap_app_handling_exceptions at 0x7f69b8e549a0> File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x7f695135fe20> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f694f752480> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('10.42.10.210', 8080), ... └ <function request_response.<locals>.app.<locals>.app at 0x7f695135fc40> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0x7f691a7ecad0> └ <function get_request_handler.<locals>.app at 0x7f69517659e0> File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app raw_response = await run_endpoint_function( └ <function run_endpoint_function at 0x7f69b8e57e20> File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function return await dependant.call(**values) │ │ └ {'user': UserModel(id='abf844f6-5622-426e-8017-8826826bad6b', name='Stefan Kemnitz', email='kemnitzs@uni-greifswald.de', role... │ └ <function chat_completion at 0x7f6951bd2840> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/main.py", line 1212, in chat_completion form_data, metadata, events = await process_chat_payload( │ │ └ <function process_chat_payload at 0x7f6952b1c680> │ └ {'user_id': 'abf844f6-5622-426e-8017-8826826bad6b', 'chat_id': '2a97edb6-fd15-4cb5-933d-ff7098ffb351', 'message_id': 'ba89b4b... └ {'stream': True, 'model': 'gemma3:27b', 'messages': [{'role': 'user', 'content': 'a cat'}, {'role': 'assistant', 'content': "... File "/app/backend/open_webui/utils/middleware.py", line 783, in process_chat_payload form_data = await chat_image_generation_handler( └ <function chat_image_generation_handler at 0x7f6952b1c7c0> > File "/app/backend/open_webui/utils/middleware.py", line 500, in chat_image_generation_handler images = await image_generations( └ <function image_generations at 0x7f69597c8900> File "/app/backend/open_webui/routers/images.py", line 680, in image_generations if "error" in data: └ {'created': 1747943251, 'data': [{'b64_json': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHB... fastapi.exceptions.HTTPException: 400: [ERROR: 400: [ERROR: 400: [ERROR: File type .png is not allowed]]] ``` ``` submitPrompt a dog 2a97edb6-fd15-4cb5-933d-ff7098ffb351 Chat.svelte:193 saveSessionSelectedModels ['gemma3:27b'] ["gemma3:27b"] ResponseMessage.svelte:566 <div class=​"flex justify-start overflow-x-auto buttons text-gray-600 dark:​text-gray-500 mt-0.5 svelte-1u5gq5j">​</div>​flex Chat.svelte:1468 modelId gemma3:27b Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}} +layout.svelte:113 usage {models: Array(1)} +layout.svelte:113 usage {models: Array(1)} Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}} +layout.svelte:113 usage {models: Array(1)} +layout.svelte:113 usage {models: Array(1)} Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}} Chat.svelte:1283 {content: 'You'} Chat.svelte:269 {chat_id: '2a97edb6-fd15-4cb5-933d-ff7098ffb351', message_id: 'c577d5b6-42dd-4177-8790-66495b7e79aa', data: {…}} Chat.svelte:1283 {content: 'You are'} ``` ### Additional Information Image generation works like a charm with our own openai style image generation api, but as soon as you set the file allowed file extensions to pdf only it stops to work. interestingly adding png to the list does NOT resolve the problem.
GiteaMirror added the bug label 2026-05-05 18:09:14 -05:00
Author
Owner

@kemnitzs commented on GitHub (May 22, 2025):

ah found another thing.

in contrast to the example text for the allowed file extensions

e.g pdf,docx,txt

putting

.pdf,.png

in the list solves the problem.

still i think it's a ux problem if one now has to set this manually.

<!-- gh-comment-id:2902444954 --> @kemnitzs commented on GitHub (May 22, 2025): ah found another thing. in contrast to the example text for the allowed file extensions ``` e.g pdf,docx,txt ``` putting ``` .pdf,.png ``` in the list solves the problem. still i think it's a ux problem if one now has to set this manually.
Author
Owner

@tjbck commented on GitHub (May 22, 2025):

Good catch, Both are addressed in dev.

7a593b63b2

<!-- gh-comment-id:2902796454 --> @tjbck commented on GitHub (May 22, 2025): Good catch, Both are addressed in dev. 7a593b63b29d61cb7ec83d464d36bd760dab4d7a
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55844