issue: fastapi websocket error #4410

Closed
opened 2025-11-11 15:53:31 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @wrb2012 on GitHub (Mar 13, 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.3.19

Ollama Version (if applicable)

No response

Operating System

Rocky Linux 8

Browser (if applicable)

Chromium 101

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

Show jupyter output (e.g. plotly image)

Actual Behavior

Error: sent 1009 (message too big) frame with 3680078 bytes exceeds limit of 1048576 bytes; no close frame received

Steps to Reproduce

1.Change Code Execution Engine to jupyter
2. When use jupyter notebook to print 'hello world', its ok
3. but when import plotly and let it make some plot, webui have above error

Logs & Screenshots

2025-03-13 11:09:52.161 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 11.11.11.100:45734 - "GET /api/version/updates HTTP/1.1" 200 - {}
2025-03-13 11:09:59.736 | ERROR    | open_webui.utils.code_interpreter:run:77 - execute code failed, sent 1009 (message too big) frame with 3680078 bytes exceeds limit of 1048576 bytes; no close frame received - {}
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 0x7f3bc16e9da0>
           └ <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 0x7f3bc23b42d0>
         │    └ <function Command.invoke at 0x7f3bc16ea980>
         └ <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': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'...
           │   │      │    │           └ <click.core.Context object at 0x7f3bc23b42d0>
           │   │      │    └ <function main at 0x7f3bc12b2f20>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0x7f3bc16e9300>
           └ <click.core.Context object at 0x7f3bc23b42d0>
  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': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'...
                       └ ()
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main
    run(
    └ <function run at 0x7f3bc16f7e20>
  File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run
    server.run()
    │      └ <function Server.run at 0x7f3bc1555260>
    └ <uvicorn.server.Server object at 0x7f3bc16f9bd0>
  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 0x7f3bc1555300>
           │       │   └ <uvicorn.server.Server object at 0x7f3bc16f9bd0>
           │       └ <function run at 0x7f3bc1a60b80>
           └ <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 0x7f3bc1481d50>
           │      └ <function Runner.run at 0x7f3bc18d0720>
           └ <asyncio.runners.Runner object at 0x7f3bc12bbbd0>
  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 0x7f3bc12f4380>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0x7f3bc12bbbd0>
  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 0x7f3af07edbc0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          │    └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f3af37f1050>
          └ <open_webui.main.RedirectMiddleware object at 0x7f3af27cec10>
  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 0x7f3af07edbc0>
          │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          │                            │    │    └ <starlette.requests.Request object at 0x7f3af038c750>
          │                            │    └ <fastapi.routing.APIRouter object at 0x7f3af377a750>
          │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f3af37f1050>
          └ <function wrap_app_handling_exceptions at 0x7f3bbe92ef20>
  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 0x7f3af07ec4a0>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          └ <fastapi.routing.APIRouter object at 0x7f3af377a750>
  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 0x7f3af07ec4a0>
          │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f3af377a750>>
          └ <fastapi.routing.APIRouter object at 0x7f3af377a750>
  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 0x7f3af07ec4a0>
          │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          │     └ <function Route.handle at 0x7f3bbe9585e0>
          └ APIRoute(path='/api/v1/utils/code/execute', name='execute_code', 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 0x7f3af07ec4a0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          │    └ <function request_response.<locals>.app at 0x7f3af2795080>
          └ APIRoute(path='/api/v1/utils/code/execute', name='execute_code', 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 0x7f3af07ec4a0>
          │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          │                            │    └ <starlette.requests.Request object at 0x7f3af03cbb50>
          │                            └ <function request_response.<locals>.app.<locals>.app at 0x7f3af07eccc0>
          └ <function wrap_app_handling_exceptions at 0x7f3bbe92ef20>
  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 0x7f3aef302160>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
          └ <function request_response.<locals>.app.<locals>.app at 0x7f3af07eccc0>
  File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
                     │ └ <starlette.requests.Request object at 0x7f3af03cbb50>
                     └ <function get_request_handler.<locals>.app at 0x7f3af2794fe0>
  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 0x7f3bbe95a3e0>
  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='5fe9fb2a-323b-4d1a-8dec-307218288d5d', name='呜呜', email='rongbo.wu@sinotechgenomics.com', role='admin'...
                 │         └ <function execute_code at 0x7f3af3fab6a0>
                 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

  File "/app/backend/open_webui/routers/utils.py", line 51, in execute_code
    output = await execute_code_jupyter(
                   └ <function execute_code_jupyter at 0x7f3af3faa520>

  File "/app/backend/open_webui/utils/code_interpreter.py", line 209, in execute_code_jupyter
    result = await executor.run()
                   │        └ <function JupyterCodeExecuter.run at 0x7f3af3faac00>
                   └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950>

> File "/app/backend/open_webui/utils/code_interpreter.py", line 75, in run
    await self.execute_code()
          │    └ <function JupyterCodeExecuter.execute_code at 0x7f3af3faae80>
          └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950>

  File "/app/backend/open_webui/utils/code_interpreter.py", line 135, in execute_code
    await self.execute_in_jupyter(ws)
          │    │                  └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10>
          │    └ <function JupyterCodeExecuter.execute_in_jupyter at 0x7f3af3faaf20>
          └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950>

  File "/app/backend/open_webui/utils/code_interpreter.py", line 170, in execute_in_jupyter
    message = await asyncio.wait_for(ws.recv(), self.timeout)
                    │       │        │  │       │    └ 60
                    │       │        │  │       └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950>
                    │       │        │  └ <function Connection.recv at 0x7f3af233d940>
                    │       │        └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10>
                    │       └ <function wait_for at 0x7f3bc18c1080>
                    └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>

  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 489, in wait_for
    return fut.result()
           │   └ <method 'result' of '_asyncio.Task' objects>
           └ <Task finished name='Task-464938' coro=<Connection.recv() done, defined at /usr/local/lib/python3.11/site-packages/websockets...
  File "/usr/local/lib/python3.11/site-packages/websockets/asyncio/connection.py", line 322, in recv
    raise self.protocol.close_exc from self.recv_exc
          │    │        │              │    └ None
          │    │        │              └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10>
          │    │        └ <property object at 0x7f3bc0f4e520>
          │    └ <websockets.client.ClientProtocol object at 0x7f3aef3b9950>
          └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10>

websockets.exceptions.ConnectionClosedError: sent 1009 (message too big) frame with 3680078 bytes exceeds limit of 1048576 bytes; no close frame received

Additional Information

Maybe we should increase websockets max body size in uvicorn config in docker

Originally created by @wrb2012 on GitHub (Mar 13, 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.3.19 ### Ollama Version (if applicable) _No response_ ### Operating System Rocky Linux 8 ### Browser (if applicable) Chromium 101 ### 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 Show jupyter output (e.g. plotly image) ### Actual Behavior Error: sent 1009 (message too big) frame with 3680078 bytes exceeds limit of 1048576 bytes; no close frame received ### Steps to Reproduce 1.Change Code Execution Engine to jupyter 2. When use jupyter notebook to print 'hello world', its ok 3. but when import plotly and let it make some plot, webui have above error ### Logs & Screenshots ``` 2025-03-13 11:09:52.161 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 11.11.11.100:45734 - "GET /api/version/updates HTTP/1.1" 200 - {} 2025-03-13 11:09:59.736 | ERROR | open_webui.utils.code_interpreter:run:77 - execute code failed, sent 1009 (message too big) frame with 3680078 bytes exceeds limit of 1048576 bytes; no close frame received - {} 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 0x7f3bc16e9da0> └ <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 0x7f3bc23b42d0> │ └ <function Command.invoke at 0x7f3bc16ea980> └ <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': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'... │ │ │ │ └ <click.core.Context object at 0x7f3bc23b42d0> │ │ │ └ <function main at 0x7f3bc12b2f20> │ │ └ <Command main> │ └ <function Context.invoke at 0x7f3bc16e9300> └ <click.core.Context object at 0x7f3bc23b42d0> 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': '*', 'app': 'open_webui.main:app', 'uds': None, 'fd': None, 'reload'... └ () File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 412, in main run( └ <function run at 0x7f3bc16f7e20> File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 579, in run server.run() │ └ <function Server.run at 0x7f3bc1555260> └ <uvicorn.server.Server object at 0x7f3bc16f9bd0> 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 0x7f3bc1555300> │ │ └ <uvicorn.server.Server object at 0x7f3bc16f9bd0> │ └ <function run at 0x7f3bc1a60b80> └ <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 0x7f3bc1481d50> │ └ <function Runner.run at 0x7f3bc18d0720> └ <asyncio.runners.Runner object at 0x7f3bc12bbbd0> 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 0x7f3bc12f4380> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0x7f3bc12bbbd0> 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 0x7f3af07edbc0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f3af37f1050> └ <open_webui.main.RedirectMiddleware object at 0x7f3af27cec10> 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 0x7f3af07edbc0> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... │ │ │ └ <starlette.requests.Request object at 0x7f3af038c750> │ │ └ <fastapi.routing.APIRouter object at 0x7f3af377a750> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x7f3af37f1050> └ <function wrap_app_handling_exceptions at 0x7f3bbe92ef20> 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 0x7f3af07ec4a0> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... └ <fastapi.routing.APIRouter object at 0x7f3af377a750> 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 0x7f3af07ec4a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x7f3af377a750>> └ <fastapi.routing.APIRouter object at 0x7f3af377a750> 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 0x7f3af07ec4a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... │ └ <function Route.handle at 0x7f3bbe9585e0> └ APIRoute(path='/api/v1/utils/code/execute', name='execute_code', 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 0x7f3af07ec4a0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... │ └ <function request_response.<locals>.app at 0x7f3af2795080> └ APIRoute(path='/api/v1/utils/code/execute', name='execute_code', 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 0x7f3af07ec4a0> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... │ │ └ <starlette.requests.Request object at 0x7f3af03cbb50> │ └ <function request_response.<locals>.app.<locals>.app at 0x7f3af07eccc0> └ <function wrap_app_handling_exceptions at 0x7f3bbe92ef20> 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 0x7f3aef302160> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x7f3af07ec5e0> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... └ <function request_response.<locals>.app.<locals>.app at 0x7f3af07eccc0> File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) │ └ <starlette.requests.Request object at 0x7f3af03cbb50> └ <function get_request_handler.<locals>.app at 0x7f3af2794fe0> 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 0x7f3bbe95a3e0> 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='5fe9fb2a-323b-4d1a-8dec-307218288d5d', name='呜呜', email='rongbo.wu@sinotechgenomics.com', role='admin'... │ └ <function execute_code at 0x7f3af3fab6a0> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... File "/app/backend/open_webui/routers/utils.py", line 51, in execute_code output = await execute_code_jupyter( └ <function execute_code_jupyter at 0x7f3af3faa520> File "/app/backend/open_webui/utils/code_interpreter.py", line 209, in execute_code_jupyter result = await executor.run() │ └ <function JupyterCodeExecuter.run at 0x7f3af3faac00> └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950> > File "/app/backend/open_webui/utils/code_interpreter.py", line 75, in run await self.execute_code() │ └ <function JupyterCodeExecuter.execute_code at 0x7f3af3faae80> └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950> File "/app/backend/open_webui/utils/code_interpreter.py", line 135, in execute_code await self.execute_in_jupyter(ws) │ │ └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10> │ └ <function JupyterCodeExecuter.execute_in_jupyter at 0x7f3af3faaf20> └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950> File "/app/backend/open_webui/utils/code_interpreter.py", line 170, in execute_in_jupyter message = await asyncio.wait_for(ws.recv(), self.timeout) │ │ │ │ │ └ 60 │ │ │ │ └ <open_webui.utils.code_interpreter.JupyterCodeExecuter object at 0x7f3aefbc2950> │ │ │ └ <function Connection.recv at 0x7f3af233d940> │ │ └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10> │ └ <function wait_for at 0x7f3bc18c1080> └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> File "/usr/local/lib/python3.11/asyncio/tasks.py", line 489, in wait_for return fut.result() │ └ <method 'result' of '_asyncio.Task' objects> └ <Task finished name='Task-464938' coro=<Connection.recv() done, defined at /usr/local/lib/python3.11/site-packages/websockets... File "/usr/local/lib/python3.11/site-packages/websockets/asyncio/connection.py", line 322, in recv raise self.protocol.close_exc from self.recv_exc │ │ │ │ └ None │ │ │ └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10> │ │ └ <property object at 0x7f3bc0f4e520> │ └ <websockets.client.ClientProtocol object at 0x7f3aef3b9950> └ <websockets.asyncio.client.ClientConnection object at 0x7f3aeff7ea10> websockets.exceptions.ConnectionClosedError: sent 1009 (message too big) frame with 3680078 bytes exceeds limit of 1048576 bytes; no close frame received ``` ### Additional Information Maybe we should increase websockets max body size in uvicorn config in docker
GiteaMirror added the bug label 2025-11-11 15:53:31 -06:00
Author
Owner

@rgaricano commented on GitHub (Mar 13, 2025):

I don't think that this was by uvicorn limit, default --ws-max-size limit is 16777216

maybe increasing it on
b03fc97e28/backend/open_webui/utils/code_interpreter.py (L133)
websocket_url, additional_headers=ws_headers, max_size=10000000
(but by default is None?, no limit )

@rgaricano commented on GitHub (Mar 13, 2025): I don't think that this was by uvicorn limit, default --ws-max-size limit is 16777216 maybe increasing it on https://github.com/open-webui/open-webui/blob/b03fc97e287f31ad07bda896143959bc4413f7d2/backend/open_webui/utils/code_interpreter.py#L133 `websocket_url, additional_headers=ws_headers, max_size=10000000` (but [by default](https://websockets.readthedocs.io/en/stable/reference/asyncio/client.html) is None?, no limit )
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#4410