Livekit has any issue ? signal connection failed ...
# ask-ai
b
Livekit has any issue ? signal connection failed on v0 path: Timeout("signal connection timed out") The room connection was not established within 10 seconds after calling job_entry.
t
Thanks for reaching out, Yethu. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m sorry you’re seeing that timeout when trying to join a room. I’ll help troubleshoot. You reported: •
signal connection failed on v0 path: Timeout("signal connection timed out")
• “The room connection was not established within 10 seconds after calling job_entry.” Quick checks you can run now: • Are you running multiple agent worker processes using the same
agent_name
? Multiple workers per
agent_name
are recommended to avoid dispatch timeouts. • Is the agent server dedicated (no other apps) and able to accept connections? Running other apps on the same host can cause dispatch failures. • Do you have load balancing / auto-scaling configured so more workers spin up when job queue depth increases? If you can share the following, I’ll narrow this down: 1. Deployment type (self-hosted or LiveKit cloud). 2. Number of agents/workers per
agent_name
. 3. Whether you recently changed network, firewall, or DNS settings. 4. Any agent/server logs around the timeout (timestamps help). What you can try next if you want immediate mitigation: • Start an additional agent worker for the same
agent_name
to add redundancy. • Verify the agent host can reach the LiveKit server and that no firewall blocks signaling ports. • Retry the join after increasing the agent-side timeout briefly (if you control the agent code) to see if it’s intermittent. If you share the details above and any relevant logs, I’ll recommend the next specific steps. Sources: How to Get Help from LiveKit | Server lifecycle | LiveKit Documentation, with interactive elements
b
I have deployed this agent on the livekit cloud only
t
Thanks — helpful to know you’re on LiveKit Cloud. I’ll help narrow this down. A few targeted questions so I can advise next steps: 1. Are you using LiveKit’s hosted agent feature or running an agent you registered to the cloud? 2. How many agent workers (instances) do you have registered under the same
agent_name
? 3. Do you see matching timestamps in the agent/server logs for the timeout? If so, please paste the log lines around the error. 4. Did this start happening recently or after any config/network change? Immediate checks to try now: • If you only have a single agent worker, start an additional worker for the same
agent_name
to add redundancy. • Confirm there are no firewall rules or corporate network restrictions blocking signaling (WebSocket) connections from your clients. • Retry the join and capture client and agent logs with timestamps so we can correlate the attempt. Share the answers and any logs you can copy here and I’ll recommend precise next steps. , with interactive elements
b
only one agent, if I use the same name and deploy once more would that suffice
t
Short answer: Yes — adding a second agent worker with the same
agent_name
is the recommended way to reduce dispatch timeouts and provide redundancy. What to do: • Deploy another agent instance using the exact same
agent_name
. • Ensure both agents are healthy and able to accept jobs (check their logs after startup). • Retry the join; having multiple workers lets the server route the job to the first available worker, avoiding single-worker delays. Would you like step-by-step deployment help or guidance on which logs to check to confirm the new worker is picking up jobs? , with interactive elements
b
Three distinct problems in these logs: 1. ConnectionError: engine is closed Race condition. Room disconnected, but code still tried stream_bytes() to send a message. The engine was already torn down. Happens when send is attempted during/after disconnect cleanup. 2. 401 on LiveKit Cloud + OTLP Two separate auth failures: - https://.../observability/recordings/v0 → LIVEKIT_API_KEY / LIVEKIT_API_SECRET invalid or doesn't have observability permissions for that cloud project - OTLP exporter 401 → OTEL_EXPORTER_OTLP_HEADERS API key is wrong/expired 3. Signal connection timeouts → RegionError("region fetch timed out") LiveKit can't reach the signal server to negotiate region. Network/DNS issue from wherever the agent is running. Causes retrying... (1/3) loop then eventually connects (you see RoomInputOptions warning after — so it does connect eventually). Secondary (non-critical): - Memory 517-520MB > 500MB warn threshold → normal if loading large models per process, but worth watching - RoomInputOptions/RoomOutputOptions deprecated → migrate to RoomOptions - Audio queue overflow → momentary, likely during connection delay Root cause priority: 1. Fix API keys (check LIVEKIT_API_KEY, LIVEKIT_API_SECRET, OTLP headers in env/secrets) 2. Investigate network path from agent host to LiveKit signal endpoint — DNS resolution, firewall rules 3. Guard the stream_bytes call with a connection check before sending
t
Thanks — this is helpful detail. I’ll address each of the three root issues you listed, confirm the recommended redundancy step, and give short actionable steps you can take now. Acknowledgement • I’m responding to the three distinct errors in your logs: (1)
ConnectionError: engine is closed
, (2) 401s for Cloud observability + OTLP, and (3) signal connection timeouts /
RegionError
. You’re on LiveKit Cloud and currently have one agent—adding a second agent was discussed. Actionable steps (priority order) 1) Fix 401s (highest priority) • Verify the LiveKit project API key/secret used by the agent match the target project and haven’t expired; check for clock skew when generating tokens. • Ensure the project has Agent Observability enabled if you want to upload recordings. • Check the OTLP exporter headers / API key used by your OTLP exporter (the OTLP header value must be correct and valid). • After updating credentials, restart the agent and confirm the 401s stop. 2) Address signal connection timeouts / RegionError • From the agent host, confirm DNS resolves the LiveKit signal endpoint and that WebSocket/TCP to the signal URL is reachable (curl/wss test or
nc
to the host:port). • Run LiveKit’s Connection Test utility (WebSocket, WebRTC, TURN checks) to identify blocked paths: https://kb.livekit.io/articles/3972989092-diagnosing-connection-errors-with-connectionchecker • Check firewall/NAT/VPN rules and allow outbound WebSocket/TCP/ICE/TURN as needed. If intermittent, capture timestamps and logs to correlate retries and eventual success. 3) Fix race condition:
ConnectionError: engine is closed
• Guard sends with a connection/state check so
stream_bytes()
isn’t called during/after shutdown. • Ensure session shutdown/close flows drain queues before tearing down I/O (use the graceful shutdown APIs your agent SDK exposes). • If you’re on an older SDK, update to the latest agent SDK which may include improved shutdown handling. Redundancy to reduce dispatch/timeouts • Deploy at least one additional agent worker using the same
agent_name
. That provides redundancy so the server can dispatch to the first available worker and reduce dispatch timeouts. Short diagnostics I can help you run • Paste the agent log lines (with timestamps) showing the 401s, the RegionError timeouts, and the ConnectionError. • Tell me the values you can confirm now: whether observability is enabled in project settings, and whether you can run the Connection Test from the agent host. If you want, I can give exact shell commands to: • check DNS/WebSocket reachability from your agent host, • decode and inspect a JWT token, • and show the minimal code pattern to guard
stream_bytes()
during shutdown. Which of those do you want first? Sources: Troubleshooting 401 Unauthorized and Token Errors | LiveKit | Checklist for Regional Deployments | LiveKit | LiveKit Agent Observability | Debug and optimize voice agents | LiveKit | Why is my Agent insights data missing? | LiveKit | Diagnosing Connection Errors with Connection Test Utility, with interactive elements
b
why this is happening, is this my issue or livekit
t
Thanks — I understand why you want to know whether this is LiveKit or your side. Short answer: these errors point to configuration and network issues on your side, not a LiveKit-wide outage. Why I say that • 401 errors for observability and OTLP mean the API key/secret or OTLP headers are invalid, missing observability permission, or have clock/expiry problems — that’s project credentials you control. • Signal timeouts / RegionError indicate the agent’s host can’t reach the signal endpoint (DNS, firewall, or network path) — a network/environment issue where the agent runs. •
ConnectionError: engine is closed
is a race condition in your agent code or shutdown flow (send attempted after disconnect) — that’s in your runtime logic or SDK usage. What this implies • LiveKit platform isn’t reporting a system outage for these symptoms; the root causes are configuration, network connectivity, and agent behavior on your side. Fixing API keys/permissions, ensuring network reachability, and adding a second agent worker will resolve the majority of these failures. Next steps I recommend (quick checklist) • Verify LIVEKIT_API_KEY / LIVEKIT_API_SECRET are correct for the project and observability is enabled if you expect recordings. Check token `nbf`/`exp` for clock skew. • Validate OTLP headers/API key used by your exporter. • From the agent host, test DNS and WebSocket/TCP connectivity to your LiveKit signal URL (I can provide commands). • Deploy another agent worker with the same
agent_name
for redundancy. • Add a guard around
stream_bytes()
so sends don’t happen after shutdown. Tell me which fix you want help with first (credentials checks, network tests from the agent host, or the send/ shutdown guard) and I’ll give step‑by‑step commands or code. , with interactive elements