Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection Issue with LiveKit Server - Unexpected Disconnect #98

Closed
wezerr opened this issue Oct 7, 2024 · 3 comments
Closed

Connection Issue with LiveKit Server - Unexpected Disconnect #98

wezerr opened this issue Oct 7, 2024 · 3 comments
Assignees

Comments

@wezerr
Copy link

wezerr commented Oct 7, 2024

I am experiencing an issue where I am unable to maintain a stable connection to the LiveKit server. The connection is established initially, but it disconnects shortly afterward. This issue might be related to the Windows operating system. Below are the logs captured from the command line and the server:

PS C:\Projects\agents-js> pnpm examples:minimal dev --url wss://tstsv-q0km4ktj.livekit.cloud --api-key APIxyqMupq4VRzs --api-secret hZvMq0q5j6TMFGAEE8BLvPfhia0CEOrfTf2QIJADTKOA --log-level debug

> @livekit/agents-monorepo@ examples:minimal C:\Projects\agents-js
> pnpm exec tsx examples/src/minimal_assistant.ts "dev" "--url" "wss://tstsv-q0km4ktj.livekit.cloud" "--api-key" "APIxyqMupq4VRzs" "--api-secret" "hZvMq0q5j6TMFGAEE8BLvPfhia0CEOrfTf2QIJADTKOA" "--log-level" "debug"

[17:52:31.709] INFO (19676): starting worker
    version: "0.1.0"
[17:52:31.769] INFO (19676): Server is listening on port 65356
[17:52:32.008] DEBUG (19676): connected to LiveKit server
    version: "0.1.0"
[17:52:32.069] INFO (19676): registered worker
    version: "0.1.0"
    id: "AW_kTGxpWKVfVJV"
    server_info: {
      "edition": "Cloud",
      "version": "1.7.2",
      "protocol": 15,
      "region": "Germany",
      "nodeId": "NC_DFRA1A_D8jgQXU5itUu",
      "debugInfo": "",
      "agentProtocol": 0
    }
Usage: agents [options] [command]

LiveKit Agents CLI

Options:
  -V, --version          output the version number
  --log-level <level>    Set the logging level (choices: "trace", "debug", "info", "warn", "error", "fatal", default: "info", env:  
                         LOG_LEVEL)
  --url <string>         LiveKit server or Cloud project websocket URL (env: LIVEKIT_URL)
  --api-key <string>     LiveKit server or Cloud project's API key (env: LIVEKIT_API_KEY)
  --api-secret <string>  LiveKit server or Cloud project's API secret (env: LIVEKIT_API_SECRET)
  -h, --help             display help for command

Commands:
  start                  Start the worker in production mode
  dev [options]          Start the worker in development mode
  connect [options]      Connect to a specific room
C:\Projects\agents-js\agents\dist\ipc\proc_job_executor.js:111
            throw err;
            ^


Error: runner initialization timed out
    at Timeout._onTimeout (C:\Projects\agents-js\agents\dist\ipc\proc_job_executor.js:109:25)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

Node.js v22.2.0
 ELIFECYCLE  Command failed with exit code 1.

Server Logs:

2024-10-07T14:46:53.897Z	DEBUG	livekit	agent/worker.go:307	worker registered	{"request": "version:\"0.1.0\" allowed_permissions:{can_subscribe:true can_publish:true can_publish_data:true can_update_metadata:true agent:true}"}
2024-10-07T14:46:53.897Z	INFO	livekit	service/agentservice.go:259	initial worker registered	{"namespace": "", "jobType": "JT_ROOM"}
2024-10-07T14:46:58.913Z	DEBUG	livekit	agent/worker.go:382	worker status update	{"status": "WS_AVAILABLE", "load": 0.16}
2024-10-07T14:47:01.422Z	DEBUG	livekit	agent/worker.go:382	worker status update	{"status": "WS_AVAILABLE", "load": 0.05}
2024-10-07T14:47:04.173Z	INFO	livekit	service/agentservice.go:203	worker closed WS connection	{"wsError": "websocket: close 1006 (abnormal closure): unexpected EOF"}
2024-10-07T14:47:04.173Z	INFO	livekit	agent/worker.go:251	closing worker
2024-10-07T14:47:04.173Z	DEBUG	livekit	service/agentservice.go:289	last worker deregistered

