Issue while Deploying LiveKit Agent

Hi,

I’m trying to deploy this app, which is a Realtime AI using LiveKit for WebRTC connections.

The agent fails to connect to LiveKit server’s URL:

wss://<my_instance>.livekit.cloud

Not much in the agent log:

# more /var/log/supervisor/agent_stderr.log
2024-12-16 10:40:28,039 - DEBUG asyncio - Using selector: EpollSelector 
2024-12-16 10:40:28,047 - DEV  livekit.agents - Watching /app 
2024-12-16 10:40:30,420 - DEBUG asyncio - Using selector: EpollSelector 
2024-12-16 10:40:30,426 - INFO livekit.agents - starting worker {"version": "0.12.2", "rtc-version": "0.18.2"}
2024-12-16 10:40:30,472 - INFO livekit.agents - registered worker {"id": "AW_w9QCf8CArTPr", "region": "Germany", "protocol": 15, "node_id": "NC_DFR
A1A_g3PnXGhfWwXt"}
2024-12-16 10:42:54,286 - INFO livekit.agents - received job request {"job_id": "AJ_RmDvEJNGbe8C", "dispatch_id": "", "room_name": "ricoapp-2412161
042-anon-f2b3d", "agent_name": "", "resuming": false}
2024-12-16 10:43:04,313 - ERROR livekit.agents - initialization timed out, killing process {"pid": 41}

Is there any restriction to connect from the Koyeb instance to a remote service in using wss protocole?

(I’m using the free plan)

Thanks for your help,
Xavier

Hey!

You should be able to connect to a remote server using websockets.

How do you know that the app fails to connect to wss://xxx.livekit.cloud? Is there are way for you to isolate the request that errors on your own computer? Maybe with websocat or some custom code?

Thanks David,
Knowing that there shouldn’t be a restriction, I’ve added some debugging stuff and check the logs and fixed the problem. It works well.

The issue was from the env variables configuration that where not properly set using Koyeb’s SECRETS (nice feature design).