mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-11 18:43:44 -05:00
[GH-ISSUE #1611] enhancement: better error handling #115879
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 @almostserious on GitHub (Apr 19, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1611
Is your feature request related to a problem? Please describe.

I'm using this tool on CPU only, and with certain prompts I get some kind of timeout.
This usually happens when I upload a document to get a summary. I assume the context might be too long.
But I do not get any feedback in the UI.
Even when the CPU finished processing, the UI is stuck on this: (Image uploaded)
UI is kind of stuck. Opening and closing the thread just shows the initial prompt and no answer at all.
Describe the solution you'd like
I would love to get some kind of error message if the prompt cannot be resolved. Ideally with the steps needed to make it work.
@henry4711lp commented on GitHub (Apr 25, 2024):
Same problem here. An option to set a longer timeout or a bigger context window would be nice as well. I don't care if my small cpu needs 1h for a request if I know that it is still working on it
@earlyXbirdNG commented on GitHub (Apr 25, 2024):
Same problem here
But I have this even with no attachment uploaded. Only a little prompt and sometimes it's hanging. After page refresh and a new chat it's working
@tomazed commented on GitHub (May 12, 2024):
Same for me. Working on CPU only, some inference takes 2 to 10min to complete on ollama side. ollama does its work but it's never fowareded to open-webui
@tomazed commented on GitHub (May 13, 2024):
I've done further investigation and the problem I had was with Cloudflare timeout that triggers at 100s. I've bypass cloudflare for serving open-webui and everything works fine (just tested with inference of 6 and a half minute.)
but maybe, having a better sequence with polling or even websocket to accomodate such long response would be an improvement.
@MatthK commented on GitHub (May 15, 2024):
I'm having the same problem. Open-WebUI and Ollama both run in a docker container on a CPU only system.
I haven't figured out yet a systematic rule to the issue, but more than half of my questions end up with that 504 error that is not passed on to the front-end. I assume that the model is too slow and in docker stats the Ollama container is still very busy, while I never get any feedback on the front-end.
I'm also not very concerned about the duration, but it would be helpful to know that I can give up waiting for a reply.
@ahmedsaed commented on GitHub (May 24, 2024):
If you are using a proxy make sure that it doesn't timeout or cache the responses. If you are using Nginx then add these lines to your config
This configuration increases the timeout to 3000 seconds (50 minutes).
This configuration disables caching and buffering.
More details are outlined here: https://github.com/open-webui/open-webui/discussions/2380#discussioncomment-9551560
@MatthK commented on GitHub (May 25, 2024):
Thank you very much
@Arakade commented on GitHub (Nov 20, 2024):
Seeing similar issue with using ComfyUI when generating an image with a long prompt taking a long time (5 minutes).
Shorter prompts that complete in shorter time seem to work fine. Beyond a TBD time, I see a toast message in the UI "Server connection failed".
Checking the ComfyUI I can see it's still working and completes later.
The Open-WebUI log doesn't show anything amazingly useful:
Then it loops the usual while waiting:
After a while we see the error in GUI : "Server connection failed"
Then a while later after a few more GET/POST status checks same as above (all 200):
I suspect these are the image being ready but the requester is no longer listening.
Checking ComfyUI, it generated fine -- just took too long! (5 minutes)
p.s. I'm using latest Open-WebUI 0.4.1 with latest ComfyUI. Both are running in Docker containers as is Ollama. OWUI contacts CUI via
http://localhost:8002(no Nginx AFAIK) although I am using Nginx for SSL proxy for OWUI. Probably not relevant but GPU is an AMD and it's correctly configured for acceleration through Docker.@thedxt commented on GitHub (Nov 28, 2024):
I am seeing a similar issue. I can replicate the problem by loading up my VRAM then when ComfyUI loads the model it does a partial load then if the image generation takes just over 90 seconds it will come back with the server connection failed error.
What's interesting is there is no issue when I use Open WebUI directly. It only happens when there's NGINX in front of it.
I've set my NGIX setting to the following
Open WebUI is in Docker on version v0.4.6
I am using Nginx Proxy Manager v2.12.1 also in Docker.
Ollama and ComfyUI run directly on the VM with no docker.
I think the issue is something to do with NGINX and cache or something.
@thedxt commented on GitHub (Nov 28, 2024):
I figured it out.
Loading up the VRAM had nothing to do with any of this. It just happened to line up with the timeout on my setup.
It seems that if you see lots of socket.io in your network log in DevTools things might not be working correctly.
Example: https://EXTERNAL-OPEN-WEBUI-URL/ws/socket.io/?EIO=4&transport=polling&t=RANDOM
If you dig into the socket.io documentation you find that they mention some extra settings for NGINX specifically they say to use the following
Once you set that it seems to almost completely eliminate the socket.io connections in the network log.
That didn't fully fix my issue as I was still seeing the timeout at about 90 seconds.
I also noticed that when the error message showed up in Open WebUI the URL for
/images/api/v1/generationsin the network log would flip to a status code of 504 Gateway Timeout.I tried setting what @Ahmedsaed and other have said about setting the send, read, and connect timeouts to 3000 seconds to force Open WebUI to wait longer.
I adding the following
After adding that the image generation started working for me. I suspect that if the image generation takes longer to 3000 second it will fail again.
I was curious which setting was actually needed so I set them to 3 seconds to make it fail fast to find the exact setting.
The end result is that the
proxy_read_timeoutsetting is the key.the final settings that are working for me are
@Arakade commented on GitHub (Nov 28, 2024):
@thedxt, @Ahmedsaed: you're talking about nginx as a proxy. Can I ask where you're using it:
I believe I have (1) but I think you have (2) or (3) which is why adding settings to nginx to affect timeouts affects interactions between OWUI and Comfy. (Right?)
I say ”believe” because while I haven't set-up nginx between them myself, it occurs you might be talking about it because it's already there and I just haven't realised. Is that the case? (A simple ”yes, look in path, dummy” would be awesome so I can 🤦)
If not, either nginx between OWUI and Comfy is not the only cause or maybe there's a way to apply similar timeout settings to OWUI directly?
Thanks (and please feel free to correct any misunderstandings I have ☺️)
@thedxt commented on GitHub (Nov 28, 2024):
@Arakade I'm doing User --nginx--> OWUI --> Comfy
Users access OWUI via Nginx. I am using Nginx Proxy Manager. No extra tweaks are made to Comfy.
It's possible the Comfy also runs Nginx but I've made 0 changes to Comfy after installing it.
The issue for me only seems to happen once I put Nginx in front of OWUI.
If you watch the network log on OWUI when you access it directly without Nginx you'll see very few of the socket.io connections but the moment you put Nginx in front of OWUI and watch the network log for Nginx you see lots of the socket.io connections. Which made me focus on Nginx instead of OWUI.
Once you tweak the Nginx settings to have what Socket.io says to use then there are very few socket.io calls just like when you access OWUI directly. But the error still happened until I added the
proxy_read_timeoutsetting to Nginx.I think the root cause is that it's an Nginx issue as everything works perfectly when I removed Nginx from the equation. However the error message in OWUI wasn't clear and made me think that the issue was a setting on the OWUI side.
@Arakade commented on GitHub (Nov 28, 2024):
@thedxt oh! Wow, thanks. I'll update mine with your changes later and see if that helps! Thanks again!
@bughunter2 commented on GitHub (Apr 8, 2025):
👉 Suggestion: make Open WebUI show a clear error when WebSockets are failing.
Just stumbled upon issues similar to those reported here. Needed to add this to my Nginx reverse proxy config in order for WebSockets to work properly:
If I prompted a model (asked a question), Open WebUI would show an error related to the JSON response (from Ollama) being invalid (it appeared that it couldn't read the response, hence a parsing error occurred). The precise error was:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data.With the above snippet added inside a
locationblock in the Nginx reverse proxy config, Open WebUI appeared to work fine. 🙂@viba1 commented on GitHub (Apr 29, 2025):
Same issue here: CPU only configuration, ollama 0.6.6 and webui 0.6.5.
Use-case to reproduce : webui request with web search.
Sometimes (rarely) the result appears with "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
More frequently, no results are displayed immediately after the web search ends.
I don’t see any difference between the changes made to the reverse proxy configuration, as previously proposed.
I see the display problem with gemma3:1b or gemma3:4b yet fast to run, while I have the display + json error with phi4:14b which is much longer to run, so I doubt the relevance of the timeout track.
The operation is correct and without error message with llama3.2 or qwen3
I think it's more of a webui problem, due to random behavior depending on the choice of model but reproducible for the same model.
@lemassykoi commented on GitHub (May 9, 2025):
I have this problem with qwen3 (with web search enabled and disabled):
Yesterday, all was working fine without errors. I was in 0.6.6 (not 100% sure about that)
Now with 0.6.7 qwen3 is KO
edit: an other thinking model not working:
@ivanbaldo commented on GitHub (May 9, 2025):
I had that error also with non-thinking models, sometimes websockets have issues.
Try to clean the Redis data or disable websockets with
ENABLE_WEBSOCKET_SUPPORT: Falseand see if you can still reproduce the error, to confirm it's actually something with the model and not with websockets.Thanks!!!
@lemassykoi commented on GitHub (May 9, 2025):
Thanks. As indeed I was not able to chat with any model, I closed my browser tab and went to something else.
When I get notified about your answer, I logged in on my open-webui to search about redis data.
One first thing I noticed is that the "active users: 1" is now displayed, whereas it was not when I wrote my post, despite multiple page refresh (too lazy to logout/login).
Then I tried again my failed queries from post time, and now it's ok.
Is it related to websockets?