-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Summary
Deployed Node agent enters CrashLoop in LiveKit Cloud because required turn-detector model files are not found at runtime, even though download-files is run during Docker build.
Environment
- Template:
agent-starter-node - Runtime: LiveKit Cloud deployment
- Status observed:
CrashLoop
Steps to reproduce
Build and deploy the agent using the current Dockerfile.
git clone https://github.com/livekit-examples/agent-starter-node.git
cd agent-starter-node
pnpm i
lk cloud auth
lk agent create- Select project
- Select region for agent deployment
- Select
Yeswhen promptedWould you like to view logs? - Observe logs
Actual behavior
Agent fails during startup with missing turn-detector artifacts and times out:
File not found in cache: livekit/turn-detector/onnx/model_q8.onnxagents-plugins-livekit failed to initialize ... Required model files not found locallyrunner initialization timed out
Expected behavior
Agent should start successfully, with required model files available to the runtime user.
Root cause
Model files are downloaded during build under root’s cache directory (e.g. /root/.cache/...), but runtime process executes as appuser and reads cache from that user’s home (e.g. /app/.cache/...).
This user/home mismatch makes the downloaded files invisible at runtime.
Impact
- Deployment fails to become healthy.
- Agent remains in
CrashLoop. - Cloud dashboard metadata can be incomplete/unreliable while startup fails (e.g. blank Agent Name).
Workaround / Fix
Resolved by #29
Download model files as the same user that runs the agent process in production:
- Remove build-stage
pnpm download-files. - Run
node dist/main.js download-filesafterUSER appuserin production stage.
Acceptance criteria
- Agent starts without missing model file errors.
- Deployment reaches healthy/running state.
- No
runner initialization timed outcaused by missing turn-detector cache files.