issue: 404 error when using gemini imagen-3.0-generate-002 (log attached) #4956

Closed
opened 2025-11-11 16:07:59 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @flashlab on GitHub (Apr 24, 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

0.6.5

Ollama Version (if applicable)

No response

Operating System

Windows 11

Browser (if applicable)

MS Edge (latest)

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

Display the generated image.

Actual Behavior

Error occured while part of the image showed up. The final output is "404: Open WebUI: Server Connection Error"

Steps to Reproduce

  1. Use official gemini API in Admin image settings
  2. Check image option in dialog form, write promotes and send
  3. Showing loading process for a while and show up the top part of the iamge
  4. Finally give out error result

Logs & Screenshots

Settings:
Image

Flash show up of generated image:
Image

Final result:
Image

Corresponding console error:
Image

Corresponding network:
Image

Click to view relate docker logs:
2025-04-24 15:19:53.299 | INFO     | open_webui.routers.openai:get_all_models:389 - get_all_models() - {}
2025-04-24 15:19:54.514 | ERROR    | open_webui.routers.openai:generate_chat_completion:749 - 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' - {}
Traceback (most recent call last):

  File "/usr/local/bin/uvicorn", line 10, in <module>
    sys.exit(main())
    │   │    └ <Command main>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0xffffa41b5e40>
           └ <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 0xffffa511c310>
         │    └ <function Command.invoke at 0xffffa41b6a20>
         └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
           │   │      │    │           └ <click.core.Context object at 0xffffa511c310>
           │   │      │    └ <function main at 0xffffa3c15620>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0xffffa41b53a0>
           └ <click.core.Context object at 0xffffa511c310>
  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': 8080, '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 412, in main
    run(
    └ <function run at 0xffffa40e3ec0>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
    server.run()
    │      └ <function Server.run at 0xffffa3fe1300>
    └ <uvicorn.server.Server object at 0xffffa4007050>
  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 0xffffa3fe13a0>
           │       │   └ <uvicorn.server.Server object at 0xffffa4007050>
           │       └ <function run at 0xffffa4660b80>
           └ <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 0xffffa3dd27a0>
           │      └ <function Runner.run at 0xffffa4410720>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffffa3c55220>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffff46afa7a0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50>
  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 0xffff46afa7a0>
          │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    │    └ <starlette.requests.Request object at 0xffff46bb50d0>
          │                            │    └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
          │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a13420>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>>
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │     └ <function Route.handle at 0xffffa100cb80>
          └ 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 0xffff46a13420>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <function request_response.<locals>.app at 0xffff47be4ae0>
          └ 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 0xffff46a13420>
          │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    └ <starlette.requests.Request object at 0xffff46bb4590>
          │                            └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a111c0>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
                     │ └ <starlette.requests.Request object at 0xffff46bb4590>
                     └ <function get_request_handler.<locals>.app at 0xffff47b479c0>
  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 0xffffa100e980>
  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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm...
                 │         └ <function chat_completion at 0xffff47b44680>
                 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

  File "/app/backend/open_webui/main.py", line 1130, in chat_completion
    form_data, metadata, events = await process_chat_payload(
    │          │                        └ <function process_chat_payload at 0xffff70b94180>
    │          └ {'user_id': '294a7fa2-bff8-4395-88b7-f0e01adfc7d8', 'chat_id': 'bebfafa0-9d1a-443a-a5fb-e19f04198e91', 'message_id': '6362a39...
    └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '根据以下提示创作一张绘本图片,比例为4:3,配...

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

  File "/app/backend/open_webui/utils/middleware.py", line 493, in chat_image_generation_handler
    res = await generate_image_prompt(
                └ <function generate_image_prompt at 0xffff722fc900>

  File "/app/backend/open_webui/routers/tasks.py", line 382, in generate_image_prompt
    return await generate_chat_completion(request, form_data=payload, user=user)
                 │                        │                  │             └ UserModel(id='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='admin', prof...
                 │                        │                  └ {'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '### Task:\nGenerate a detailed prompt f...
                 │                        └ <starlette.requests.Request object at 0xffff46bb4590>
                 └ <function generate_chat_completion at 0xffff72267a60>

  File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion
    return await generate_openai_chat_completion(
                 └ <function generate_chat_completion at 0xffff723947c0>

> File "/app/backend/open_webui/routers/openai.py", line 746, in generate_chat_completion
    r.raise_for_status()
    │ └ <function ClientResponse.raise_for_status at 0xffffa166a840>
    └ <ClientResponse(https://generativelanguage.googleapis.com/v1beta/openai/chat/completions) [404 Not Found]>
      <CIMultiDictProxy(...

  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
    raise ClientResponseError(
          └ <class 'aiohttp.client_exceptions.ClientResponseError'>

aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions'
2025-04-24 15:19:54.521 | ERROR    | open_webui.routers.tasks:generate_image_prompt:384 - Exception occurred - {}
Traceback (most recent call last):

  File "/app/backend/open_webui/routers/openai.py", line 746, in generate_chat_completion
    r.raise_for_status()
    │ └ <function ClientResponse.raise_for_status at 0xffffa166a840>
    └ <ClientResponse(https://generativelanguage.googleapis.com/v1beta/openai/chat/completions) [404 Not Found]>
      <CIMultiDictProxy(...

  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
    raise ClientResponseError(
          └ <class 'aiohttp.client_exceptions.ClientResponseError'>

aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/usr/local/bin/uvicorn", line 10, in <module>
    sys.exit(main())
    │   │    └ <Command main>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0xffffa41b5e40>
           └ <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 0xffffa511c310>
         │    └ <function Command.invoke at 0xffffa41b6a20>
         └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
           │   │      │    │           └ <click.core.Context object at 0xffffa511c310>
           │   │      │    └ <function main at 0xffffa3c15620>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0xffffa41b53a0>
           └ <click.core.Context object at 0xffffa511c310>
  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': 8080, '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 412, in main
    run(
    └ <function run at 0xffffa40e3ec0>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
    server.run()
    │      └ <function Server.run at 0xffffa3fe1300>
    └ <uvicorn.server.Server object at 0xffffa4007050>
  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 0xffffa3fe13a0>
           │       │   └ <uvicorn.server.Server object at 0xffffa4007050>
           │       └ <function run at 0xffffa4660b80>
           └ <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 0xffffa3dd27a0>
           │      └ <function Runner.run at 0xffffa4410720>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffffa3c55220>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffff46afa7a0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50>
  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 0xffff46afa7a0>
          │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    │    └ <starlette.requests.Request object at 0xffff46bb50d0>
          │                            │    └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
          │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a13420>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>>
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │     └ <function Route.handle at 0xffffa100cb80>
          └ 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 0xffff46a13420>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <function request_response.<locals>.app at 0xffff47be4ae0>
          └ 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 0xffff46a13420>
          │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    └ <starlette.requests.Request object at 0xffff46bb4590>
          │                            └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a111c0>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
                     │ └ <starlette.requests.Request object at 0xffff46bb4590>
                     └ <function get_request_handler.<locals>.app at 0xffff47b479c0>
  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 0xffffa100e980>
  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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm...
                 │         └ <function chat_completion at 0xffff47b44680>
                 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

  File "/app/backend/open_webui/main.py", line 1130, in chat_completion
    form_data, metadata, events = await process_chat_payload(
    │          │                        └ <function process_chat_payload at 0xffff70b94180>
    │          └ {'user_id': '294a7fa2-bff8-4395-88b7-f0e01adfc7d8', 'chat_id': 'bebfafa0-9d1a-443a-a5fb-e19f04198e91', 'message_id': '6362a39...
    └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '根据以下提示创作一张绘本图片,比例为4:3,配...

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

  File "/app/backend/open_webui/utils/middleware.py", line 493, in chat_image_generation_handler
    res = await generate_image_prompt(
                └ <function generate_image_prompt at 0xffff722fc900>

> File "/app/backend/open_webui/routers/tasks.py", line 382, in generate_image_prompt
    return await generate_chat_completion(request, form_data=payload, user=user)
                 │                        │                  │             └ UserModel(id='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='admin', prof...
                 │                        │                  └ {'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '### Task:\nGenerate a detailed prompt f...
                 │                        └ <starlette.requests.Request object at 0xffff46bb4590>
                 └ <function generate_chat_completion at 0xffff72267a60>

  File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion
    return await generate_openai_chat_completion(
                 └ <function generate_chat_completion at 0xffff723947c0>

  File "/app/backend/open_webui/routers/openai.py", line 758, in generate_chat_completion
    raise HTTPException(
          └ <class 'fastapi.exceptions.HTTPException'>

fastapi.exceptions.HTTPException: 404: Open WebUI: Server Connection Error
2025-04-24 15:19:54.525 | ERROR    | open_webui.utils.middleware:chat_image_generation_handler:518 - 'JSONResponse' object is not subscriptable - {}
Traceback (most recent call last):

  File "/usr/local/bin/uvicorn", line 10, in <module>
    sys.exit(main())
    │   │    └ <Command main>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0xffffa41b5e40>
           └ <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 0xffffa511c310>
         │    └ <function Command.invoke at 0xffffa41b6a20>
         └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
           │   │      │    │           └ <click.core.Context object at 0xffffa511c310>
           │   │      │    └ <function main at 0xffffa3c15620>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0xffffa41b53a0>
           └ <click.core.Context object at 0xffffa511c310>
  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': 8080, '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 412, in main
    run(
    └ <function run at 0xffffa40e3ec0>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
    server.run()
    │      └ <function Server.run at 0xffffa3fe1300>
    └ <uvicorn.server.Server object at 0xffffa4007050>
  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 0xffffa3fe13a0>
           │       │   └ <uvicorn.server.Server object at 0xffffa4007050>
           │       └ <function run at 0xffffa4660b80>
           └ <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 0xffffa3dd27a0>
           │      └ <function Runner.run at 0xffffa4410720>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffffa3c55220>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffff46afa7a0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50>
  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 0xffff46afa7a0>
          │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    │    └ <starlette.requests.Request object at 0xffff46bb50d0>
          │                            │    └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
          │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a13420>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>>
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │     └ <function Route.handle at 0xffffa100cb80>
          └ 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 0xffff46a13420>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <function request_response.<locals>.app at 0xffff47be4ae0>
          └ 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 0xffff46a13420>
          │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    └ <starlette.requests.Request object at 0xffff46bb4590>
          │                            └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a111c0>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
                     │ └ <starlette.requests.Request object at 0xffff46bb4590>
                     └ <function get_request_handler.<locals>.app at 0xffff47b479c0>
  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 0xffffa100e980>
  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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm...
                 │         └ <function chat_completion at 0xffff47b44680>
                 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

  File "/app/backend/open_webui/main.py", line 1130, in chat_completion
    form_data, metadata, events = await process_chat_payload(
    │          │                        └ <function process_chat_payload at 0xffff70b94180>
    │          └ {'user_id': '294a7fa2-bff8-4395-88b7-f0e01adfc7d8', 'chat_id': 'bebfafa0-9d1a-443a-a5fb-e19f04198e91', 'message_id': '6362a39...
    └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '根据以下提示创作一张绘本图片,比例为4:3,配...

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

> File "/app/backend/open_webui/utils/middleware.py", line 502, in chat_image_generation_handler
    response = res["choices"][0]["message"]["content"]
               └ <starlette.responses.JSONResponse object at 0xffff46ac7f90>

TypeError: 'JSONResponse' object is not subscriptable
2025-04-24 15:20:05.388 | INFO     | open_webui.routers.files:upload_file:89 - file.content_type: image/png - {}
2025-04-24 15:20:05.407 | INFO     | open_webui.routers.openai:get_all_models:389 - get_all_models() - {}
2025-04-24 15:20:05.665 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 43.153.xx.xxx:0 - "GET /api/v1/files/81d80188-af2c-4994-9a10-cee37828fc8f/content HTTP/1.1" 200 - {}
2025-04-24 15:20:06.575 | ERROR    | open_webui.routers.openai:generate_chat_completion:749 - 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' - {}
Traceback (most recent call last):

  File "/usr/local/bin/uvicorn", line 10, in <module>
    sys.exit(main())
    │   │    └ <Command main>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0xffffa41b5e40>
           └ <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 0xffffa511c310>
         │    └ <function Command.invoke at 0xffffa41b6a20>
         └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
           │   │      │    │           └ <click.core.Context object at 0xffffa511c310>
           │   │      │    └ <function main at 0xffffa3c15620>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0xffffa41b53a0>
           └ <click.core.Context object at 0xffffa511c310>
  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': 8080, '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 412, in main
    run(
    └ <function run at 0xffffa40e3ec0>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
    server.run()
    │      └ <function Server.run at 0xffffa3fe1300>
    └ <uvicorn.server.Server object at 0xffffa4007050>
  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 0xffffa3fe13a0>
           │       │   └ <uvicorn.server.Server object at 0xffffa4007050>
           │       └ <function run at 0xffffa4660b80>
           └ <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 0xffffa3dd27a0>
           │      └ <function Runner.run at 0xffffa4410720>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffffa3c55220>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0xffffa3c1f890>
  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 0xffff46afa7a0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50>
  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 0xffff46afa7a0>
          │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    │    └ <starlette.requests.Request object at 0xffff46bb50d0>
          │                            │    └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
          │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a13420>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>>
          └ <fastapi.routing.APIRouter object at 0xffff70a964d0>
  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 0xffff46a13420>
          │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │     └ <function Route.handle at 0xffffa100cb80>
          └ 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 0xffff46a13420>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │    └ <function request_response.<locals>.app at 0xffff47be4ae0>
          └ 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 0xffff46a13420>
          │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          │                            │    └ <starlette.requests.Request object at 0xffff46bb4590>
          │                            └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
          └ <function wrap_app_handling_exceptions at 0xffffa0e234c0>
  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 0xffff46a111c0>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c...
          └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920>
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
                     │ └ <starlette.requests.Request object at 0xffff46bb4590>
                     └ <function get_request_handler.<locals>.app at 0xffff47b479c0>
  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 0xffffa100e980>
  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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm...
                 │         └ <function chat_completion at 0xffff47b44680>
                 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

  File "/app/backend/open_webui/main.py", line 1152, in chat_completion
    response = await chat_completion_handler(request, form_data, user)
                     │                       │        │          └ UserModel(id='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='admin', prof...
                     │                       │        └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'system', 'content': '<context>User is show...
                     │                       └ <starlette.requests.Request object at 0xffff46bb4590>
                     └ <function generate_chat_completion at 0xffff72267a60>

  File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion
    return await generate_openai_chat_completion(
                 └ <function generate_chat_completion at 0xffff723947c0>

> File "/app/backend/open_webui/routers/openai.py", line 746, in generate_chat_completion
    r.raise_for_status()
    │ └ <function ClientResponse.raise_for_status at 0xffffa166a840>
    └ <ClientResponse(https://generativelanguage.googleapis.com/v1beta/openai/chat/completions) [404 Not Found]>
      <CIMultiDictProxy(...

  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status
    raise ClientResponseError(
          └ <class 'aiohttp.client_exceptions.ClientResponseError'>

aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions'

Additional Information

The content request seems successfully fetched. Manually open the link "https://xxx.com/api/v1/files/81d80188-af2c-4994-9a10-cee37828fc8f/content" can open the generated image fully.

Originally created by @flashlab on GitHub (Apr 24, 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 0.6.5 ### Ollama Version (if applicable) _No response_ ### Operating System Windows 11 ### Browser (if applicable) MS Edge (latest) ### 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 Display the generated image. ### Actual Behavior Error occured while part of the image showed up. The final output is "404: Open WebUI: Server Connection Error" ### Steps to Reproduce 1. Use official gemini API in Admin image settings 2. Check image option in dialog form, write promotes and send 3. Showing loading process for a while and show up the top part of the iamge 4. Finally give out error result ### Logs & Screenshots Settings: ![Image](https://github.com/user-attachments/assets/4317c1a3-f681-445d-8a9c-311b0947fb4e) Flash show up of generated image: ![Image](https://github.com/user-attachments/assets/e79a7d27-f3f0-472c-aeac-27e195c204ac) Final result: ![Image](https://github.com/user-attachments/assets/3130a6b4-2bfe-4369-9a83-dba062ba85a7) Corresponding console error: ![Image](https://github.com/user-attachments/assets/2a0273ee-3b24-4790-9ba8-dd411c77ca1f) Corresponding network: ![Image](https://github.com/user-attachments/assets/db2d401c-efe7-435d-b83e-3082074a24e5) <details> <summary><b>Click to view relate docker logs:</b></summary> ``` 2025-04-24 15:19:53.299 | INFO | open_webui.routers.openai:get_all_models:389 - get_all_models() - {} 2025-04-24 15:19:54.514 | ERROR | open_webui.routers.openai:generate_chat_completion:749 - 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' - {} Traceback (most recent call last): File "/usr/local/bin/uvicorn", line 10, in <module> sys.exit(main()) │ │ └ <Command main> │ └ <built-in function exit> └ <module 'sys' (built-in)> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0xffffa41b5e40> └ <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 0xffffa511c310> │ └ <function Command.invoke at 0xffffa41b6a20> └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ │ │ │ └ <click.core.Context object at 0xffffa511c310> │ │ │ └ <function main at 0xffffa3c15620> │ │ └ <Command main> │ └ <function Context.invoke at 0xffffa41b53a0> └ <click.core.Context object at 0xffffa511c310> 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': 8080, '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 412, in main run( └ <function run at 0xffffa40e3ec0> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0xffffa3fe1300> └ <uvicorn.server.Server object at 0xffffa4007050> 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 0xffffa3fe13a0> │ │ └ <uvicorn.server.Server object at 0xffffa4007050> │ └ <function run at 0xffffa4660b80> └ <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 0xffffa3dd27a0> │ └ <function Runner.run at 0xffffa4410720> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffffa3c55220> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffff46afa7a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50> 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 0xffff46afa7a0> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ │ └ <starlette.requests.Request object at 0xffff46bb50d0> │ │ └ <fastapi.routing.APIRouter object at 0xffff70a964d0> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a13420> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>> └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function Route.handle at 0xffffa100cb80> └ 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function request_response.<locals>.app at 0xffff47be4ae0> └ 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 0xffff46a13420> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ └ <starlette.requests.Request object at 0xffff46bb4590> │ └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a111c0> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function get_request_handler.<locals>.app at 0xffff47b479c0> 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 0xffffa100e980> 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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm... │ └ <function chat_completion at 0xffff47b44680> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/main.py", line 1130, in chat_completion form_data, metadata, events = await process_chat_payload( │ │ └ <function process_chat_payload at 0xffff70b94180> │ └ {'user_id': '294a7fa2-bff8-4395-88b7-f0e01adfc7d8', 'chat_id': 'bebfafa0-9d1a-443a-a5fb-e19f04198e91', 'message_id': '6362a39... └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '根据以下提示创作一张绘本图片,比例为4:3,配... File "/app/backend/open_webui/utils/middleware.py", line 801, in process_chat_payload form_data = await chat_image_generation_handler( └ <function chat_image_generation_handler at 0xffff70b942c0> File "/app/backend/open_webui/utils/middleware.py", line 493, in chat_image_generation_handler res = await generate_image_prompt( └ <function generate_image_prompt at 0xffff722fc900> File "/app/backend/open_webui/routers/tasks.py", line 382, in generate_image_prompt return await generate_chat_completion(request, form_data=payload, user=user) │ │ │ └ UserModel(id='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='admin', prof... │ │ └ {'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '### Task:\nGenerate a detailed prompt f... │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function generate_chat_completion at 0xffff72267a60> File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion return await generate_openai_chat_completion( └ <function generate_chat_completion at 0xffff723947c0> > File "/app/backend/open_webui/routers/openai.py", line 746, in generate_chat_completion r.raise_for_status() │ └ <function ClientResponse.raise_for_status at 0xffffa166a840> └ <ClientResponse(https://generativelanguage.googleapis.com/v1beta/openai/chat/completions) [404 Not Found]> <CIMultiDictProxy(... File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status raise ClientResponseError( └ <class 'aiohttp.client_exceptions.ClientResponseError'> aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' 2025-04-24 15:19:54.521 | ERROR | open_webui.routers.tasks:generate_image_prompt:384 - Exception occurred - {} Traceback (most recent call last): File "/app/backend/open_webui/routers/openai.py", line 746, in generate_chat_completion r.raise_for_status() │ └ <function ClientResponse.raise_for_status at 0xffffa166a840> └ <ClientResponse(https://generativelanguage.googleapis.com/v1beta/openai/chat/completions) [404 Not Found]> <CIMultiDictProxy(... File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status raise ClientResponseError( └ <class 'aiohttp.client_exceptions.ClientResponseError'> aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/bin/uvicorn", line 10, in <module> sys.exit(main()) │ │ └ <Command main> │ └ <built-in function exit> └ <module 'sys' (built-in)> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0xffffa41b5e40> └ <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 0xffffa511c310> │ └ <function Command.invoke at 0xffffa41b6a20> └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ │ │ │ └ <click.core.Context object at 0xffffa511c310> │ │ │ └ <function main at 0xffffa3c15620> │ │ └ <Command main> │ └ <function Context.invoke at 0xffffa41b53a0> └ <click.core.Context object at 0xffffa511c310> 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': 8080, '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 412, in main run( └ <function run at 0xffffa40e3ec0> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0xffffa3fe1300> └ <uvicorn.server.Server object at 0xffffa4007050> 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 0xffffa3fe13a0> │ │ └ <uvicorn.server.Server object at 0xffffa4007050> │ └ <function run at 0xffffa4660b80> └ <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 0xffffa3dd27a0> │ └ <function Runner.run at 0xffffa4410720> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffffa3c55220> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffff46afa7a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50> 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 0xffff46afa7a0> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ │ └ <starlette.requests.Request object at 0xffff46bb50d0> │ │ └ <fastapi.routing.APIRouter object at 0xffff70a964d0> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a13420> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>> └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function Route.handle at 0xffffa100cb80> └ 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function request_response.<locals>.app at 0xffff47be4ae0> └ 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 0xffff46a13420> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ └ <starlette.requests.Request object at 0xffff46bb4590> │ └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a111c0> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function get_request_handler.<locals>.app at 0xffff47b479c0> 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 0xffffa100e980> 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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm... │ └ <function chat_completion at 0xffff47b44680> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/main.py", line 1130, in chat_completion form_data, metadata, events = await process_chat_payload( │ │ └ <function process_chat_payload at 0xffff70b94180> │ └ {'user_id': '294a7fa2-bff8-4395-88b7-f0e01adfc7d8', 'chat_id': 'bebfafa0-9d1a-443a-a5fb-e19f04198e91', 'message_id': '6362a39... └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '根据以下提示创作一张绘本图片,比例为4:3,配... File "/app/backend/open_webui/utils/middleware.py", line 801, in process_chat_payload form_data = await chat_image_generation_handler( └ <function chat_image_generation_handler at 0xffff70b942c0> File "/app/backend/open_webui/utils/middleware.py", line 493, in chat_image_generation_handler res = await generate_image_prompt( └ <function generate_image_prompt at 0xffff722fc900> > File "/app/backend/open_webui/routers/tasks.py", line 382, in generate_image_prompt return await generate_chat_completion(request, form_data=payload, user=user) │ │ │ └ UserModel(id='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='admin', prof... │ │ └ {'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '### Task:\nGenerate a detailed prompt f... │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function generate_chat_completion at 0xffff72267a60> File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion return await generate_openai_chat_completion( └ <function generate_chat_completion at 0xffff723947c0> File "/app/backend/open_webui/routers/openai.py", line 758, in generate_chat_completion raise HTTPException( └ <class 'fastapi.exceptions.HTTPException'> fastapi.exceptions.HTTPException: 404: Open WebUI: Server Connection Error 2025-04-24 15:19:54.525 | ERROR | open_webui.utils.middleware:chat_image_generation_handler:518 - 'JSONResponse' object is not subscriptable - {} Traceback (most recent call last): File "/usr/local/bin/uvicorn", line 10, in <module> sys.exit(main()) │ │ └ <Command main> │ └ <built-in function exit> └ <module 'sys' (built-in)> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0xffffa41b5e40> └ <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 0xffffa511c310> │ └ <function Command.invoke at 0xffffa41b6a20> └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ │ │ │ └ <click.core.Context object at 0xffffa511c310> │ │ │ └ <function main at 0xffffa3c15620> │ │ └ <Command main> │ └ <function Context.invoke at 0xffffa41b53a0> └ <click.core.Context object at 0xffffa511c310> 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': 8080, '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 412, in main run( └ <function run at 0xffffa40e3ec0> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0xffffa3fe1300> └ <uvicorn.server.Server object at 0xffffa4007050> 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 0xffffa3fe13a0> │ │ └ <uvicorn.server.Server object at 0xffffa4007050> │ └ <function run at 0xffffa4660b80> └ <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 0xffffa3dd27a0> │ └ <function Runner.run at 0xffffa4410720> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffffa3c55220> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffff46afa7a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50> 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 0xffff46afa7a0> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ │ └ <starlette.requests.Request object at 0xffff46bb50d0> │ │ └ <fastapi.routing.APIRouter object at 0xffff70a964d0> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a13420> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>> └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function Route.handle at 0xffffa100cb80> └ 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function request_response.<locals>.app at 0xffff47be4ae0> └ 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 0xffff46a13420> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ └ <starlette.requests.Request object at 0xffff46bb4590> │ └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a111c0> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function get_request_handler.<locals>.app at 0xffff47b479c0> 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 0xffffa100e980> 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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm... │ └ <function chat_completion at 0xffff47b44680> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/main.py", line 1130, in chat_completion form_data, metadata, events = await process_chat_payload( │ │ └ <function process_chat_payload at 0xffff70b94180> │ └ {'user_id': '294a7fa2-bff8-4395-88b7-f0e01adfc7d8', 'chat_id': 'bebfafa0-9d1a-443a-a5fb-e19f04198e91', 'message_id': '6362a39... └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'user', 'content': '根据以下提示创作一张绘本图片,比例为4:3,配... File "/app/backend/open_webui/utils/middleware.py", line 801, in process_chat_payload form_data = await chat_image_generation_handler( └ <function chat_image_generation_handler at 0xffff70b942c0> > File "/app/backend/open_webui/utils/middleware.py", line 502, in chat_image_generation_handler response = res["choices"][0]["message"]["content"] └ <starlette.responses.JSONResponse object at 0xffff46ac7f90> TypeError: 'JSONResponse' object is not subscriptable 2025-04-24 15:20:05.388 | INFO | open_webui.routers.files:upload_file:89 - file.content_type: image/png - {} 2025-04-24 15:20:05.407 | INFO | open_webui.routers.openai:get_all_models:389 - get_all_models() - {} 2025-04-24 15:20:05.665 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 43.153.xx.xxx:0 - "GET /api/v1/files/81d80188-af2c-4994-9a10-cee37828fc8f/content HTTP/1.1" 200 - {} 2025-04-24 15:20:06.575 | ERROR | open_webui.routers.openai:generate_chat_completion:749 - 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' - {} Traceback (most recent call last): File "/usr/local/bin/uvicorn", line 10, in <module> sys.exit(main()) │ │ └ <Command main> │ └ <built-in function exit> └ <module 'sys' (built-in)> File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1161, in __call__ return self.main(*args, **kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0xffffa41b5e40> └ <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 0xffffa511c310> │ └ <function Command.invoke at 0xffffa41b6a20> └ <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': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... │ │ │ │ └ <click.core.Context object at 0xffffa511c310> │ │ │ └ <function main at 0xffffa3c15620> │ │ └ <Command main> │ └ <function Context.invoke at 0xffffa41b53a0> └ <click.core.Context object at 0xffffa511c310> 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': 8080, '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 412, in main run( └ <function run at 0xffffa40e3ec0> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0xffffa3fe1300> └ <uvicorn.server.Server object at 0xffffa4007050> 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 0xffffa3fe13a0> │ │ └ <uvicorn.server.Server object at 0xffffa4007050> │ └ <function run at 0xffffa4660b80> └ <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 0xffffa3dd27a0> │ └ <function Runner.run at 0xffffa4410720> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffffa3c55220> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0xffffa3c1f890> 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 0xffff46afa7a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <open_webui.main.RedirectMiddleware object at 0xffff47c59d50> 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 0xffff46afa7a0> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ │ └ <starlette.requests.Request object at 0xffff46bb50d0> │ │ └ <fastapi.routing.APIRouter object at 0xffff70a964d0> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0xffff47f41190> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a13420> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0xffff70a964d0>> └ <fastapi.routing.APIRouter object at 0xffff70a964d0> 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function Route.handle at 0xffffa100cb80> └ 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 0xffff46a13420> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ └ <function request_response.<locals>.app at 0xffff47be4ae0> └ 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 0xffff46a13420> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... │ │ └ <starlette.requests.Request object at 0xffff46bb4590> │ └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> └ <function wrap_app_handling_exceptions at 0xffffa0e234c0> 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 0xffff46a111c0> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0xffff46af9c60> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.18.0.2', 8080), 'c... └ <function request_response.<locals>.app.<locals>.app at 0xffff46a13920> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function get_request_handler.<locals>.app at 0xffff47b479c0> 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 0xffffa100e980> 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='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='adm... │ └ <function chat_completion at 0xffff47b44680> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/main.py", line 1152, in chat_completion response = await chat_completion_handler(request, form_data, user) │ │ │ └ UserModel(id='294a7fa2-bff8-4395-88b7-f0e01adfc7d8', name='Zheng Harley', email='zhengjuefei25@gmail.com', role='admin', prof... │ │ └ {'stream': True, 'model': 'models/imagen-3.0-generate-002', 'messages': [{'role': 'system', 'content': '<context>User is show... │ └ <starlette.requests.Request object at 0xffff46bb4590> └ <function generate_chat_completion at 0xffff72267a60> File "/app/backend/open_webui/utils/chat.py", line 275, in generate_chat_completion return await generate_openai_chat_completion( └ <function generate_chat_completion at 0xffff723947c0> > File "/app/backend/open_webui/routers/openai.py", line 746, in generate_chat_completion r.raise_for_status() │ └ <function ClientResponse.raise_for_status at 0xffffa166a840> └ <ClientResponse(https://generativelanguage.googleapis.com/v1beta/openai/chat/completions) [404 Not Found]> <CIMultiDictProxy(... File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1161, in raise_for_status raise ClientResponseError( └ <class 'aiohttp.client_exceptions.ClientResponseError'> aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' ``` </details> ### Additional Information The content request seems successfully fetched. Manually open the link "https://xxx.com/api/v1/files/81d80188-af2c-4994-9a10-cee37828fc8f/content" can open the generated image fully.
GiteaMirror added the bug label 2025-11-11 16:07:59 -06:00
Author
Owner

@flashlab commented on GitHub (Apr 25, 2025):

Fixed.

@flashlab commented on GitHub (Apr 25, 2025): Fixed.
Author
Owner

@gjmveloso commented on GitHub (Apr 30, 2025):

Fixed.

Can you share how you fixed it? I'm experiencing the same error

@gjmveloso commented on GitHub (Apr 30, 2025): > Fixed. Can you share how you fixed it? I'm experiencing the same error
Author
Owner

@flashlab commented on GitHub (May 4, 2025):

Fixed.

Can you share how you fixed it? I'm experiencing the same error

Sorry to reply late, you can try specify a task model (external) to one other than the current one. The issue may be the rate limit while openwebui call the api for title generation.

@flashlab commented on GitHub (May 4, 2025): > > Fixed. > > Can you share how you fixed it? I'm experiencing the same error Sorry to reply late, you can try specify a task model (external) to one other than the current one. The issue may be the rate limit while openwebui call the api for title generation.
Author
Owner

@gjmveloso commented on GitHub (May 20, 2025):

Sorry to reply late, you can try specify a task model (external) to one other than the current one. The issue may be the rate limit while openwebui call the api for title generation.

Tried to use a different model for tasks (Gemini 2.0 Flash) but still receiving 404.

@gjmveloso commented on GitHub (May 20, 2025): > Sorry to reply late, you can try specify a task model (external) to one other than the current one. The issue may be the rate limit while openwebui call the api for title generation. Tried to use a different model for tasks (Gemini 2.0 Flash) but still receiving 404.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4956