we face some problems that the agent does not join...
# ask-ai
s
we face some problems that the agent does not join the room. we have next js, livekit cloud, and local agent, where can we debug that or find the errors?
✅ 1
t
Thanks for reaching out, Mostafa. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I understand your agent isn't joining the room with a Next.js front end, LiveKit Cloud, and a local agent. Here are focused places to check and next steps to gather useful debug info. Where to check first • Local agent process/terminal: look for connection/auth errors and "registered worker" messages. • Increase agent log verbosity: set
LIVEKIT_LOG_LEVEL=DEBUG
or run with debug flag to see detailed errors. • LiveKit Cloud logs: run
lk agent logs
or
lk agent logs --id <agent-id>
to view deployed agent logs. • Agent Console (LiveKit Cloud dashboard): open the session/agent view to see realtime connection status, events, audio, and latency. • Agent Observability (Sessions → select session → “Agent insights”): check transcripts, trace timing, and chronological logs for failures. • Authentication/env vars: verify
LIVEKIT_URL
,
LIVEKIT_API_KEY
, and
LIVEKIT_API_SECRET
are correct and tokens aren’t returning 401s. • Dispatch/config: confirm
agent_name
and dispatch settings match the room and that dispatch requests reach the agent. Targeted questions to narrow down cause • Do you see any errors in the local agent terminal or
lk agent logs
? If so, what are the exact error messages? • Does the Agent Console show the agent attempting to connect or any failed connection attempts? • Are there 401/permission errors in logs? Are env vars
LIVEKIT_URL
,
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
set for both local agent and deployment? • Are you using explicit dispatch (agent name) or generic routing? Which agent name/room ID are you sending? • Can your local agent reach LiveKit Cloud (no firewall/NAT blocking)? Can you share a short excerpt of the relevant logs (errors only)? If you share one or two error lines from the agent logs and which dispatch method you use, I’ll give precise next steps to fix it. Sources: Where to find your Agent Logs | LiveKit | Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Debug voice agents in real time with Agent Console | LiveKit | Streamline troubleshooting with Agent Observability | LiveKit | Where to find your Agent Logs | LiveKit, with interactive elements