Hey Community
While using the gemini multi modal api with model Gemini 2.0 -Flash - exp. We are facing the below issue while using it via websockets, it sometimes work fine and sometimes it starts giving the below error, Can anyone guide us in implementing a solution for the below error or any one has faced the same issue.
here are the things we have done.
1. We have diagnosed it as a concurrency issue and also made sure that ws.close() is implemented after we close the page.
2. We don't have any websockets open on the client side because we have a single machine as of now connecting to the websockets
3. Does any body know how much time it takes to close them automatically?
2025-03-05T15:51:18.731934634Z: [INFO] 2025-03-05 15:51:18,713 [ERROR] Error in server message handling: received 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se 2025-03-05T15:51:18.740701603Z: [INFO] 2025-03-05 15:51:18,714 [ERROR] WebSocket communication error: received 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se 2025-03-05T15:51:18.741891022Z: [INFO] 2025-03-05 15:51:18,739 [ERROR] WebSocket error: received 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se; then sent 1011 (internal error) Request trace id: 12770ad2c02bc69e, [ORIGINAL ERROR] generic::resource_exhausted: RESOURCE_EXHAUSTED: Maximum concurrent se 2025-03-05T15:52:07.499886225Z: [ERROR] INFO: connection closed
.
Hi @legacy-dev,
Welcome to Google Cloud Community!
The "Maximum concurrent sessions" error with the Gemini 2.0 Flash WebSocket API indicates you're exceeding the allowed simultaneous connections.
Here's a breakdown of potential solutions that you can consider to address your issue:
You can also refer to the following documents for information:
In addition, take into consideration that the "exp" in the model name indicates that it's experimental. This means that the API might be less stable, have undocumented limitations, or be subject to change. Keep this in mind as you develop your solution.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.