``` Traceback (most recent call last): File "/ho...
# cloud
c
Copy code
Traceback (most recent call last):
  File "/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/worker.py", line 941, in _connection_task
    ws = await self._http_session.ws_connect(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/client.py", line 1076, in _ws_connect
    resp = await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/client.py", line 779, in _request
    resp = await handler(req)
           ^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/client.py", line 734, in _connect_and_send_request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 642, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1209, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1581, in _create_direct_connection
    raise last_exc
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1550, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py", line 1291, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:7880 ssl:default [Connect call failed ('127.0.0.1', 7880)]
{"level": "WARNING", "name": "livekit.agents", "message": "failed to connect to livekit, retrying in 10s", "exc_info": "Traceback (most recent call last):\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py\", line 1268, in _wrap_create_connection\n    sock = await aiohappyeyeballs.start_connection(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohappyeyeballs/impl.py\", line 122, in start_connection\n    raise first_exception\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohappyeyeballs/impl.py\", line 73, in start_connection\n    sock = await _connect_sock(\n           ^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohappyeyeballs/impl.py\", line 208, in _connect_sock\n    await loop.sock_connect(sock, address)\n  File \"/usr/local/lib/python3.11/asyncio/selector_events.py\", line 634, in sock_connect\n    return await fut\n           ^^^^^^^^^\n  File \"/usr/local/lib/python3.11/asyncio/selector_events.py\", line 674, in _sock_connect_cb\n    raise OSError(err, f'Connect call failed {address}')\nConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 7880)\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/worker.py\", line 941, in _connection_task\n    ws = await self._http_session.ws_connect(\n         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/client.py\", line 1076, in _ws_connect\n    resp = await self.request(\n           ^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/client.py\", line 779, in _request\n    resp = await handler(req)\n           ^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/client.py\", line 734, in _connect_and_send_request\n    conn = await self._connector.connect(\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py\", line 642, in connect\n    proto = await self._create_connection(req, traces, timeout)\n            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py\", line 1209, in _create_connection\n    _, proto = await self._create_direct_connection(req, traces, timeout)\n               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py\", line 1581, in _create_direct_connection\n    raise last_exc\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py\", line 1550, in _create_direct_connection\n    transp, proto = await self._wrap_create_connection(\n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/aiohttp/connector.py\", line 1291, in _wrap_create_connection\n    raise client_error(req.connection_key, exc) from exc\naiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:7880 ssl:default [Connect call failed ('127.0.0.1', 7880)]", "timestamp": "2025-11-25T16:25:28.512772+00:00"}
Is anyone facing this issue after deploying agent in cloud?? From my understanding, the livekit secrets are automatically injected by LiveKit Cloud's infrastructure but in logs i am seeing it trying to connect to localhost which i assume is a fallback. Agent was working for several months now and we had not made any changes in the past week but this random started happening today. This is btw my staging agent. My production agent is working fine so not sure where the issue is coming from honestly. Appreciate if anyone can help out.
e
can you send me your agent id?
c
CA_XhSoZgSXyQzj
👀 1
e
what version of the agents sdk are you using?
c
Latest version. My requirements.txt has these added
Copy code
livekit>=0.17.0
livekit-agents[google,deepgram,cartesia,silero,turn-detector,mcp]>=1.2.17
e
looks like there is a bug in the latest agents sdk, can you lock to
<1.3.4
for now and redeploy? i'll get with our sdk team and get a fix out
🙌 1
h
I have the same issue, started 9 hours ago!! I tried to delete the agent and create a new one, and got the same results!! Agent Id: CA_ypGZ6tmzErmt
Copy code
Using agent [CA_ypGZ6tmzErmt]
/home/appuser/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:266: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date.
  warnings.warn(message, FutureWarning)
{"level": "INFO", "name": "livekit.agents", "message": "starting worker", "version": "1.3.4", "rtc-version": "1.0.19", "timestamp": "2025-11-25T18:46:58.846186+00:00"}
{"level": "INFO", "name": "livekit.agents", "message": "preloading plugins", "packages": ["livekit.plugins.elevenlabs", "livekit.plugins.google", "livekit.plugins.deepgram", "livekit.plugins.silero", "livekit.plugins.turn_detector", "av"], "timestamp": "2025-11-25T18:46:58.846342+00:00"}
/home/appuser/.local/lib/python3.10/site-packages/google/api_core/_python_version_support.py:266: FutureWarning: You are using a Python version (3.10.12) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date.
  warnings.warn(message, FutureWarning)
{"level": "INFO", "name": "livekit.agents", "message": "initializing process", "pid": 70, "timestamp": "2025-11-25T18:47:01.289876+00:00"}
{"level": "INFO", "name": "livekit.agents", "message": "initializing process", "pid": 76, "timestamp": "2025-11-25T18:47:01.323998+00:00"}
{"level": "INFO", "name": "livekit.agents", "message": "process initialized", "pid": 70, "elapsed_time": 0.32, "timestamp": "2025-11-25T18:47:01.607253+00:00"}   
{"level": "INFO", "name": "livekit.agents", "message": "process initialized", "pid": 76, "elapsed_time": 0.31, "timestamp": "2025-11-25T18:47:01.636238+00:00"}   
{"level": "WARNING", "name": "livekit.agents", "message": "failed to connect to livekit, retrying in 0s", "exc_info": "Traceback (most recent call last):\n  File \"/home/appuser/.local/lib/python3.10/site-packages/aiohttp/connector.py\", line 1268, in _wrap_create_connection\n    sock = await aiohappyeyeballs.start_connection(\n  File \"/home/appuser/.local/lib/python3.10/site-packages/aiohappyeyeballs/impl.py\", line 141, in start_connection\n    raise OSError(first_errno, msg)\nConnectionRefusedError: [Errno 111] Multiple exceptions: [Errno 111] Connect call failed ('::1', 7880, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 7880)\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n  File \"/home/appuser/.local/lib/python3.10/site-packages/livekit/agents/worker.py\", line 941, in _connection_task\n    ws = await self._http_session.ws_connect(\n  File \"/home/appuser/.local/lib/python3.10/site-packages/aiohttp/client.py\", line 1076, in _ws_connect\n
e
in your requirements.txt or your pyproject.toml, you'll have a line similar (but with different/more plugins) to this, and you should lock it to less than 1.3.4
Copy code
livekit-agents[openai,deepgram,turn-detector,silero]<1.3.4
and then do an
lk a deploy
and it should resolve the issue