[GH-ISSUE #7229] API CHAT COMPLETIONS - ERROR [asyncio] Unclosed client session #14667

Closed
opened 2026-04-19 20:58:30 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @CodeGorger on GitHub (Nov 22, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7229

Bug Report

Installation Method

Via the provided docker.

Environment

  • Open WebUI Version:
    0.3.35 and newer
  • Ollama (if applicable):
    0.3.8

Expected Behavior:

No error, filter outlet gets called properly.

Actual Behavior:

[Describe what actually happened.]

Description

Bug Summary:
Error upon usage of endpoint /api/chat/completions

Reproduction Details

Steps to Reproduce:
Use the endpoint /api/chat/completions of openwebui.

Logs and Screenshots

Docker Container Logs:
INFO: 213.146.3.1:36791 - "POST /api/chat/completions HTTP/1.1" 200 OK
ERROR [asyncio] Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f75840e4a90>
ERROR [asyncio] Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f757effd6a0>, 26900.859)]']
connector: <aiohttp.connector.TCPConnector object at 0x7f7586e44a90>

Additional Information

Using the endpoint /api/chat/completions always causes an error. What does work, is the inlet function of our filter. Then the response from the llm gets streamed properly. At the end of the streaming, the error triggers and the outlet never gets called anymore.
This problem does not happen, when using the openwebui frontend.
Assumption: The error happens, when the connection (after the streaming) doesn't properly shut down in "backend/open_webui/main.py".

Originally created by @CodeGorger on GitHub (Nov 22, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/7229 # Bug Report ## Installation Method Via the provided docker. ## Environment - **Open WebUI Version:** 0.3.35 and newer - **Ollama (if applicable):** 0.3.8 ## Expected Behavior: No error, filter outlet gets called properly. ## Actual Behavior: [Describe what actually happened.] ## Description **Bug Summary:** Error upon usage of endpoint /api/chat/completions ## Reproduction Details **Steps to Reproduce:** Use the endpoint /api/chat/completions of openwebui. ## Logs and Screenshots **Docker Container Logs:** INFO: 213.146.3.1:36791 - "POST /api/chat/completions HTTP/1.1" 200 OK ERROR [asyncio] Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f75840e4a90> ERROR [asyncio] Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f757effd6a0>, 26900.859)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f7586e44a90> ## Additional Information Using the endpoint /api/chat/completions always causes an error. What does work, is the inlet function of our filter. Then the response from the llm gets streamed properly. At the end of the streaming, the error triggers and the outlet never gets called anymore. This problem does not happen, when using the openwebui frontend. Assumption: The error happens, when the connection (after the streaming) doesn't properly shut down in "backend/open_webui/main.py".
Author
Owner

@ay4t commented on GitHub (Nov 22, 2024):

i have same issue when i using advanced RAG pipeline
2024-11-22-23-20-01

but if i disable the outlet function it works very well but my pipeline functionality is not working
image

<!-- gh-comment-id:2494232912 --> @ay4t commented on GitHub (Nov 22, 2024): i have same issue when i using advanced RAG pipeline ![2024-11-22-23-20-01](https://github.com/user-attachments/assets/09f45309-ecc3-4cdd-8f16-059b0c937d81) but if i disable the outlet function it works very well but my pipeline functionality is not working ![image](https://github.com/user-attachments/assets/11745469-1278-4dc0-9375-a2a553a14b3b)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#14667