My voice agents are abruptly leaving the room with...
# ask-ai
c
My voice agents are abruptly leaving the room with the following error message Why is this happening?
process exited with non-zero exit code -9
t
Thanks for reaching out, Firebolt. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you share a bit more about the environment where this issue is happening? For instance, are you running the voice agents on a particular operating system? Also, have you noticed any other logs or patterns right before the error pops up? Understanding these details will really help us get to the bottom of this together.
c
So I have a silent agent which is subscribing to audio tracks, running them through a STT model and just transcribing it. I see that on certain calls, it just ends up failing with the above error message.
t
I'm sorry to hear you're encountering the error
process exited with non-zero exit code -9
. This usually means the operating system had to forcefully stop the agent process with a SIGKILL signal. This can happen for a few reasons, such as: • Memory Limit Enforcement: The agent might be using more memory than allowed, especially during heavy audio processing. • Initialization or Shutdown Timeout: The agent didn't start up or shut down within the expected time frame. • Unresponsive Process: Sometimes the agent can get stuck or overwhelmed, making it unresponsive. • Audio Frame Queue Overflow: If the internal audio queue gets too full, it can cause high memory use or cause the agent to hang. To help resolve this, here are some steps you can try: 1. Take a look at the agent logs with `lk agent logs`—this will help pinpoint where things are going wrong. 2. Keep an eye on memory usage and consider increasing the memory allocation if it looks like the agent is hitting limits. 3. Try increasing the
queue_size_ms
in
AudioSource
to give the agent more buffer for incoming audio frames. For example:
Copy code
audio_source = rtc.AudioSource(
    sample_rate=sample_rate,
    num_channels=channels,
    queue_size_ms=2000
)
1. Make sure the agent is able to respond quickly during startup and stays responsive while running. 2. Use
lk agent status
to check on the agent’s current state and catch any errors. 3. If there are heavy processing tasks, try moving them to background threads or processes to keep the main loop running smoothly. Please don’t hesitate to reach out if you want me to walk you through any of these steps or if you need any more help troubleshooting. I’m here to support you! Sources: pkg/loadtester/agentloadtester.go | livekit-agents/livekit/agents/voice/room_io/_input.py | Getting Help | livekit/livekit_composite | DeepWiki | Agent deployment CLI reference | LiveKit Docs | Agent deployment CLI reference | LiveKit Docs
c
How about non zero status code -6? What causes this to happen?
t
Could you please share a bit more about when you’re seeing the error code -6? For instance, does it pop up during certain actions, with specific settings, or in particular situations? Understanding this will really help us get to the bottom of what’s going on.
c
Ignore that bit, so in order to not get
process exited with non-zero exit code -9
I just scaled out my pods, but I still see those errors popping up. Why might that be happening?
t
I understand that scaling out pods increases the number of replicas, but it might not fully resolve the
process exited with non-zero exit code -9
error you're encountering. This error usually happens when the operating system forcibly stops a process because it’s using too many resources, often memory (which triggers the OOM killer). To help you move forward, here are a few steps you might consider: • Increase Memory Limits: Try adjusting the memory allocated to each pod to make sure they have enough resources for the workload. • Optimize Memory Usage: It could be helpful to review and fine-tune the agent’s code to reduce memory consumption, especially during audio processing tasks. • Combine Scaling with Resource Allocation: When scaling out horizontally, ensure each pod has the right balance of CPU and memory resources. If you’d like, I’m here to guide you through adjusting resource limits or any other troubleshooting steps. Just let me know! Sources: livekit-agents/livekit/agents/ipc/supervised_proc.py | Agent deployment CLI reference | LiveKit Docs