mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
issue: 504 Gateway Timeout Errors with Long-Running LLM Requests #6154
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 @dieu-bis on GitHub (Aug 21, 2025).
Check Existing Issues
Installation Method
Other
Open WebUI Version
v0.6.22
Ollama Version (if applicable)
N/A (using LiteLLM proxy)
Operating System
Kubernetes on GKE (Google Kubernetes Engine) - Ubuntu nodes
Browser (if applicable)
Chrome 139.0.7258.128
Confirmation
README.md.Expected Behavior
When sending a chat request to any LLM model through OpenWebUI, the interface should wait for the complete response without timing out, showing appropriate loading indicators while the request is being processed.
Actual Behavior
Users receive a "504 Gateway Timeout" error in the browser console after approximately 60 seconds when using certain LLM models. However, the request continues processing on the backend, and the chat response eventually appears in the UI after a few additional seconds. This creates a confusing user experience where an error is shown but the operation actually succeeds.
Steps to Reproduce
- OpenWebUI v0.6.22 deployed on Kubernetes (GKE)
- LiteLLM proxy configured as backend at http://litellm.corporate-ai.svc.cluster.local:4000
- Kong ingress controller with extended timeouts (36000000ms configured)
- Redis Sentinel cluster for caching
- Open Chrome/Firefox/Safari browser
- Navigate to https://[your-openwebui-domain]/
- Log in with valid credentials
- Select any model from the model dropdown
- Type a complex query that requires extended processing time (e.g., "Analyze the following 10-page document and provide detailed insights...")
- Click send or press Enter
- Wait approximately 60 seconds
- Observe browser console showing: Failed to load resource: the server responded with a status of 504 ()
- Wait an additional 3-5 seconds
- Observe that the chat response appears successfully despite the error
Kong Ingress configuration
proxy:
connect_timeout: 60000
read_timeout: 36000000
write_timeout: 36000000
OpenWebUI deployment
image: ghcr.io/open-webui/open-webui:0.6.22
Logs & Screenshots
Browser Console Error:
Failed to load resource: the server responded with a status of 504 ()
GET https://[domain]/api/chat/[id] 504 (Gateway Timeout)
LiteLLM Backend Logs (showing successful completion):
INFO: 10.10.22.10:44874 - "POST /chat/completions HTTP/1.1" 200 OK
INFO: 10.10.22.10:51992 - "POST /chat/completions HTTP/1.1" 200 OK
OpenWebUI Logs:
2025-08-21 09:52:01.504 | INFO | httpx._client:_send_single_request:1025 - HTTP Request: POST http://litellm:4000/chat/completions "HTTP/1.1 200 OK"
Additional Information
Analysis:
Current Workaround:
Users can ignore the 504 error and wait a few seconds for the response to appear, or refresh the page to see the completed response.
Suggested Fix:
Consider implementing:
Environment Variables Currently Set:
This issue affects user experience significantly as it shows errors for successful operations, causing confusion and potentially leading users to retry requests unnecessarily.
@tjbck commented on GitHub (Aug 21, 2025):
Reverse proxy config issue, with that being said this should be addressed in dev.