mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #4158] bug: [object Object] error when sending subsequent messages to the chat. #13518
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fracergu on GitHub (Jul 27, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/4158
Bug Report
Description
Bug Summary:
When using Open WebUI with an OpenAI API key, sending a second message in the chat occasionally results in no response. Refreshing the browser shows an error with the content [object Object]. Sometimes, it regenerates another response or duplicates the chat.
Steps to Reproduce:
Expected Behavior:
The application should respond to the second message without any issues and should not throw errors or duplicate chat entries.
Actual Behavior:
Sometimes the application does not respond after sending the second message. A page refresh yields an error showing [object Object]. Other times, it generates another response or duplicates the chat.
Environment
Open WebUI Version: 0.3.10
Ollama (if applicable): Not using ollama
Operating System: Server is running Debian 12, Clients Windows 11 and Arch
Browser (if applicable): Tested in Chrome 127.0.6533.73 and Firefox 128.0.3
Reproduction Details
Confirmation:
Logs and Screenshots
Browser Console Logs:
I have recorded the issue on this jam, console logs and network requests can be checked here.
Docker Container Logs:
[Include relevant Docker container logs, if applicable]
Did not see anything relevant on the logs far away than the 500s that can be checked on the jam. Anyways here they are on pastebin (my public ip obfuscated and will be destroyed in 6 months)
Screenshots (if applicable):

Installation Method
I have installed the app with the following docker-compose file:
Additional Information
The issue can be reproduced consistently but does not occur every time. I've attempted testing in both Chrome and Firefox, including clean versions without extensions. I also have tested seveal models from OpenAI (4o, 4o-mini and 3.5-turbo) and happens on all of them.
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
@vika2603 commented on GitHub (Jul 28, 2024):
same problem
@JKratto commented on GitHub (Jul 28, 2024):
I see a similar behaviour when chatting with a local Ollama model. I send a message, receive response with no problems. Then I continue in the chat. My response does not appear in the chat window, the window is not responding. After refreshing the web page, I see the "object object" banner, sometimes with my "unsent" message present, sometimes without it. This did not happen before.
@cstoicescu commented on GitHub (Jul 28, 2024):
Same problem here , i am using Groq, happens randomly with every model. I thing i noticed is that it happens after a long period of time i am authenticated and idle. I have to log out and relogin, or delete chat.
@fracergu commented on GitHub (Jul 29, 2024):
Changing issue title as it seems to happen also with local Ollama (I though initially it was related with OpenAI API)
@Akira-baa commented on GitHub (Jul 29, 2024):
Same error here since last update with Ollama
@Sturmkater commented on GitHub (Jul 30, 2024):
Same for me. Super annoying:-(
@ticpu commented on GitHub (Jul 30, 2024):
I can confirm this happens with multiple OpenAI model in the non-Docker version as well. Installed directly as a service. It does appear like it is a web UI issue as trying to send a message instantly result as a popup like this without this:

And can see in the console:
submitPrompt 748f3048-58d4-4bdd-9ab3-8aaf5ac84bd1 2 Chat.svelte:404:10
Wake Lock released +layout.svelte:69:13
submitPrompt 748f3048-58d4-4bdd-9ab3-8aaf5ac84bd1 Chat.svelte:404:10
submitPrompt 748f3048-58d4-4bdd-9ab3-8aaf5ac84bd1 4 Chat.svelte:404:10
Wake Lock released +layout.svelte:69:13
And there is still background network activity, so not completely frozen.
@Arthur-Llevelys commented on GitHub (Jul 30, 2024):
Same problem (Ollama 0.3.0 - Open UI 3.10)
@KangBuilds commented on GitHub (Jul 31, 2024):
Same problem here (v0.3.10, GPT-4o)
@tjbck commented on GitHub (Jul 31, 2024):
Unable to reproduce the issue unfortunately :/ I'd greatly appreciate if anyone could provide a way to reproduce reliably!
@JKratto commented on GitHub (Jul 31, 2024):
@tjbck I have torn down the container and redeployed it (uptime 4 days). Now, it behaves as expected. If the issue appears again, I will try to dig deeper into the logs (enabled DEBUG logging). Keep you posted.
TLDR: restarting the container seems to workaround the issue.
@beastech commented on GitHub (Jul 31, 2024):
Also happens when using pipeline to external LLM.
Here are the logs from when I send the first message.
2024-07-31 09:01:25 ERROR: Exception in ASGI application
2024-07-31 09:01:25 + Exception Group Traceback (most recent call last):
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
2024-07-31 09:01:25 | yield
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 190, in call
2024-07-31 09:01:25 | async with anyio.create_task_group() as task_group:
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 680, in aexit
2024-07-31 09:01:25 | raise BaseExceptionGroup(
2024-07-31 09:01:25 | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
2024-07-31 09:01:25 +-+---------------- 1 ----------------
2024-07-31 09:01:25 | Traceback (most recent call last):
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
2024-07-31 09:01:25 | result = await app( # type: ignore[func-returns-value]
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
2024-07-31 09:01:25 | return await self.app(scope, receive, send)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
2024-07-31 09:01:25 | await super().call(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
2024-07-31 09:01:25 | await self.middleware_stack(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
2024-07-31 09:01:25 | await self.app(scope, receive, _send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 | with collapse_excgroups():
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 | self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 | response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/app/backend/main.py", line 915, in update_embedding_function
2024-07-31 09:01:25 | response = await call_next(request)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 | raise app_exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 | await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 | with collapse_excgroups():
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 | self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 | response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/app/backend/main.py", line 906, in check_url
2024-07-31 09:01:25 | response = await call_next(request)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 | raise app_exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 | await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 | with collapse_excgroups():
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 | self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 | response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/app/backend/main.py", line 892, in commit_session_after_request
2024-07-31 09:01:25 | response = await call_next(request)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 | raise app_exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 | await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in call
2024-07-31 09:01:25 | await self.simple_response(scope, receive, send, request_headers=headers)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
2024-07-31 09:01:25 | await self.app(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 | with collapse_excgroups():
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 | self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 | response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/app/backend/main.py", line 871, in dispatch
2024-07-31 09:01:25 | response = await call_next(request)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 | raise app_exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 | await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 | with collapse_excgroups():
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 | self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 | response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/app/backend/main.py", line 738, in dispatch
2024-07-31 09:01:25 | response = await call_next(request)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 | raise app_exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 | await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in call
2024-07-31 09:01:25 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-07-31 09:01:25 | await app(scope, receive, sender)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in call
2024-07-31 09:01:25 | await self.middleware_stack(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
2024-07-31 09:01:25 | await route.handle(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
2024-07-31 09:01:25 | await self.app(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
2024-07-31 09:01:25 | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-07-31 09:01:25 | raise exc
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-07-31 09:01:25 | await app(scope, receive, sender)
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-07-31 09:01:25 | response = await func(request)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-07-31 09:01:25 | raw_response = await run_endpoint_function(
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-07-31 09:01:25 | return await dependant.call(**values)
2024-07-31 09:01:25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 | File "/app/backend/main.py", line 1178, in chat_completed
2024-07-31 09:01:25 | "session_id": data["session_id"],
2024-07-31 09:01:25 | ~~~~^^^^^^^^^^^^^^
2024-07-31 09:01:25 | KeyError: 'session_id'
2024-07-31 09:01:25 +------------------------------------
2024-07-31 09:01:25
2024-07-31 09:01:25 During handling of the above exception, another exception occurred:
2024-07-31 09:01:25
2024-07-31 09:01:25 Traceback (most recent call last):
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi
2024-07-31 09:01:25 result = await app( # type: ignore[func-returns-value]
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
2024-07-31 09:01:25 return await self.app(scope, receive, send)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in call
2024-07-31 09:01:25 await super().call(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 123, in call
2024-07-31 09:01:25 await self.middleware_stack(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in call
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in call
2024-07-31 09:01:25 await self.app(scope, receive, _send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 with collapse_excgroups():
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/app/backend/main.py", line 915, in update_embedding_function
2024-07-31 09:01:25 response = await call_next(request)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 raise app_exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 with collapse_excgroups():
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/app/backend/main.py", line 906, in check_url
2024-07-31 09:01:25 response = await call_next(request)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 raise app_exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 with collapse_excgroups():
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/app/backend/main.py", line 892, in commit_session_after_request
2024-07-31 09:01:25 response = await call_next(request)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 raise app_exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in call
2024-07-31 09:01:25 await self.simple_response(scope, receive, send, request_headers=headers)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 148, in simple_response
2024-07-31 09:01:25 await self.app(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 with collapse_excgroups():
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/app/backend/main.py", line 871, in dispatch
2024-07-31 09:01:25 response = await call_next(request)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 raise app_exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 189, in call
2024-07-31 09:01:25 with collapse_excgroups():
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
2024-07-31 09:01:25 self.gen.throw(typ, value, traceback)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 191, in call
2024-07-31 09:01:25 response = await self.dispatch_func(request, call_next)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/app/backend/main.py", line 738, in dispatch
2024-07-31 09:01:25 response = await call_next(request)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 165, in call_next
2024-07-31 09:01:25 raise app_exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 151, in coro
2024-07-31 09:01:25 await self.app(scope, receive_or_disconnect, send_no_error)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 65, in call
2024-07-31 09:01:25 await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-07-31 09:01:25 await app(scope, receive, sender)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 756, in call
2024-07-31 09:01:25 await self.middleware_stack(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 776, in app
2024-07-31 09:01:25 await route.handle(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 297, in handle
2024-07-31 09:01:25 await self.app(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 77, in app
2024-07-31 09:01:25 await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-07-31 09:01:25 raise exc
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-07-31 09:01:25 await app(scope, receive, sender)
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-07-31 09:01:25 response = await func(request)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-07-31 09:01:25 raw_response = await run_endpoint_function(
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-07-31 09:01:25 return await dependant.call(**values)
2024-07-31 09:01:25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 09:01:25 File "/app/backend/main.py", line 1178, in chat_completed
2024-07-31 09:01:25 "session_id": data["session_id"],
2024-07-31 09:01:25 ~~~~^^^^^^^^^^^^^^
2024-07-31 09:01:25 KeyError: 'session_id'
Here are logs from when I try to send a follow up message.
2024-07-31 08:56:58 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
2024-07-31 08:56:58 raise exc
2024-07-31 08:56:58 File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
2024-07-31 08:56:58 await app(scope, receive, sender)
2024-07-31 08:56:58 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 72, in app
2024-07-31 08:56:58 response = await func(request)
2024-07-31 08:56:58 ^^^^^^^^^^^^^^^^^^^
2024-07-31 08:56:58 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 278, in app
2024-07-31 08:56:58 raw_response = await run_endpoint_function(
2024-07-31 08:56:58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 08:56:58 File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
2024-07-31 08:56:58 return await dependant.call(**values)
2024-07-31 08:56:58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-07-31 08:56:58 File "/app/backend/main.py", line 1178, in chat_completed
2024-07-31 08:56:58 "session_id": data["session_id"],
2024-07-31 08:56:58 ~~~~^^^^^^^^^^^^^^
2024-07-31 08:56:58 KeyError: 'session_id'
@JKratto commented on GitHub (Jul 31, 2024):
I can confirm, that I see the same behaviour/logs simply chatting with the model. This is also with a freshly (~2 hours) restarted container.
But seeing the error with the
session_idit seems to me the problem is indeed in the HTTP session. Currently I observe the issue only in one of the browsers, but not in the others. So maybe some session store is getting out of sync, expiring or something like that.Logs
@ther0bster commented on GitHub (Jul 31, 2024):
this issue with the
session_iderror seems related to issue #4025, issue #4229, and issue #4161pull request #4138 addresses this issue
To verify if this resolves your issue, test with the latest
devversion / docker image (containing commit90a6be8001)@ticpu commented on GitHub (Aug 1, 2024):
After applying the 2 commits of this PR to "main", the issue could be reproduced and conversation with the
[object Object]mention are still stuck.@ther0bster commented on GitHub (Aug 1, 2024):
@ticpu Thanks for testing the fix! Just to confirm, did you also compile the project after applying the commits?
If you did, could you please check if there are any errors in the browser console?
The
session_idcrash in the backend occurs becausesession_idis the id of the WebSocket received from the socket.io client running in the browser, and it seems like there's an issue with the WebSocket connection causing this error.The issue can be caused by some reverse proxy config not allowing WebSockets or by a wrong WebSocket URL that commit
90a6be8001fixed@JKratto commented on GitHub (Aug 1, 2024):
@ther0bster I use apache reverse proxy in front of my instance of open-webui. To be honest, I have seen those socket errors in the console for so long, and as long as everything was working properly, I did not care much. With your update, it's starting to come together. I have fixed the errors for WebSockets, and so far, it seems to be working like a charm (running still on the default 0.3.10 container image).
At this point, I feel, that there could be a mention in the docs where the proxy is being discussed. Here is my Apache vhost configuration:
Details
@mbentley commented on GitHub (Aug 1, 2024):
I also have a reverse proxy, nginx in my case. There is a pretty detailed example in the nginx docs for how to configure websocket proxying but if anyone is looking for a bit of a more complete config example, here's one since I didn't see anything in the docs about nginx yet:
Details
@Akira-baa commented on GitHub (Aug 1, 2024):
I have an apache reverse proxy too for https in front of open-webui.
I have the same issue
@chingwl commented on GitHub (Aug 1, 2024):
I've encountered a similar problem and may have found a solution that could help.
In my case, the issue only occurred when accessing Open WebUI remotely through a domain name, but not when accessing locally via IP. After checking the browser console logs, I noticed WebSocket connection errors.
I resolved this by modifying my Nginx configuration to properly support WebSocket connections. Here's the relevant part of my Nginx config that fixed the issue:
If you're using Nginx as a reverse proxy, you might want to try adding these WebSocket-related settings to see if it resolves the issue for you as well.
Hope this helps!
@ticpu commented on GitHub (Aug 1, 2024):
As with all the others, both my instances were behind reverse proxies, both Nginx.
Adding Websocket proxy seems to have fixed the issue as well:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@ticpu commented on GitHub (Aug 1, 2024):
At this point I feel it is more of an error message not clear issue, maybe this issue renamed to put a more appropriate error message in this situation?
@JKratto commented on GitHub (Aug 1, 2024):
@ticpu I feel that adding some bit about this to the documentation would be beneficial. Adding three lines to the Apache proxy snippet and two lines to the nginx one would probably make it so that 90 % of the people would never experience this issue.
@satlus commented on GitHub (Aug 1, 2024):
Thank you @chingwl , this was the fix for me and probably saved me an hour or two of debugging.
@BYTOOX commented on GitHub (Aug 2, 2024):
I've modified your config to make it Apache2 compatible, here it is :
I've not encountered the Object error bug since :D
Here is the module you need to activate :
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_wstunnel
sudo a2enmod headers
sudo a2enmod rewrite
sudo a2enmod setenvif
sudo a2enmod ssl
@fracergu commented on GitHub (Aug 2, 2024):
I am also behind a reverse-proxy (nginx-proxy-manager) and after enabling websockets support the problem seems to be solved. I've been running the same session on the same browser for more than 24h without any problem.
I agree with @JKratto that adding a few lines in the documentation about this specific case will save some headaches.
@schihei commented on GitHub (Aug 2, 2024):
I also can confirm that it seems the problem goes away by adding the following rules to my nginx reverse proxy configuration.
@jtsorlinis commented on GitHub (Aug 5, 2024):
I didn't need the
proxy_http_versionline but adding the following 2 also fixed it for me:@lewismacnow commented on GitHub (Aug 11, 2024):
Are there docs on how to handle websockets with a reverse proxy?
None of the configs suggested in this discussion have been successful for my configuration and without a way to disable use of Websocket traffic, OWU has been rendered completely unusable.
A way to disable websocket traffic would be highly desirable.
@oe3gwu commented on GitHub (Aug 11, 2024):
Same with 0.3.12 - it worked with 0.3.10 for me. But it only triggers when usint nginx as proxy before. When accessing open-webui direct, it works (for me)
Short update:
Using nginx-proxy-manager, this helped me:
Setting http version was mandatory.
@booyasatoshi commented on GitHub (Aug 13, 2024):
If you use Synology DSM and the built-in nginx reverse proxy, edit your entry, go to the Reverse Proxy Rules, then the Custom Headers tab and enable Web Sockets as you see below; this will solve this problem: