whats the potential issue
# ask-ai
s
whats the potential issue
t
Thanks for reaching out, ABHIRAM. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you out! Could you please share a bit more about the issue you're facing? For instance, are you seeing an error message, noticing any performance hiccups, or something else? The more details you can provide, the better I can assist you.
s
ivekit-livekit-1 | 2025-10-29T185248.532Z INFO livekit rtc/room.go:507 participant active {"room": "room-yp3v8r", "roomID": "RM_VHP4Z6KNchA6", "participant": "user-b3erri", "pID": "PA_dhmCrczhLAy2", "remote": false, "publisherCandidates": ["[local][selected:10][trickle] udp4 host 74.208.153.4:53465 (resolved: 74.208.153.4:53465)", "[local][trickle] tcp4 host 74.208.153.4:7881 (resolved: 74.208.153.4:7881)", "[local][selected:1][trickle] udp4 host 66.179.210.4:57786 (resolved: 66.179.210.4:57786)", "[local][trickle] tcp4 host 66.179.210.4:7881 (resolved: 66.179.210.4:7881)", "[local][selected:9][trickle] udp4 host 172.17.0.1:57477 (resolved: 172.17.0.1:57477)", "[local][trickle] tcp4 host 172.17.0.1:7881 (resolved: 172.17.0.1:7881)", "[local][selected:8][trickle] udp4 host 172.18.0.1:59581 (resolved: 172.18.0.1:59581)", "[local][trickle] tcp4 host 172.18.0.1:7881 (resolved: 172.18.0.1:7881)", "[local][trickle] udp4 host 172.19.0.1:52197 (resolved: 172.19.0.1:52197)", "[local][trickle] tcp4 host 172.19.0.1:7881 (resolved: 172.19.0.1:7881)", "[local][trickle] udp4 host 172.20.0.1:54306 (resolved: 172.20.0.1:54306)", "[local][trickle] tcp4 host 172.20.0.1:7881 (resolved: 172.20.0.1:7881)", "[local][trickle] udp4 host 172.21.0.1:59461 (resolved: 172.21.0.1:59461)", "[local][trickle] tcp4 host 172.21.0.1:7881 (resolved: 172.21.0.1:7881)", "[local][trickle] udp4 host 172.22.0.1:51005 (resolved: 172.22.0.1:51005)", "[local][trickle] tcp4 host 172.22.0.1:7881 (resolved: 172.22.0.1:7881)", "[local][trickle] udp4 host 172.23.0.1:59517 (resolved: 172.23.0.1:59517)", "[local][trickle] tcp4 host 172.23.0.1:7881 (resolved: 172.23.0.1:7881)", "[remote][trickle] udp4 host 192.168.0.195:50111", "[remote][trickle] tcp4 host 192.168.0.195:9", "[remote][selected:1][trickle] udp4 relay 66.179.21...:37241 related 74.208.15...:56362", "[remote][selected:10] udp4 prflx 74.208.15...:37241", "[remote][selected:9] udp4 prflx 74.208.15...:14681", "[remote][selected:8] udp4 prflx 74.208.15...:21862"], "subscriberCandidates": ["[local][selected:1][trickle] udp4 host 74.208.153.4:50098 (resolved: 74.208.153.4:50098)", "[local][trickle] tcp4 host 74.208.153.4:7881 (resolved: 74.208.153.4:7881)", "[local][trickle] udp4 host 66.179.210.4:53582 (resolved: 66.179.210.4:53582)", "[local][trickle] tcp4 host 66.179.210.4:7881 (resolved: 66.179.210.4:7881)", "[local][trickle] udp4 host 172.17.0.1:51923 (resolved: 172.17.0.1:51923)", "[local][trickle] tcp4 host 172.17.0.1:7881 (resolved: 172.17.0.1:7881)", "[local][trickle] udp4 host 172.18.0.1:53558 (resolved: 172.18.0.1:53558)", "[local][trickle] tcp4 host 172.18.0.1:7881 (resolved: 172.18.0.1:7881)", "[local][trickle] udp4 host 172.19.0.1:54262 (resolved: 172.19.0.1:54262)", "[local][trickle] tcp4 host 172.19.0.1:7881 (resolved: 172.19.0.1:7881)", "[local][trickle] udp4 host 172.20.0.1:51198 (resolved: 172.20.0.1:51198)", "[local][trickle] tcp4 host 172.20.0.1:7881 (resolved: 172.20.0.1:7881)", "[local][trickle] udp4 host 172.21.0.1:56575 (resolved: 172.21.0.1:56575)", "[local][trickle] tcp4 host 172.21.0.1:7881 (resolved: 172.21.0.1:7881)", "[local][trickle] udp4 host 172.22.0.1:58105 (resolved: 172.22.0.1:58105)", "[local][trickle] tcp4 host 172.22.0.1:7881 (resolved: 172.22.0.1:7881)", "[local][trickle] udp4 host 172.23.0.1:54955 (resolved: 172.23.0.1:54955)", "[local][trickle] tcp4 host 172.23.0.1:7881 (resolved: 172.23.0.1:7881)", "[remote][trickle] udp4 host 192.168.0.195:55114", "[remote][trickle] tcp4 host 192.168.0.195:9", "[remote][trickle] udp4 relay 66.179.21...:31794 related 74.208.15...:56364", "[remote][selected:1] udp4 prflx 74.208.15...:31794"], "connectionType": "udp", "clientInfo": {"sdk": "JS", "version": "2.15.13", "protocol": 16, "os": "Mac OS X", "osVersion": "10.15.7", "deviceModel": "Mac", "browser": "Chrome", "browserVersion": "141.0.0"}} livekit-livekit-1 | 2025-10-29T185248.667Z INFO livekit service/roommanager.go:408 starting RTC session {"room": "room-yp3v8r", "roomID": "RM_VHP4Z6KNchA6", "participant": "agent-AJ_CuruqwcR3Trn", "pID": "PA_TExx23WeTJjV", "remote": false, "room": "room-yp3v8r", "nodeID": "ND_SyZSd3F22iDG", "numParticipants": 1, "participantInit": {"Identity": "agent-AJ_CuruqwcR3Trn", "Reconnect": false, "ReconnectReason": "RR_UNKNOWN", "AutoSubscribe": true, "Client": {"sdk": "PYTHON", "version": "1.0.17", "protocol": 16}, "Grants": {"Identity": "agent-AJ_CuruqwcR3Trn", "Kind": "agent", "Video": {"RoomCreate": false, "RoomList": false, "RoomRecord": false, "RoomAdmin": false, "RoomJoin": true, "Room": "room-yp3v8r", "CanPublish": true, "CanSubscribe": true, "CanPublishData": true, "CanPublishSources": [], "CanUpdateOwnMetadata": true, "IngressAdmin": false, "Hidden": false, "Recorder": false, "Agent": true, "CanSubscribeMetrics": false, "DestinationRoom": ""}, "SIP": {}, "Agent": {}, "Inference": {}, "Observability": {}, "RoomConfig": {}, "RoomPreset": ""}, "Region": "", "AdaptiveStream": false, "ID": "", "SubscriberAllowPause": "not-set", "DisableICELite": false, "CreateRoom": {"name": "room-yp3v8r"}, "AddTrackRequests": [], "PublisherOffer": {}, "SyncState": {}, "UseSinglePeerConnection": false}} livekit-livekit-1 | 2025-10-29T185248.668Z INFO livekit service/roommanager.go:994 created TURN password {"username": "WpmSUV2VzIDewrIqeVQQxnbzQVZ0V3Y0gDNYdWSQFE", "password": "XPfXVc3BtZIaeuiEo5eJYRPGHDO3k7tiPaqZN4dqQEGB"} livekit-livekit-1 | 2025-10-29T185250.782Z INFO livekit agent/client.go:148 not dispatching agent job since no worker is available {"agentName": "1", "jobType": "JT_PUBLISHER", "room": "room-yp3v8r", "roomID": "RM_VHP4Z6KNchA6"} livekit-livekit-1 | 2025-10-29T185250.782Z INFO livekit agent/client.go:148 not dispatching agent job since no worker is available {"agentName": "1", "jobType": "JT_PARTICIPANT", "room": "room-yp3v8r", "roomID": "RM_VHP4Z6KNchA6"} livekit-livekit-1 | 2025-10-29T185252.806Z INFO livekit rtc/participant.go:1497 participant closing {"room": "room-yp3v8r", "roomID": "RM_VHP4Z6KNchA6", "participant": "user-b3erri", "pID": "PA_dhmCrczhLAy2", "remote": false, "sendLeave": true, "reason": "CLIENT_REQUEST_LEAVE", "isExpectedToResume": false} root@ubuntu:/opt/livekit# FOR CODE: from livekit.agents.llm import function_tool from livekit.agents.voice import RunContext from livekit.plugins import deepgram, openai, elevenlabs, silero from livekit import rtc logger = logging.getLogger("1") load_dotenv() # Define UserData to store JobContext @dataclass class UserData: ctx: JobContext session: AgentSession = None # Define typed RunContext for better type safety RunContext_T = RunContext[UserData] class VoiceAssistant(Agent): def __init__(self) -> None: super().__init__( instructions = " [Identity]\nYou are the ParaTransit AI Assistant, assisting passengers with mobility needs in booking accessible rides, changing or canceling trips, and providing real-time ride infons.", stt=deepgram.STT(model="nova-3"), llm=openai.LLM(model="gpt-4o"), # tts=elevenlabs.TTS( _# model="elevenlabs/eleven_turbo_v2_5",_ # voice="Xb7hH8MSUJpSbSDYk0k2", # language="en"), tts=deepgram.TTS(model="aura-asteria-en"), vad=silero.VAD.load(), tools=[present_content,get_current_time] ) async def on_enter(self): await self.session.say("Hi there! Is there anything I can help you with?") async def entrypoint(_ctx_: JobContext): # Create UserData with JobContext await ctx.connect() # Let it try all transports automatically userdata = UserData(ctx=ctx) session = AgentSession[UserData](userdata=userdata) userdata.session = session await session.start( agent=VoiceAssistant(), room=ctx.room ) if name == "__main__": cli.run_app( WorkerOptions( _entrypoint_fnc_=entrypoint, _agent_name_="1", _# Must match your token's agent_name_ ) ) agent logs 2025-10-30 002247,417 - INFO livekit.agents - process initialized {"pid": 67502, "elapsed_time": 1.07} 2025-10-30 002247,416 - DEBUG asyncio - Using selector: KqueueSelector {"pid": 67502} 2025-10-30 002257,421 - WARNING livekit.agents - The room connection was not established within 10 seconds after calling job_entry. This may indicate that job_ctx.connect() was not called. {"pid": 67502, "job_id": "AJ_CuruqwcR3Trn"} 2025-10-30 002303,754 - WARNING livekit - livekit:rtc engine401livekit:rtc_engine - failed to connect: Connection("wait_pc_connection timed out"), retrying... (1/3) {"pid": 67502, "job_id": "AJ_CuruqwcR3Trn"} 2025-10-30 002304,429 - INFO livekit.agents - process exiting {"reason": "", "pid": 67502, "job_id": "AJ_CuruqwcR3Trn"} 2025-10-30 002304,428 - DEBUG livekit.agents - shutting down job task {"reason": "", "user_initiated": false, "pid": 67502, "job_id": "AJ_CuruqwcR3Trn"} 2025-10-30 002304,428 - DEBUG livekit.agents - http_session(): closing the httpclient ctx {"pid": 67502, "job_id": "AJ_CuruqwcR3Trn"} 2025-10-30 002304,428 - DEBUG livekit.agents - http_session(): creating a new httpclient ctx {"pid": 67502, "job_id": "AJ_CuruqwcR3Trn"}
t
It looks like the errors in your logs are showing that the LiveKit RTC session couldn’t establish a peer connection within the expected timeout. Don’t worry—let’s walk through some common causes and how we can address them together: • ICE Connection Timeout: Sometimes the peer connection doesn’t happen within the 15-second window. It might help to check that your network allows WebRTC traffic, including UDP ports. • Agent Not Calling
connect()
Promptly:
Make sure
job_ctx.connect()
is being called right at the start of your job entrypoint—this helps avoid any delays. • Insufficient Worker Availability: If possible, try running multiple agent instances so jobs can be dispatched smoothly without workers being unavailable. • Resource Contention: Using dedicated servers for your agents can prevent other applications from interfering and improve performance. • Network or Firewall Restrictions: It’s a good idea to run the LiveKit Connection Test utility to check for network issues and make sure TURN servers are reachable. To help diagnose further, you can also run these commands:
Copy code
lk agent status --id <agent-id>
lk agent logs --id <agent-id> --log-type=deploy
If you’d like, I’m here to help you through any of these steps or clarify anything—just let me know! Sources: livekit-agents/livekit/agents/job.py | Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki | Diagnosing Connection Errors with Connection Test Utility | Firewall Tips