cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

I am getting "RPC::DEADLINE_EXCEEDED" if I run it a little while.

Open dcmutlu opened this issue 11 months ago • 2 comments

Description of the bug:

I am running Gemini-2 live_api_starter.py without websockets example and everytime I do, no matter it is AUDIO or TEXT generation mode, after 2-3 minutes of running good, I am getting:

|   File "/Users/deniz/anaconda3/envs/genai/lib/python3.10/site-packages/google/genai/live.py", line 109, in receive
|     while result := await self._receive():
|   File "/Users/deniz/anaconda3/envs/genai/lib/python3.10/site-packages/google/genai/live.py", line 177, in _receive
|     raw_response = await self._ws.recv(decode=False)
|   File "/Users/deniz/anaconda3/envs/genai/lib/python3.10/site-packages/websockets/asyncio/connection.py", line 313, in recv
|     raise self.protocol.close_exc from self.recv_exc
| websockets.exceptions.ConnectionClosedError: received 1011 (internal error) Request trace id: 434a1f2042ea7643, [ORIGINAL ERROR] RPC::DEADLINE_EXCEEDED: ; then sent 1011 (internal error) Request trace id: 434a1f2042ea7643, [ORIGINAL ERROR] RPC::DEADLINE_EXCEEDED: 

Is there a token or time limit for live api for now? Am I getting this because of that, or something else wrong? My connection is good, I do not think it is a network issue.

Actual vs expected behavior:

I want to run it as long as I wanted to, but I could not.

Any other information you'd like to share?

No response

dcmutlu avatar Dec 27 '24 18:12 dcmutlu

patrron avatar Dec 28 '24 06:12 patrron

I had the similar issue.

websockets.exceptions.ConnectionClosedError: received 1011 (internal error) Request trace id: 26b0b24991ec9180, [ORIGINAL ERROR] generic::unavailable: Could not read from recitation stream server. Fa; then sent 1011 (internal error) Request trace id: 26b0b24991ec9180, [ORIGINAL ERROR] generic::unavailable: Could not read from recitation stream server. Fa

secutron avatar Jan 04 '25 03:01 secutron

I have the same issue:

  • Exception Group Traceback (most recent call last): | File "/home/justus/Nextcloud/gemini-live/live/live.py", line 234, in run | async with ( | File "/usr/lib/python3.11/asyncio/taskgroups.py", line 133, in aexit | raise me from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/home/justus/Nextcloud/gemini-live/live/live.py", line 206, in receive_audio | async for response in turn: | File "/home/justus/Nextcloud/gemini-live/lib/python3.11/site-packages/google/genai/live.py", line 129, in receive | while result := await self._receive(): | ^^^^^^^^^^^^^^^^^^^^^ | File "/home/justus/Nextcloud/gemini-live/lib/python3.11/site-packages/google/genai/live.py", line 197, in _receive | raw_response = await self._ws.recv(decode=False) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/home/justus/Nextcloud/gemini-live/lib/python3.11/site-packages/websockets/asyncio/connection.py", line 313, in recv | raise self.protocol.close_exc from self.recv_exc | websockets.exceptions.ConnectionClosedError: received 1011 (internal error) Request trace id: ef7e3c50be2877ec, [ORIGINAL ERROR] RPC::DEADLINE_EXCEEDED: Error raised from operator lm_root_bidi_stream; then sent 1011 (internal error) Request trace id: ef7e3c50be2877ec, [ORIGINAL ERROR] RPC::DEADLINE_EXCEEDED: Error raised from operator lm_root_bidi_stream

derspotter avatar Jan 25 '25 17:01 derspotter

I'm not sure what the root cause is for this - the errors aren't particularly helpful.

Feel free to add more stack traces so I can try and pull a better error from the trace id.

Oh and please indicate if the error you are seeing is happening 100% of the time or if it's intermittent.

markmcd avatar Jan 28 '25 07:01 markmcd

I'm not sure what the root cause is for this - the errors aren't particularly helpful.

Feel free to add more stack traces so I can try and pull a better error from the trace id.

Oh and please indicate if the error you are seeing is happening 100% of the time or if it's intermittent.

I am starting to think this is a community sarcasm. After initial trying, I convinced the issue is sourced from an API limitation to avoid context window overflow. I leave this open for others waiting help, but feel free to close it.

dcmutlu avatar Feb 06 '25 17:02 dcmutlu

Sorry if something I said seemed sarcastic - it wasn't intentional, I love our dev community. The unhelpful errors I was talking about are the ones from the API, not the community feedback.

If I can see trace IDs with the error then I can dig into the stack trace and see what actually went wrong, then we can fix it. I'll close this as you suggested, since there's been no updates. BUT if someone finds another instance, please still comment here and we can reopen.

markmcd avatar Feb 07 '25 03:02 markmcd

I'm sorry, I didn't express myself well. I'm getting a bit tangled up with all these API updates. Your work is much appreciated, though!

dcmutlu avatar Feb 07 '25 22:02 dcmutlu