issue: ComfyUI image generation broken in v0.6.23 #6160

Closed
opened 2025-11-11 16:46:24 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @links486 on GitHub (Aug 22, 2025).

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

v0.6.23

Ollama Version (if applicable)

No response

Operating System

macOS Sequoia 15.6.1

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Images continue to be generated correctly via ComfyUI after upgrading to Open WebUI v0.6.23.

Actual Behavior

Image generation fails with the following error:
ERROR | open_webui.utils.middleware:chat_image_generation_handler:586 - argument of type 'NoneType' is not iterable

Steps to Reproduce

  1. Launch the latest Docker image.
  2. Configure ComfyUI in the Open WebUI admin settings (import a workflow.json file that was previously working; set the base URL and other required fields; etc.).
    • Alternatively, simply upgrade to the latest release via Watchtower if you had already previously configured ComfyUI.
  3. Attempt to generate an image.
  4. Observe that the generation fails: "An error occurred while generating an image"
  5. Check the Docker logs to see the Traceback (also pasted below).

Logs & Screenshots

Docker log

2025-08-21 17:51:30.464 | 2025-08-21 23:51:30.460 | ERROR    | open_webui.utils.middleware:chat_image_generation_handler:586 - argument of type 'NoneType' is not iterable
2025-08-21 17:51:30.464 | Traceback (most recent call last):
2025-08-21 17:51:30.464 | 
2025-08-21 17:51:30.464 |   File "<frozen runpy>", line 198, in _run_module_as_main
2025-08-21 17:51:30.464 |   File "<frozen runpy>", line 88, in _run_code
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module>
2025-08-21 17:51:30.464 |     uvicorn.main()
2025-08-21 17:51:30.464 |     │       └ <Command main>
2025-08-21 17:51:30.464 |     └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
2025-08-21 17:51:30.464 |     return self.main(*args, **kwargs)
2025-08-21 17:51:30.464 |            │    │     │       └ {}
2025-08-21 17:51:30.464 |            │    │     └ ()
2025-08-21 17:51:30.464 |            │    └ <function Command.main at 0xffffa969eb60>
2025-08-21 17:51:30.464 |            └ <Command main>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main
2025-08-21 17:51:30.464 |     rv = self.invoke(ctx)
2025-08-21 17:51:30.464 |          │    │      └ <click.core.Context object at 0xffffaa65c690>
2025-08-21 17:51:30.464 |          │    └ <function Command.invoke at 0xffffa969e840>
2025-08-21 17:51:30.464 |          └ <Command main>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
2025-08-21 17:51:30.464 |     return ctx.invoke(self.callback, **ctx.params)
2025-08-21 17:51:30.464 |            │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
2025-08-21 17:51:30.464 |            │   │      │    │           └ <click.core.Context object at 0xffffaa65c690>
2025-08-21 17:51:30.464 |            │   │      │    └ <function main at 0xffffa932dd00>
2025-08-21 17:51:30.464 |            │   │      └ <Command main>
2025-08-21 17:51:30.464 |            │   └ <function Context.invoke at 0xffffa969da80>
2025-08-21 17:51:30.464 |            └ <click.core.Context object at 0xffffaa65c690>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke
2025-08-21 17:51:30.464 |     return callback(*args, **kwargs)
2025-08-21 17:51:30.464 |            │         │       └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
2025-08-21 17:51:30.464 |            │         └ ()
2025-08-21 17:51:30.464 |            └ <function main at 0xffffa932dd00>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 413, in main
2025-08-21 17:51:30.464 |     run(
2025-08-21 17:51:30.464 |     └ <function run at 0xffffa96a3d80>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 580, in run
2025-08-21 17:51:30.464 |     server.run()
2025-08-21 17:51:30.464 |     │      └ <function Server.run at 0xffffa97351c0>
2025-08-21 17:51:30.464 |     └ <uvicorn.server.Server object at 0xffffa9535850>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run
2025-08-21 17:51:30.464 |     return asyncio.run(self.serve(sockets=sockets))
2025-08-21 17:51:30.464 |            │       │   │    │             └ None
2025-08-21 17:51:30.464 |            │       │   │    └ <function Server.serve at 0xffffa9735260>
2025-08-21 17:51:30.464 |            │       │   └ <uvicorn.server.Server object at 0xffffa9535850>
2025-08-21 17:51:30.464 |            │       └ <function run at 0xffffa9bb93a0>
2025-08-21 17:51:30.464 |            └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
2025-08-21 17:51:30.464 |     return runner.run(main)
2025-08-21 17:51:30.464 |            │      │   └ <coroutine object Server.serve at 0xffffa92ca890>
2025-08-21 17:51:30.464 |            │      └ <function Runner.run at 0xffffa996cf40>
2025-08-21 17:51:30.464 |            └ <asyncio.runners.Runner object at 0xffffa9333810>
2025-08-21 17:51:30.464 |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
2025-08-21 17:51:30.464 |     return self._loop.run_until_complete(task)
2025-08-21 17:51:30.464 |            │    │     │                  └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:71> wai...
2025-08-21 17:51:30.464 |            │    │     └ <cyfunction Loop.run_until_complete at 0xffffa8df42b0>
2025-08-21 17:51:30.464 |            │    └ <uvloop.Loop running=True closed=False debug=False>
2025-08-21 17:51:30.464 |            └ <asyncio.runners.Runner object at 0xffffa9333810>
2025-08-21 17:51:30.464 | 
2025-08-21 17:51:30.464 |   File "/app/backend/open_webui/main.py", line 1492, in process_chat
2025-08-21 17:51:30.464 |     form_data, metadata, events = await process_chat_payload(
2025-08-21 17:51:30.464 |     │          │                        └ <function process_chat_payload at 0xffff1a8e7d80>
2025-08-21 17:51:30.464 |     │          └ {'user_id': '1242f3f6-9959-48eb-ac49-d6f4195e6279', 'chat_id': '4eb91401-c547-4328-9168-5558e3175baa', 'message_id': '2e8c27e...
2025-08-21 17:51:30.464 |     └ {'stream': True, 'model': 'Qwen3-30B-A3B-Instruct-2507', 'messages': [{'role': 'user', 'content': 'This is a test.'}], 'metad...
2025-08-21 17:51:30.464 | 
2025-08-21 17:51:30.464 |   File "/app/backend/open_webui/utils/middleware.py", line 880, in process_chat_payload
2025-08-21 17:51:30.464 |     form_data = await chat_image_generation_handler(
2025-08-21 17:51:30.464 |                       └ <function chat_image_generation_handler at 0xffff1a8e7ba0>
2025-08-21 17:51:30.464 | 
2025-08-21 17:51:30.464 | > File "/app/backend/open_webui/utils/middleware.py", line 556, in chat_image_generation_handler
2025-08-21 17:51:30.464 |     images = await image_generations(
2025-08-21 17:51:30.464 |                    └ <function image_generations at 0xffff1bc08a40>
2025-08-21 17:51:30.464 | 
2025-08-21 17:51:30.464 |   File "/app/backend/open_webui/routers/images.py", line 493, in image_generations
2025-08-21 17:51:30.464 |     if "x" in form_data.size:
2025-08-21 17:51:30.464 |               │         └ None
2025-08-21 17:51:30.464 |               └ GenerateImageForm(model=None, prompt="A simple, clean white background with a single, centered, solid black circle. The circl...
2025-08-21 17:51:30.464 | 
2025-08-21 17:51:30.464 | TypeError: argument of type 'NoneType' is not iterable

Additional Information

The size field is set in the admin interface. Nothing about this configuration changed from the previous release where it was working correctly.

Image
Originally created by @links486 on GitHub (Aug 22, 2025). ### 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 v0.6.23 ### Ollama Version (if applicable) _No response_ ### Operating System macOS Sequoia 15.6.1 ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior Images continue to be generated correctly via ComfyUI after upgrading to Open WebUI v0.6.23. ### Actual Behavior Image generation fails with the following error: `ERROR | open_webui.utils.middleware:chat_image_generation_handler:586 - argument of type 'NoneType' is not iterable` ### Steps to Reproduce 1. Launch the latest Docker image. 2. Configure ComfyUI in the Open WebUI admin settings (import a `workflow.json` file that was previously working; set the base URL and other required fields; etc.). - Alternatively, simply upgrade to the latest release via Watchtower if you had already previously configured ComfyUI. 3. Attempt to generate an image. 4. Observe that the generation fails: "An error occurred while generating an image" 5. Check the Docker logs to see the Traceback (also pasted below). ### Logs & Screenshots ## Docker log ``` 2025-08-21 17:51:30.464 | 2025-08-21 23:51:30.460 | ERROR | open_webui.utils.middleware:chat_image_generation_handler:586 - argument of type 'NoneType' is not iterable 2025-08-21 17:51:30.464 | Traceback (most recent call last): 2025-08-21 17:51:30.464 | 2025-08-21 17:51:30.464 | File "<frozen runpy>", line 198, in _run_module_as_main 2025-08-21 17:51:30.464 | File "<frozen runpy>", line 88, in _run_code 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module> 2025-08-21 17:51:30.464 | uvicorn.main() 2025-08-21 17:51:30.464 | │ └ <Command main> 2025-08-21 17:51:30.464 | └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__ 2025-08-21 17:51:30.464 | return self.main(*args, **kwargs) 2025-08-21 17:51:30.464 | │ │ │ └ {} 2025-08-21 17:51:30.464 | │ │ └ () 2025-08-21 17:51:30.464 | │ └ <function Command.main at 0xffffa969eb60> 2025-08-21 17:51:30.464 | └ <Command main> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main 2025-08-21 17:51:30.464 | rv = self.invoke(ctx) 2025-08-21 17:51:30.464 | │ │ └ <click.core.Context object at 0xffffaa65c690> 2025-08-21 17:51:30.464 | │ └ <function Command.invoke at 0xffffa969e840> 2025-08-21 17:51:30.464 | └ <Command main> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke 2025-08-21 17:51:30.464 | return ctx.invoke(self.callback, **ctx.params) 2025-08-21 17:51:30.464 | │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... 2025-08-21 17:51:30.464 | │ │ │ │ └ <click.core.Context object at 0xffffaa65c690> 2025-08-21 17:51:30.464 | │ │ │ └ <function main at 0xffffa932dd00> 2025-08-21 17:51:30.464 | │ │ └ <Command main> 2025-08-21 17:51:30.464 | │ └ <function Context.invoke at 0xffffa969da80> 2025-08-21 17:51:30.464 | └ <click.core.Context object at 0xffffaa65c690> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke 2025-08-21 17:51:30.464 | return callback(*args, **kwargs) 2025-08-21 17:51:30.464 | │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... 2025-08-21 17:51:30.464 | │ └ () 2025-08-21 17:51:30.464 | └ <function main at 0xffffa932dd00> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 413, in main 2025-08-21 17:51:30.464 | run( 2025-08-21 17:51:30.464 | └ <function run at 0xffffa96a3d80> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 580, in run 2025-08-21 17:51:30.464 | server.run() 2025-08-21 17:51:30.464 | │ └ <function Server.run at 0xffffa97351c0> 2025-08-21 17:51:30.464 | └ <uvicorn.server.Server object at 0xffffa9535850> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run 2025-08-21 17:51:30.464 | return asyncio.run(self.serve(sockets=sockets)) 2025-08-21 17:51:30.464 | │ │ │ │ └ None 2025-08-21 17:51:30.464 | │ │ │ └ <function Server.serve at 0xffffa9735260> 2025-08-21 17:51:30.464 | │ │ └ <uvicorn.server.Server object at 0xffffa9535850> 2025-08-21 17:51:30.464 | │ └ <function run at 0xffffa9bb93a0> 2025-08-21 17:51:30.464 | └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run 2025-08-21 17:51:30.464 | return runner.run(main) 2025-08-21 17:51:30.464 | │ │ └ <coroutine object Server.serve at 0xffffa92ca890> 2025-08-21 17:51:30.464 | │ └ <function Runner.run at 0xffffa996cf40> 2025-08-21 17:51:30.464 | └ <asyncio.runners.Runner object at 0xffffa9333810> 2025-08-21 17:51:30.464 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run 2025-08-21 17:51:30.464 | return self._loop.run_until_complete(task) 2025-08-21 17:51:30.464 | │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:71> wai... 2025-08-21 17:51:30.464 | │ │ └ <cyfunction Loop.run_until_complete at 0xffffa8df42b0> 2025-08-21 17:51:30.464 | │ └ <uvloop.Loop running=True closed=False debug=False> 2025-08-21 17:51:30.464 | └ <asyncio.runners.Runner object at 0xffffa9333810> 2025-08-21 17:51:30.464 | 2025-08-21 17:51:30.464 | File "/app/backend/open_webui/main.py", line 1492, in process_chat 2025-08-21 17:51:30.464 | form_data, metadata, events = await process_chat_payload( 2025-08-21 17:51:30.464 | │ │ └ <function process_chat_payload at 0xffff1a8e7d80> 2025-08-21 17:51:30.464 | │ └ {'user_id': '1242f3f6-9959-48eb-ac49-d6f4195e6279', 'chat_id': '4eb91401-c547-4328-9168-5558e3175baa', 'message_id': '2e8c27e... 2025-08-21 17:51:30.464 | └ {'stream': True, 'model': 'Qwen3-30B-A3B-Instruct-2507', 'messages': [{'role': 'user', 'content': 'This is a test.'}], 'metad... 2025-08-21 17:51:30.464 | 2025-08-21 17:51:30.464 | File "/app/backend/open_webui/utils/middleware.py", line 880, in process_chat_payload 2025-08-21 17:51:30.464 | form_data = await chat_image_generation_handler( 2025-08-21 17:51:30.464 | └ <function chat_image_generation_handler at 0xffff1a8e7ba0> 2025-08-21 17:51:30.464 | 2025-08-21 17:51:30.464 | > File "/app/backend/open_webui/utils/middleware.py", line 556, in chat_image_generation_handler 2025-08-21 17:51:30.464 | images = await image_generations( 2025-08-21 17:51:30.464 | └ <function image_generations at 0xffff1bc08a40> 2025-08-21 17:51:30.464 | 2025-08-21 17:51:30.464 | File "/app/backend/open_webui/routers/images.py", line 493, in image_generations 2025-08-21 17:51:30.464 | if "x" in form_data.size: 2025-08-21 17:51:30.464 | │ └ None 2025-08-21 17:51:30.464 | └ GenerateImageForm(model=None, prompt="A simple, clean white background with a single, centered, solid black circle. The circl... 2025-08-21 17:51:30.464 | 2025-08-21 17:51:30.464 | TypeError: argument of type 'NoneType' is not iterable ``` ### Additional Information The size field is set in the admin interface. Nothing about this configuration changed from the previous release where it was working correctly. <img width="287" height="491" alt="Image" src="https://github.com/user-attachments/assets/8e72f690-ad23-422c-8a19-7565244a69eb" />
GiteaMirror added the bug label 2025-11-11 16:46:24 -06:00
Author
Owner

@Haervwe commented on GitHub (Aug 22, 2025):

Experiencing the same issue. I cannot call any workflow using the Native implementation, it always returns NoneType is not iterable

@Haervwe commented on GitHub (Aug 22, 2025): Experiencing the same issue. I cannot call any workflow using the Native implementation, it always returns NoneType is not iterable
Author
Owner

@dusty-du commented on GitHub (Aug 22, 2025):

yep same here

@dusty-du commented on GitHub (Aug 22, 2025): yep same here
Author
Owner

@Codelica commented on GitHub (Aug 22, 2025):

Seeing the same with both Comfy and Automatic111 image generation. Reverting Open-WebUI back to 0.6.22 both work properly.

@Codelica commented on GitHub (Aug 22, 2025): Seeing the same with both Comfy and Automatic111 image generation. Reverting Open-WebUI back to 0.6.22 both work properly.
Author
Owner

@GFYURI commented on GitHub (Aug 22, 2025):

This is only a temporary fix. If it gets fixed in a future update, it should be overwritten.
For context, I got this working with the help of an AI, just to clarify.
Before making any changes, create a backup of the file in case something goes wrong or the fix doesn’t work.

In open_webui/routers/images.py, look for the line:

if "x" in form_data.size:

and change it to:

if form_data.size and "x" in form_data.size:

If that fixes everything, great. If you encounter an error like:

TypeError: upload_file() missing 1 required positional argument: 'background_tasks'

try the following. In the same images.py, locate:

def upload_image(request, image_data, content_type, metadata, user):

and replace it with:

def upload_image(request, image_data, content_type, metadata, user):
image_format = mimetypes.guess_extension(content_type)
file = UploadFile(
file=io.BytesIO(image_data),
filename=f"generated-image{image_format}",
headers={
"content-type": content_type,
},
)

try:
    # Try with background_tasks (newer versions)
    from fastapi import BackgroundTasks
    background_tasks = BackgroundTasks()
    
    file_item = upload_file(
        request=request, 
        file=file, 
        metadata=metadata, 
        process=False, 
        user=user,
        background_tasks=background_tasks
    )
except TypeError:
    # Fallback for older versions
    file_item = upload_file(
        request=request, 
        file=file, 
        metadata=metadata, 
        process=False, 
        user=user
    )

url = request.app.url_path_for("get_file_content_by_id", id=file_item.id)
return url

Then just restart and test.

@GFYURI commented on GitHub (Aug 22, 2025): This is only a temporary fix. If it gets fixed in a future update, it should be overwritten. For context, I got this working with the help of an AI, just to clarify. Before making any changes, create a backup of the file in case something goes wrong or the fix doesn’t work. In open_webui/routers/images.py, look for the line: if "x" in form_data.size: and change it to: if form_data.size and "x" in form_data.size: If that fixes everything, great. If you encounter an error like: TypeError: upload_file() missing 1 required positional argument: 'background_tasks' try the following. In the same images.py, locate: def upload_image(request, image_data, content_type, metadata, user): and replace it with: def upload_image(request, image_data, content_type, metadata, user): image_format = mimetypes.guess_extension(content_type) file = UploadFile( file=io.BytesIO(image_data), filename=f"generated-image{image_format}", headers={ "content-type": content_type, }, ) try: # Try with background_tasks (newer versions) from fastapi import BackgroundTasks background_tasks = BackgroundTasks() file_item = upload_file( request=request, file=file, metadata=metadata, process=False, user=user, background_tasks=background_tasks ) except TypeError: # Fallback for older versions file_item = upload_file( request=request, file=file, metadata=metadata, process=False, user=user ) url = request.app.url_path_for("get_file_content_by_id", id=file_item.id) return url Then just restart and test.
Author
Owner

@peiwenxu commented on GitHub (Aug 22, 2025):

Same issue here

@peiwenxu commented on GitHub (Aug 22, 2025): Same issue here
Author
Owner

@ALIENvsROBOT commented on GitHub (Aug 22, 2025):

I think it might be issue because of this fix #16726

@ALIENvsROBOT commented on GitHub (Aug 22, 2025): I think it might be issue because of this fix #16726
Author
Owner

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

Should be addressed with 88a5b5ff4c

@tjbck commented on GitHub (Aug 22, 2025): Should be addressed with 88a5b5ff4c40a339aecb796846cfc5223407ce61
Author
Owner

@anthrotype commented on GitHub (Aug 22, 2025):

https://github.com/open-webui/open-webui/commit/88a5b5ff4c40a339aecb796846cfc5223407ce61 only fixed the

TypeError: argument of type 'NoneType' is not iterable

But after fixing that, I am still getting another error, same as @GFYURI wrote above

TypeError: upload_file() missing 1 required positional argument: 'background_tasks'

Note that this is not just ComfyUI image generation but any image generation (I'm using Gemini)

@anthrotype commented on GitHub (Aug 22, 2025): https://github.com/open-webui/open-webui/commit/88a5b5ff4c40a339aecb796846cfc5223407ce61 only fixed the ``` TypeError: argument of type 'NoneType' is not iterable ``` But after fixing that, I am still getting another error, same as @GFYURI wrote above ``` TypeError: upload_file() missing 1 required positional argument: 'background_tasks' ``` Note that this is not just ComfyUI image generation but any image generation (I'm using Gemini)
Author
Owner

@fighter3005 commented on GitHub (Aug 22, 2025):

Yes, I just tried and can confirm. Still the same error.

I am a bit confused, since the upload_file method is only used for uploading images!? I guess

file_item = upload_file(
        request, None, file=file, metadata=metadata, process=False, user=user
    )

should work in image.py

def upload_image(request, image_data, content_type, metadata, user):
    image_format = mimetypes.guess_extension(content_type)
    file = UploadFile(
        file=io.BytesIO(image_data),
        filename=f"generated-image{image_format}",  # will be converted to a unique ID on upload_file
        headers={
            "content-type": content_type,
        },
    )
    file_item = upload_file(
        request, file=file, metadata=metadata, process=False, user=user  // <------------- HERE
    )
    url = request.app.url_path_for("get_file_content_by_id", id=file_item.id)
    return url
@fighter3005 commented on GitHub (Aug 22, 2025): Yes, I just tried and can confirm. Still the same error. I am a bit confused, since the upload_file method is only used for uploading images!? I guess ``` file_item = upload_file( request, None, file=file, metadata=metadata, process=False, user=user ) ``` should work in image.py ``` def upload_image(request, image_data, content_type, metadata, user): image_format = mimetypes.guess_extension(content_type) file = UploadFile( file=io.BytesIO(image_data), filename=f"generated-image{image_format}", # will be converted to a unique ID on upload_file headers={ "content-type": content_type, }, ) file_item = upload_file( request, file=file, metadata=metadata, process=False, user=user // <------------- HERE ) url = request.app.url_path_for("get_file_content_by_id", id=file_item.id) return url ```
Author
Owner

@nihilimbo commented on GitHub (Aug 22, 2025):

Same here, the prompt is correctly sent to ComfyUI, the image is generated (I can see it in the ComfyUI Dashboard) but OWUI fails to retrieve and show the generated image.

So much for a critital bug fix...

@nihilimbo commented on GitHub (Aug 22, 2025): Same here, the prompt is correctly sent to ComfyUI, the image is generated (I can see it in the ComfyUI Dashboard) but OWUI fails to retrieve and show the generated image. So much for a critital bug fix...
Author
Owner

@ALIENvsROBOT commented on GitHub (Aug 22, 2025):

@tjbck Please reopen and fix the bug which still exist

@ALIENvsROBOT commented on GitHub (Aug 22, 2025): @tjbck Please reopen and fix the bug which still exist
Author
Owner

@Haervwe commented on GitHub (Aug 22, 2025):

The issue is still exist. Logs :

2025-08-22 19:50:55.773 | ERROR    | open_webui.utils.middleware:chat_image_generation_handler:586 - 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks']
Traceback (most recent call last):

  File "/app/backend/open_webui/routers/images.py", line 555, in image_generations
    url = upload_image(request, image_data, content_type, data, user)
          │            │        │           │             │     └ UserModel(id='b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', name='Admin', email='admin@localhost', username=None, role='...
          │            │        │           │             └ {'created': 1755867055, 'data': [{'b64_json': '/9j/4Qq+RXhpZgAASUkqAAgAAAAIAA8BAgAFAAAAfgAAABIBAwABAAAAAQAAABoBBQABAAAAbgAAAB...
          │            │        │           └ 'image/png'
          │            │        └ b'\xff\xd8\xff\xe1\n\xbeExif\x00\x00II*\x00\x08\x00\x00\x00\x08\x00\x0f\x01\x02\x00\x05\x00\x00\x00~\x00\x00\x00\x12\x01\x03\...
          │            └ <starlette.requests.Request object at 0x7fe7a82b7210>
          └ <function upload_image at 0x7fe7e579f1a0>

  File "/app/backend/open_webui/routers/images.py", line 472, in upload_image
    file_item = upload_file(
                └ <function upload_file at 0x7fe7e572fec0>

TypeError: upload_file() missing 1 required positional argument: 'background_tasks'


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 1161, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0x7fe811c09a80>
           └ <Command main>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         │    │      └ <click.core.Context object at 0x7fe81294f210>
         │    └ <function Command.invoke at 0x7fe811c0a660>
         └ <Command main>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
           │   │      │    │           └ <click.core.Context object at 0x7fe81294f210>
           │   │      │    └ <function main at 0x7fe81185c860>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0x7fe811c08fe0>
           └ <click.core.Context object at 0x7fe81294f210>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
                       │       └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
                       └ ()
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main
    run(
    └ <function run at 0x7fe811c7e0c0>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run
    server.run()
    │      └ <function Server.run at 0x7fe811abf6a0>
    └ <uvicorn.server.Server object at 0x7fe811c61310>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7fe811abf740>
           │       │   └ <uvicorn.server.Server object at 0x7fe811c61310>
           │       └ <function run at 0x7fe811ffd3a0>
           └ <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 0x7fe811a21e40>
           │      └ <function Runner.run at 0x7fe811e50f40>
           └ <asyncio.runners.Runner object at 0x7fe811877790>
  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:69> wai...
           │    │     └ <cyfunction Loop.run_until_complete at 0x7fe81189e4d0>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0x7fe811877790>

  File "/app/backend/open_webui/main.py", line 1492, in process_chat
    form_data, metadata, events = await process_chat_payload(
    │          │                        └ <function process_chat_payload at 0x7fe7de7afc40>
    │          └ {'user_id': 'b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', 'chat_id': '1d5a18cb-6831-4b01-a711-040ef5ffafa2', 'message_id': '7d84861...
    └ {'stream': True, 'model': 'gpt-4.1-nano', 'messages': [{'role': 'user', 'content': 'Random image'}, {'role': 'assistant', 'conten...

  File "/app/backend/open_webui/utils/middleware.py", line 883, in process_chat_payload
    form_data = await chat_image_generation_handler(
                      └ <function chat_image_generation_handler at 0x7fe7de7afa60>

> File "/app/backend/open_webui/utils/middleware.py", line 556, in chat_image_generation_handler
    images = await image_generations(
                   └ <function image_generations at 0x7fe7e579f2e0>

  File "/app/backend/open_webui/routers/images.py", line 706, in image_generations
    raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(error))
          │                                     │              │       └ TypeError("upload_file() missing 1 required positional argument: 'background_tasks'")
          │                                     │              └ <function ERROR_MESSAGES.<lambda> at 0x7fe80dcc1a80>
          │                                     └ <enum 'ERROR_MESSAGES'>
          └ <class 'fastapi.exceptions.HTTPException'>

fastapi.exceptions.HTTPException: 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks']

Yes I'm now facing the same upload files issue as above , still after the update

@Haervwe commented on GitHub (Aug 22, 2025): > The issue is still exist. Logs : > > ``` > 2025-08-22 19:50:55.773 | ERROR | open_webui.utils.middleware:chat_image_generation_handler:586 - 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks'] > Traceback (most recent call last): > > File "/app/backend/open_webui/routers/images.py", line 555, in image_generations > url = upload_image(request, image_data, content_type, data, user) > │ │ │ │ │ └ UserModel(id='b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', name='Admin', email='admin@localhost', username=None, role='... > │ │ │ │ └ {'created': 1755867055, 'data': [{'b64_json': '/9j/4Qq+RXhpZgAASUkqAAgAAAAIAA8BAgAFAAAAfgAAABIBAwABAAAAAQAAABoBBQABAAAAbgAAAB... > │ │ │ └ 'image/png' > │ │ └ b'\xff\xd8\xff\xe1\n\xbeExif\x00\x00II*\x00\x08\x00\x00\x00\x08\x00\x0f\x01\x02\x00\x05\x00\x00\x00~\x00\x00\x00\x12\x01\x03\... > │ └ <starlette.requests.Request object at 0x7fe7a82b7210> > └ <function upload_image at 0x7fe7e579f1a0> > > File "/app/backend/open_webui/routers/images.py", line 472, in upload_image > file_item = upload_file( > └ <function upload_file at 0x7fe7e572fec0> > > TypeError: upload_file() missing 1 required positional argument: 'background_tasks' > > > 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 1161, in __call__ > return self.main(*args, **kwargs) > │ │ │ └ {} > │ │ └ () > │ └ <function BaseCommand.main at 0x7fe811c09a80> > └ <Command main> > File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main > rv = self.invoke(ctx) > │ │ └ <click.core.Context object at 0x7fe81294f210> > │ └ <function Command.invoke at 0x7fe811c0a660> > └ <Command main> > File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke > return ctx.invoke(self.callback, **ctx.params) > │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... > │ │ │ │ └ <click.core.Context object at 0x7fe81294f210> > │ │ │ └ <function main at 0x7fe81185c860> > │ │ └ <Command main> > │ └ <function Context.invoke at 0x7fe811c08fe0> > └ <click.core.Context object at 0x7fe81294f210> > File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke > return __callback(*args, **kwargs) > │ └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... > └ () > File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main > run( > └ <function run at 0x7fe811c7e0c0> > File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run > server.run() > │ └ <function Server.run at 0x7fe811abf6a0> > └ <uvicorn.server.Server object at 0x7fe811c61310> > File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run > return asyncio.run(self.serve(sockets=sockets)) > │ │ │ │ └ None > │ │ │ └ <function Server.serve at 0x7fe811abf740> > │ │ └ <uvicorn.server.Server object at 0x7fe811c61310> > │ └ <function run at 0x7fe811ffd3a0> > └ <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 0x7fe811a21e40> > │ └ <function Runner.run at 0x7fe811e50f40> > └ <asyncio.runners.Runner object at 0x7fe811877790> > 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:69> wai... > │ │ └ <cyfunction Loop.run_until_complete at 0x7fe81189e4d0> > │ └ <uvloop.Loop running=True closed=False debug=False> > └ <asyncio.runners.Runner object at 0x7fe811877790> > > File "/app/backend/open_webui/main.py", line 1492, in process_chat > form_data, metadata, events = await process_chat_payload( > │ │ └ <function process_chat_payload at 0x7fe7de7afc40> > │ └ {'user_id': 'b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', 'chat_id': '1d5a18cb-6831-4b01-a711-040ef5ffafa2', 'message_id': '7d84861... > └ {'stream': True, 'model': 'gpt-4.1-nano', 'messages': [{'role': 'user', 'content': 'Random image'}, {'role': 'assistant', 'conten... > > File "/app/backend/open_webui/utils/middleware.py", line 883, in process_chat_payload > form_data = await chat_image_generation_handler( > └ <function chat_image_generation_handler at 0x7fe7de7afa60> > > > File "/app/backend/open_webui/utils/middleware.py", line 556, in chat_image_generation_handler > images = await image_generations( > └ <function image_generations at 0x7fe7e579f2e0> > > File "/app/backend/open_webui/routers/images.py", line 706, in image_generations > raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(error)) > │ │ │ └ TypeError("upload_file() missing 1 required positional argument: 'background_tasks'") > │ │ └ <function ERROR_MESSAGES.<lambda> at 0x7fe80dcc1a80> > │ └ <enum 'ERROR_MESSAGES'> > └ <class 'fastapi.exceptions.HTTPException'> > > fastapi.exceptions.HTTPException: 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks'] > ``` Yes I'm now facing the same upload files issue as above , still after the update
Author
Owner

@kristapsx commented on GitHub (Aug 22, 2025):

The issue is still exist. Logs :

2025-08-22 19:50:55.773 | ERROR    | open_webui.utils.middleware:chat_image_generation_handler:586 - 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks']
Traceback (most recent call last):

  File "/app/backend/open_webui/routers/images.py", line 555, in image_generations
    url = upload_image(request, image_data, content_type, data, user)
          │            │        │           │             │     └ UserModel(id='b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', name='Admin', email='admin@localhost', username=None, role='...
          │            │        │           │             └ {'created': 1755867055, 'data': [{'b64_json': '/9j/4Qq+RXhpZgAASUkqAAgAAAAIAA8BAgAFAAAAfgAAABIBAwABAAAAAQAAABoBBQABAAAAbgAAAB...
          │            │        │           └ 'image/png'
          │            │        └ b'\xff\xd8\xff\xe1\n\xbeExif\x00\x00II*\x00\x08\x00\x00\x00\x08\x00\x0f\x01\x02\x00\x05\x00\x00\x00~\x00\x00\x00\x12\x01\x03\...
          │            └ <starlette.requests.Request object at 0x7fe7a82b7210>
          └ <function upload_image at 0x7fe7e579f1a0>

  File "/app/backend/open_webui/routers/images.py", line 472, in upload_image
    file_item = upload_file(
                └ <function upload_file at 0x7fe7e572fec0>

TypeError: upload_file() missing 1 required positional argument: 'background_tasks'


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 1161, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0x7fe811c09a80>
           └ <Command main>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         │    │      └ <click.core.Context object at 0x7fe81294f210>
         │    └ <function Command.invoke at 0x7fe811c0a660>
         └ <Command main>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
           │   │      │    │           └ <click.core.Context object at 0x7fe81294f210>
           │   │      │    └ <function main at 0x7fe81185c860>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0x7fe811c08fe0>
           └ <click.core.Context object at 0x7fe81294f210>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
                       │       └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
                       └ ()
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main
    run(
    └ <function run at 0x7fe811c7e0c0>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run
    server.run()
    │      └ <function Server.run at 0x7fe811abf6a0>
    └ <uvicorn.server.Server object at 0x7fe811c61310>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7fe811abf740>
           │       │   └ <uvicorn.server.Server object at 0x7fe811c61310>
           │       └ <function run at 0x7fe811ffd3a0>
           └ <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 0x7fe811a21e40>
           │      └ <function Runner.run at 0x7fe811e50f40>
           └ <asyncio.runners.Runner object at 0x7fe811877790>
  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:69> wai...
           │    │     └ <cyfunction Loop.run_until_complete at 0x7fe81189e4d0>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0x7fe811877790>

  File "/app/backend/open_webui/main.py", line 1492, in process_chat
    form_data, metadata, events = await process_chat_payload(
    │          │                        └ <function process_chat_payload at 0x7fe7de7afc40>
    │          └ {'user_id': 'b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', 'chat_id': '1d5a18cb-6831-4b01-a711-040ef5ffafa2', 'message_id': '7d84861...
    └ {'stream': True, 'model': 'gpt-4.1-nano', 'messages': [{'role': 'user', 'content': 'Random image'}, {'role': 'assistant', 'conten...

  File "/app/backend/open_webui/utils/middleware.py", line 883, in process_chat_payload
    form_data = await chat_image_generation_handler(
                      └ <function chat_image_generation_handler at 0x7fe7de7afa60>

> File "/app/backend/open_webui/utils/middleware.py", line 556, in chat_image_generation_handler
    images = await image_generations(
                   └ <function image_generations at 0x7fe7e579f2e0>

  File "/app/backend/open_webui/routers/images.py", line 706, in image_generations
    raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(error))
          │                                     │              │       └ TypeError("upload_file() missing 1 required positional argument: 'background_tasks'")
          │                                     │              └ <function ERROR_MESSAGES.<lambda> at 0x7fe80dcc1a80>
          │                                     └ <enum 'ERROR_MESSAGES'>
          └ <class 'fastapi.exceptions.HTTPException'>

fastapi.exceptions.HTTPException: 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks']

Yes I'm now facing the same upload files issue as above , still after the update

Fresh install today, first time set up, and same issue with 0.6.24 version.

@kristapsx commented on GitHub (Aug 22, 2025): > > The issue is still exist. Logs : > > ``` > > 2025-08-22 19:50:55.773 | ERROR | open_webui.utils.middleware:chat_image_generation_handler:586 - 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks'] > > Traceback (most recent call last): > > > > File "/app/backend/open_webui/routers/images.py", line 555, in image_generations > > url = upload_image(request, image_data, content_type, data, user) > > │ │ │ │ │ └ UserModel(id='b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', name='Admin', email='admin@localhost', username=None, role='... > > │ │ │ │ └ {'created': 1755867055, 'data': [{'b64_json': '/9j/4Qq+RXhpZgAASUkqAAgAAAAIAA8BAgAFAAAAfgAAABIBAwABAAAAAQAAABoBBQABAAAAbgAAAB... > > │ │ │ └ 'image/png' > > │ │ └ b'\xff\xd8\xff\xe1\n\xbeExif\x00\x00II*\x00\x08\x00\x00\x00\x08\x00\x0f\x01\x02\x00\x05\x00\x00\x00~\x00\x00\x00\x12\x01\x03\... > > │ └ <starlette.requests.Request object at 0x7fe7a82b7210> > > └ <function upload_image at 0x7fe7e579f1a0> > > > > File "/app/backend/open_webui/routers/images.py", line 472, in upload_image > > file_item = upload_file( > > └ <function upload_file at 0x7fe7e572fec0> > > > > TypeError: upload_file() missing 1 required positional argument: 'background_tasks' > > > > > > 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 1161, in __call__ > > return self.main(*args, **kwargs) > > │ │ │ └ {} > > │ │ └ () > > │ └ <function BaseCommand.main at 0x7fe811c09a80> > > └ <Command main> > > File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1082, in main > > rv = self.invoke(ctx) > > │ │ └ <click.core.Context object at 0x7fe81294f210> > > │ └ <function Command.invoke at 0x7fe811c0a660> > > └ <Command main> > > File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1443, in invoke > > return ctx.invoke(self.callback, **ctx.params) > > │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... > > │ │ │ │ └ <click.core.Context object at 0x7fe81294f210> > > │ │ │ └ <function main at 0x7fe81185c860> > > │ │ └ <Command main> > > │ └ <function Context.invoke at 0x7fe811c08fe0> > > └ <click.core.Context object at 0x7fe81294f210> > > File "/usr/local/lib/python3.11/site-packages/click/core.py", line 788, in invoke > > return __callback(*args, **kwargs) > > │ └ {'host': '0.0.0.0', 'port': 8000, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... > > └ () > > File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 409, in main > > run( > > └ <function run at 0x7fe811c7e0c0> > > File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 575, in run > > server.run() > > │ └ <function Server.run at 0x7fe811abf6a0> > > └ <uvicorn.server.Server object at 0x7fe811c61310> > > File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run > > return asyncio.run(self.serve(sockets=sockets)) > > │ │ │ │ └ None > > │ │ │ └ <function Server.serve at 0x7fe811abf740> > > │ │ └ <uvicorn.server.Server object at 0x7fe811c61310> > > │ └ <function run at 0x7fe811ffd3a0> > > └ <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 0x7fe811a21e40> > > │ └ <function Runner.run at 0x7fe811e50f40> > > └ <asyncio.runners.Runner object at 0x7fe811877790> > > 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:69> wai... > > │ │ └ <cyfunction Loop.run_until_complete at 0x7fe81189e4d0> > > │ └ <uvloop.Loop running=True closed=False debug=False> > > └ <asyncio.runners.Runner object at 0x7fe811877790> > > > > File "/app/backend/open_webui/main.py", line 1492, in process_chat > > form_data, metadata, events = await process_chat_payload( > > │ │ └ <function process_chat_payload at 0x7fe7de7afc40> > > │ └ {'user_id': 'b39b6efd-b553-4b2a-a12c-1a2e18e15e7d', 'chat_id': '1d5a18cb-6831-4b01-a711-040ef5ffafa2', 'message_id': '7d84861... > > └ {'stream': True, 'model': 'gpt-4.1-nano', 'messages': [{'role': 'user', 'content': 'Random image'}, {'role': 'assistant', 'conten... > > > > File "/app/backend/open_webui/utils/middleware.py", line 883, in process_chat_payload > > form_data = await chat_image_generation_handler( > > └ <function chat_image_generation_handler at 0x7fe7de7afa60> > > > > > File "/app/backend/open_webui/utils/middleware.py", line 556, in chat_image_generation_handler > > images = await image_generations( > > └ <function image_generations at 0x7fe7e579f2e0> > > > > File "/app/backend/open_webui/routers/images.py", line 706, in image_generations > > raise HTTPException(status_code=400, detail=ERROR_MESSAGES.DEFAULT(error)) > > │ │ │ └ TypeError("upload_file() missing 1 required positional argument: 'background_tasks'") > > │ │ └ <function ERROR_MESSAGES.<lambda> at 0x7fe80dcc1a80> > > │ └ <enum 'ERROR_MESSAGES'> > > └ <class 'fastapi.exceptions.HTTPException'> > > > > fastapi.exceptions.HTTPException: 400: [ERROR: upload_file() missing 1 required positional argument: 'background_tasks'] > > ``` > > Yes I'm now facing the same upload files issue as above , still after the update Fresh install today, first time set up, and same issue with 0.6.24 version.
Author
Owner

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

https://github.com/open-webui/open-webui/pull/16821

@tjbck commented on GitHub (Aug 22, 2025): https://github.com/open-webui/open-webui/pull/16821
Author
Owner

@Haervwe commented on GitHub (Aug 22, 2025):

Fixed for me on latest version too

@Haervwe commented on GitHub (Aug 22, 2025): Fixed for me on latest version too
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#6160