[Bug]: websocket app demo connection cleanup
File Name
gemini/multimodal-live-api/websocket-demo-app/backend/main.py
What happened?
closing connections and cleanup
Relevant log output
websockets.exceptions.ConnectionClosedError: received 1011 (internal error) Request trace id: f102afa6f090070d, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: f102afa6f090070d, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Your WebSocket server ran out of resources due to too many connections or insufficient system capacity. The error RESOURCE_EXHAUSTED means the maximum allowed concurrent connections were reached, causing the server to close connections with an internal error.
Fix it by:
Increasing server resource limits. Closing idle or unused WebSocket connections. Adding load balancing for high traffic. Debugging connection cleanup in your backend code.
Thank you for the reply and the detailed explanation and proposed solutions. I will look into them.
@philhosophy , did you figure out a way to cleanup connection?
+1, the multimodal live api notebook needs connection cleanups to be added- I've hit resources exhausted multiple times.
Thanks for the insights!
I also encountered this issue in both the notebook and local demo—refreshing the page multiple times leads to a 1011 (RESOURCE_EXHAUSTED) error, and I have to wait for the API to release resources. I'm still investigating how to properly clean up WebSocket connections. If anyone has suggestions, I'd appreciate the help!
Anyone suddenly seeing errors like this after it was previously working?
websockets.exceptions.ConnectionClosedError: received 1008 (policy violation) Request trace id: a7eb3fd9f46907a2, Authentication error: 16; Error Details: gbs_data::INVALID_TOKEN: Crypto credential exp; then sent 1008 (policy violation) Request trace id: a7eb3fd9f46907a2, Authentication error: 16; Error Details: gbs_data::INVALID_TOKEN: Crypto credential exp