025-09-11T10:52:55.737Z INFO livekit servi...
# ask-ai
n
025-09-11T105255.737Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8415337: use of closed network connection"} 2025-09-11T105255.987Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213 2025-09-11T105255.987Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8416418: use of closed network connection"} 2025-09-11T105256.229Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213 2025-09-11T105256.229Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8415339: use of closed network connection"} 2025-09-11T105256.468Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213 2025-09-11T105256.468Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8416420: use of closed network connection"} 2025-09-11T105256.714Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213 2025-09-11T105256.714Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8415341: use of closed network connection"} 2025-09-11T105256.950Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213 2025-09-11T105256.950Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8416422: use of closed network connection"} 2025-09-11T105257.194Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213 2025-09-11T105257.194Z INFO livekit service/agentservice.go:191 Agent worker closed WS connection {"wsError": "read tcp 10.0.101.1087880 >154.182.86.8415343: use of closed network connection"} 2025-09-11T105257.437Z ERROR livekit service/agentservice.go:213 failed to register worker {"workerID": "", "jobType": "JT_ROOM", "error": "invalid worker id"} github.com/livekit/livekit-server/pkg/service.(*AgentHandler).handleRegister /workspace/pkg/service/agentservice.go:213
t
Thanks for reaching out, Mohamed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're encountering the errors "invalid worker id" and "Agent worker closed WS connection." These issues usually come up during the worker registration process or when the WebSocket connection unexpectedly drops. The "invalid worker id" error typically means the worker wasn't able to register properly with the LiveKit server—this might happen if the registration message is missing some important information. On the other hand, the "Agent worker closed WS connection" error suggests that the WebSocket connection between the worker and server was closed unexpectedly. This could be due to network hiccups, timeouts, or the worker process stopping unexpectedly. Here are a few steps you can try to get things back on track: • Double-check that the worker is set up with the right environment variables:
LIVEKIT_URL
,
LIVEKIT_API_KEY
, and
LIVEKIT_API_SECRET
. • Make sure the worker can connect to the LiveKit server without any network issues. • Confirm that the worker has access to all the resources it needs. • You might also want to increase the
max_retry
setting in the worker configuration to give it more chances to reconnect if something goes wrong. If you try these and still run into trouble, please don’t hesitate to reach out—I’m here to help you through it. Sources: pkg/service/agentservice.go | agents/CHANGELOG.md | livekit-agents/livekit/agents/worker.py
I'm sorry to hear you're experiencing the "invalid worker id" and "Agent worker closed WS connection" errors. These usually happen during the worker registration process or when the WebSocket connection unexpectedly drops. The "invalid worker id" error typically means the worker tried to connect to the LiveKit server but something went wrong during registration—maybe the registration message was incomplete or incorrect. The "Agent worker closed WS connection" message shows up when the WebSocket connection closes unexpectedly, which might be due to network hiccups, timeouts, or the worker process stopping unexpectedly. Here are a few steps you can try to get things back on track: • Double-check that the worker is set up with the right environment variables like
LIVEKIT_URL
,
LIVEKIT_API_KEY
, and
LIVEKIT_API_SECRET
. • Make sure the worker has access to all the resources it needs and that there aren’t any network issues between the worker and the LiveKit server. • Try increasing the
max_retry
value in the worker’s configuration to give it more chances to reconnect if it runs into trouble. If you keep running into problems, please don’t hesitate to reach out—I’m here to help you through this!