mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[GH-ISSUE #24579] issue: /api/chat/completions hangs indefinitely behind IIS/ARR proxy after upgrading from 0.9.2 to 0.9.3 #107341
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 @Polak149 on GitHub (May 11, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24579
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.9.5
Ollama Version (if applicable)
0.23.2
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When sending a message in the chat UI, the /api/chat/completions request should stream the response correctly and finish normally.
The generated assistant response should appear in the UI without requiring a browser refresh.
This behavior worked correctly in Open WebUI 0.9.2 with the same IIS/ARR reverse proxy configuration.
Actual Behavior
After upgrading Open WebUI from 0.9.2 to 0.9.3, chat generation no longer works correctly when Open WebUI is accessed through IIS with Application Request Routing reverse proxy.
The message is sent correctly and the LLM generates a response. However, the browser request to:
/api/chat/completionsremains in pending state indefinitely.
The assistant response is not streamed or rendered live in the UI.
After refreshing the browser page, the generated response becomes visible in the conversation history. This indicates that the backend/model generation completed successfully and the response was persisted, but the streaming response did not complete properly through IIS/ARR.
IIS sometimes returns:
502 - Web server received an invalid response while acting as a gateway or proxy server.The issue does not occur when accessing Open WebUI directly on the internal address/port. It only occurs through IIS/ARR.
Steps to Reproduce
http://10.10.0.17:9000Comparison test:
Direct access test:
http://10.10.0.17:9000Result:
Works correctlyThrough IIS/ARR reverse proxy:
https://public-domainResult:
Logs & Screenshots
Open WebUI container logs do not show any obvious error.
Browser DevTools Network tab shows:
The request to /api/chat/completions remains pending indefinitely.
IIS sometimes returns:
502 - Web server received an invalid response while acting as a gateway or proxy server.Current IIS web.config:
ARR proxy settings tested:
I also tested an explicit configuration with forwarded headers and disabled buffering/compression:
This did not resolve the issue.
Additional Information
Environment:
Important observation:
The backend appears to complete generation correctly, because the generated response is visible after refreshing the page. The issue seems related to the streaming response lifecycle of /api/chat/completions when passing through IIS/ARR.
Possible regression areas:
Question:
Was anything changed in Open WebUI 0.9.3 regarding /api/chat/completions streaming, response headers, chunked transfer encoding, or connection finalization that could cause incompatibility with IIS/ARR reverse proxy?
The regression is reproducible because the exact same IIS/ARR setup works correctly with 0.9.2.
Update 0.9.4 and 0.9.5 did not fix the issue
@owui-terminator[bot] commented on GitHub (May 11, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟢 #24553 issue: /api/chat/completions runs into error
This is the closest current open report on
/api/chat/completionsmisbehaving in 0.9.5. While the exact symptom differs, it involves the same endpoint and version range, making it a likely related regression.by tweinberger-lei ·
bug🟣 #23920 fix: Stale Content-Encoding header forwarded from upstream APIs causes ZlibError in desktop clients
This closed issue documents a streaming/proxy header regression in the OpenAI-compatible API path, where stale response headers broke SSE clients. Your issue also appears to be a streaming/proxy compatibility problem after an upgrade, so it is relevant as a possible neighboring regression area.
by pvyswiss
🟣 #22141 issue: Tokens dropped with streaming enabled
This issue is about streaming token delivery problems in Open WebUI's chat completions path. Although it is about dropped tokens rather than an indefinite hang, it points to the same streaming pipeline and buffering logic that could be implicated in your regression.
by anselor ·
bug💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@Classic298 commented on GitHub (May 11, 2026):
I don't think anything in regards to websockets or how the response is handled has changed since 0.9.0... but i'll take a look
@Classic298 commented on GitHub (May 11, 2026):
I went through every change to
/api/chat/completionsand its surrounding code paths between v0.9.2 and v0.9.5 and can't find a single regression that would change how this endpoint behaves through a reverse proxy.A few things worth knowing about the endpoint in the UI flow:
session_id+chat_idare present (i.e. you have a working socket), it kicks off a background task and returns a small JSON:{ "status": true, "task_ids": [...], "chat_id": "..." }. The actual tokens stream via Socket.IO, not the HTTP body. That code path is identical in 0.9.2 and 0.9.5.session_idis missing (i.e. the WebSocket never connected), the backend falls back to a real SSEStreamingResponseover/api/chat/completions. ARR is known to buffer/mangle chunked SSE responses. This fallback existed identically in 0.9.2 too._clean_proxy_headers(stripsContent-Encoding/Content-Length/Transfer-Encodingfrom upstream),CompressMiddleware, the AuthToken/CommitSession middlewares, and the Socket.IO setup are all unchanged between 0.9.2 and 0.9.5. No dependency bumps either.My best guess is that this is a WebSocket-establishment issue through your ARR config (not a backend code change). If the WS handshake fails, the frontend posts the chat completion with
session_id: undefinedand the endpoint goes down the SSE-streaming legacy branch, which ARR will gladly buffer to death.To confirm, can you check:
/api/chat/completionsor/ws/socket.io/?transport=…?/ws/socket.io/?...&transport=websocketactually return101 Switching Protocols?Content-Typeheader on the pending/api/chat/completionsrequest?application/jsonvstext/event-streamwould tell us which branch you're on.ENABLE_WEBSOCKET=falseto force long-polling — if the hang goes away, it's the WS handshake; if it stays, it's response delivery.@Polak149 commented on GitHub (May 11, 2026):
Thank you for the detailed analysis. Your explanation makes sense and helped me identify the real cause.
It looks like this was not a regression between 0.9.2 and 0.9.3 after all.
Some time ago I added the following Docker environment variable:
ENABLE_WEBSOCKET=true
At that time I only rebooted the server / restarted the environment and assumed that the setting had been applied, because everything still seemed to work.
However, I now realized that the existing Docker container was not recreated, so the new environment variable was not actually applied after the reboot. It only took effect later when I rebuilt/recreated the Docker Compose stack during the Open WebUI update. That made it look like the issue was caused by the Open WebUI version upgrade, but in reality the upgrade was simply the first moment when ENABLE_WEBSOCKET=true became active.
After your explanation, this matches the behavior perfectly:
So the most likely root cause is my IIS/ARR WebSocket proxy configuration, not Open WebUI itself.
I tested disabling WebSocket support again by setting:
ENABLE_WEBSOCKET=false
and recreating the Docker containers properly. After that, the chat works again through IIS/ARR.
So I think this issue can be closed as a configuration/proxy issue on my side rather than a bug in Open WebUI.
For reference, the important lesson here is that changing ENABLE_WEBSOCKET in Docker requires recreating the container, not just rebooting/restarting the host. In my case, the delayed application of that environment variable made the problem appear to be related to the Open WebUI update.
Thank you again for pointing me in the right direction.