Thanks for your hard work!

@pork1977
Copy link

Just in case it helps, I'm sure I have the same problem so I thought I'd just paste what I see too (in case there's any useful info to be seen)

PS C:\Users\Paul\Documents\Sandbox\synchronized-wireframe-2p1maq> node dist/agent.js connect --room playground-eUWp-BONl
[13:57:23.747] INFO (45416): starting worker
version: "0.1.0"
[13:57:23.798] INFO (45416): Server is listening on port 58105
[13:57:23.859] INFO (45416): registered worker
version: "0.1.0"
id: "AW_wLLgxQWJyY55"
server_info: {
"edition": "Cloud",
"version": "1.7.2",
"protocol": 15,
"region": "UK",
"nodeId": "NC_OLONDON1B_hyzaFTMwQo2R",
"debugInfo": "",
"agentProtocol": 0
}
[13:57:23.859] INFO (45416): connecting to room playground-eUWp-BONl
[13:57:23.946] INFO (45416): received job request
version: "0.1.0"
job: {
"id": "AJ_HpcoeSUCSxrn",
"type": "JT_ROOM",
"room": {
"sid": "RM_iCT4LdWLTz4g",
"name": "playground-eUWp-BONl",
"emptyTimeout": 300,
"maxParticipants": 0,
"creationTime": "1729081319",
"turnPassword": "",
"enabledCodecs": [
{
"mime": "video/H264",
"fmtpLine": ""
},
{
"mime": "video/VP8",
"fmtpLine": ""
},
{
"mime": "video/VP9",
"fmtpLine": ""
},
{
"mime": "video/AV1",
"fmtpLine": ""
},
{
"mime": "audio/red",
"fmtpLine": ""
},
{
"mime": "audio/opus",
"fmtpLine": ""
}
],
"metadata": "",
"numParticipants": 1,
"activeRecording": false,
"numPublishers": 1,
"version": {
"unixMicro": "1729081319682921",
"ticks": 0
},
"departureTimeout": 20
},
"namespace": "",
"metadata": "",
"agentName": "",
"state": {
"status": "JS_PENDING",
"error": "",
"startedAt": "0",
"endedAt": "0",
"updatedAt": "1729083444310278705",
"participantIdentity": ""
},
"dispatchId": ""
}
resuming: false
agentName: ""
Usage: agents [options] [command]

LiveKit Agents CLI

Options:
-V, --version output the version number
--log-level Set the logging level (choices: "trace", "debug", "info", "warn", "error", "fatal", default: "info", env: LOG_LEVEL)
--url LiveKit server or Cloud project websocket URL (env: LIVEKIT_URL)
--api-key LiveKit server or Cloud project's API key (env: LIVEKIT_API_KEY)
--api-secret LiveKit server or Cloud project's API secret (env: LIVEKIT_API_SECRET)
-h, --help display help for command

Commands:
start Start the worker in production mode
dev [options] Start the worker in development mode
connect [options] Connect to a specific room
file:///C:/Users/Paul/Documents/Sandbox/synchronized-wireframe-2p1maq/node_modules/.pnpm/@livekit[email protected]/node_modules/@livekit/agents/dist/ipc/proc_job_executor.js:111
throw err;
^

Error: runner initialization timed out
at Timeout._onTimeout (file:///C:/Users/Paul/Documents/Sandbox/synchronized-wireframe-2p1maq/node_modules/.pnpm/@livekit[email protected]/node_modules/@livekit/agents/dist/ipc/proc_job_executor.js:109:25)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)

@nbsp nbsp closed this as completed Oct 16, 2024
@nbsp nbsp self-assigned this Oct 16, 2024
@nbsp nbsp added the node agents label Oct 16, 2024 — with Linear
@nbsp nbsp reopened this Oct 16, 2024
@nbsp nbsp removed the node agents label Oct 16, 2024
@nbsp
Copy link
Member

nbsp commented Oct 16, 2024

hi, i believe this has been fixed in #114. are you able to re-test this on main?

@wezerr
Copy link
Author

wezerr commented Oct 17, 2024

hi! I've re-tested this on the main branch, and it works. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants