initializing process {"pid": 18296, "inference": t...
# ask-ai
l
initializing process {"pid": 18296, "inference": true} Heartbeat: Agent still alive... 2025-08-19 171758,159 - INFO livekit.agents - killing process {"pid": 18296, "inference": true} 2025-08-19 171758,160 - ERROR livekit.agents - worker failed Traceback (most recent call last): File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\tasks.py", line 507, in wait_for return await fut ^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message return _read_message(await dplx.recv_bytes(), messages) ^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes len_bytes = await self._reader.readexactly(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\streams.py", line 769, in readexactly await self._wait_for_data('readexactly') File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\streams.py", line 539, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\cli\_run.py", line 79, in _worker_run await worker.run() File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\worker.py", line 403, in run await self._inference_executor.initialize() File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\ipc\supervised_proc.py", line 169, in initialize init_res = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ ...<2 lines>... ) ^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\tasks.py", line 506, in wait_for async with timeouts.timeout(timeout): ~~~~~~~~~~~~~~~~^^^^^^^^^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\timeouts.py", line 116, in aexit raise TimeoutError from exc_val TimeoutError 2025-08-19 171758,171 - ERROR livekit.agents - Error in _read_ipc_task Traceback (most recent call last): File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes len_bytes = await self._reader.readexactly(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\streams.py", line 767, in readexactly raise exceptions.IncompleteReadError(incomplete, n) asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 4 expected bytes The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\cli\watcher.py", line 120, in _read_ipc_task msg = await channel.arecv_message(self._pch, proto.IPC_MESSAGES) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message return _read_message(await dplx.recv_bytes(), messages) ^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 43, in recv_bytes raise DuplexClosed() from e livekit.agents.utils.aio.duplex_unix.DuplexClosed 2025-08-19 171758,189 - DEBUG asyncio - Using proactor: IocpProactor c\Codeshastra Projects\hamari ai monorepo\.venv\Lib\site packages\litellm\llms\custom httpx\async client cleanup.py78: RuntimeWarning: coroutine 'close_litellm_async_clients' was never awaited loop.close() RuntimeWarning: Enable tracemalloc to get the object allocation traceback
t
Thanks for reaching out, Pavan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
l
can you please solve my issue
initializing process {"pid": 18296, "inference": true} Heartbeat: Agent still alive... 2025-08-19 171758,159 - INFO livekit.agents - killing process {"pid": 18296, "inference": true} 2025-08-19 171758,160 - ERROR livekit.agents - worker failed Traceback (most recent call last): File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\tasks.py", line 507, in wait_for return await fut ^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message return _read_message(await dplx.recv_bytes(), messages) ^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes len_bytes = await self._reader.readexactly(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\streams.py", line 769, in readexactly await self._wait_for_data('readexactly') File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\streams.py", line 539, in _wait_for_data await self._waiter asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\cli\_run.py", line 79, in _worker_run await worker.run() File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\worker.py", line 403, in run await self._inference_executor.initialize() File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\ipc\supervised_proc.py", line 169, in initialize init_res = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ ...<2 lines>... ) ^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\tasks.py", line 506, in wait_for async with timeouts.timeout(timeout): ~~~~~~~~~~~~~~~~^^^^^^^^^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\timeouts.py", line 116, in aexit raise TimeoutError from exc_val TimeoutError 2025-08-19 171758,171 - ERROR livekit.agents - Error in _read_ipc_task Traceback (most recent call last): File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 35, in recv_bytes len_bytes = await self._reader.readexactly(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Abcom\AppData\Local\Programs\Python\Python313\Lib\asyncio\streams.py", line 767, in readexactly raise exceptions.IncompleteReadError(incomplete, n) asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 4 expected bytes The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\log.py", line 16, in async_fn_logs return await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\cli\watcher.py", line 120, in _read_ipc_task msg = await channel.arecv_message(self._pch, proto.IPC_MESSAGES) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\ipc\channel.py", line 47, in arecv_message return _read_message(await dplx.recv_bytes(), messages) ^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Codeshastra_Projects\hamari-ai-monorepo\.venv\Lib\site-packages\livekit\agents\utils\aio\duplex_unix.py", line 43, in recv_bytes raise DuplexClosed() from e livekit.agents.utils.aio.duplex_unix.DuplexClosed 2025-08-19 171758,189 - DEBUG asyncio - Using proactor: IocpProactor c\Codeshastra Projects\hamari ai monorepo\.venv\Lib\site packages\litellm\llms\custom httpx\async client cleanup.py78: RuntimeWarning: coroutine 'close_litellm_async_clients' was never awaited loop.close() RuntimeWarning: Enable tracemalloc to get the object allocation traceback
t
It looks like your LiveKit agent worker ran into a
TimeoutError
and
CancelledError
, which usually pop up because of task coordination hiccups, network issues, or resource management challenges. Here are a few friendly tips to help you troubleshoot: • Check Network Connectivity: Make sure there’s a steady connection between your worker and the LiveKit server. • Monitor Server Load: Take a peek to see if the server isn’t overwhelmed and can smoothly handle job dispatching. • Adjust Timeout Settings: Try increasing timeout values for operations that might need a bit more time. • Handle Task Cancellation: Double-check that your cleanup code and worker shutdown properly manage
CancelledError
. • Enable Detailed Logging: Add some logging around those timeout-prone spots to help pinpoint what’s going on. If you want a hand with specific settings or debugging, just give me a shout—I’m here to help! Sources: agents/src/worker.ts | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/stt.py | livekit-rtc/livekit/rtc/participant.py | stream_audio.py | server/chatgpt.py
Could you help me understand if this issue pops up during a specific action, like assigning a job, starting a process, or streaming tasks? Also, have there been any recent changes to your LiveKit setup or environment that might have caused this error?