abundant-father-33863
05/19/2026, 12:27 PMtall-airline-16756
05/19/2026, 12:27 PMtall-airline-16756
05/19/2026, 12:28 PMLIVEKIT_API_KEY and LIVEKIT_API_SECRET in the agent environment are correct, have no extra whitespace, and match the project for LIVEKIT_URL.
• LIVEKIT_URL: Ensure LIVEKIT_URL is set to the correct cloud gateway and there’s no trailing slash or typo.
• Token validity: Decode the JWT you’re using (e.g., jwt.io) and confirm nbf and exp are valid relative to current UTC time and the token is signed with the secret above.
• Clock skew: Verify the machine/container clock is accurate (use NTP). A skewed clock commonly causes token `nbf`/`exp` rejections.
• Token TTL: Ensure tokens are issued with a positive TTL (not already expired or zero).
• Environment loading: Confirm the agent process actually receives those env vars (print them safely or log masked values) instead of relying on a different config source.
• Repro/redeploy: Try restarting the agent or redeploying after ensuring the above to rule out stale env or suspended VM time issues.
If you’d like, I can dive deeper — please share:
1. How you start the agent (mode: start, dev, or console) and the exact command or docker/k8s manifest you use.
2. The values (redact secrets) for LIVEKIT_URL, API key name, and token `exp`/`nbf` timestamps from the decoded JWT.
3. Whether this started after a change (new keys, deployment, container migration), and whether the container/VM was suspended or resumed recently.
Reply with those details and I’ll provide the next targeted steps.
Sources: Troubleshooting 401 Unauthorized and Token Errors | LiveKit | Server startup modes | LiveKit Documentation, with interactive elementsabundant-father-33863
05/19/2026, 1:48 PMtall-airline-16756
05/19/2026, 1:48 PMLIVEKIT_URL
◦ LIVEKIT_API_KEY name/ID
◦ Token exp and nbf timestamps from a decoded JWT you’re using
1. A short excerpt of the agent logs around the handshake error (the 3–5 lines before and after). Mask any secrets or full tokens.
2. Whether the machine/container was recently suspended, migrated, or resumed (possible clock skew).
3. Any recent changes (rotated keys, updated agent version, config changes) before the error started.
While you gather that, try restarting the agent after forcing clock sync (e.g., run NTP or ntpdate) and reissue a fresh token with a short positive TTL; let me know if the error changes.
, with interactive elements