LiveKit Cloud agent in bad state
# ask-ai
a
LiveKit Cloud agent in bad state
ssue: Agent stuck in inconsistent state, cannot be deleted Problem: • Agent CA_uq4gvF2pdq7d shows up in lk agent list • CLI tries to delete CA_2kjcjZ2hdV8x (different ID) and fails with "agent not found" • Cannot delete agent from LiveKit Cloud UI either • Cannot create new agents due to "maximum number of agents reached (1/1)
t
Thanks for reaching out, Nico. 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 that you're having trouble with the agent being stuck in an inconsistent state. Let's work through this together! Here are some steps that might help you troubleshoot and gather the necessary information: 1. Verify Agent Status: You can check the agent's current state by running
lk agent status --id <agent_id>
. If you see the status as "Deleting" or notice an error, it usually points to an internal issue. 2. Retry Deletion via CLI: Try deleting the agent again using
lk agent delete --id <agent_id>
. This will let us know if the deletion goes through or if there’s still a problem. 3. Check for Service Disruptions: It’s a good idea to visit the LiveKit Status Page to see if there are any ongoing infrastructure issues that might be affecting the agent. 4. Collect Diagnostic Information: Gathering logs can be really helpful! Use
lk agent logs --id <agent_id>
and
lk agent status
to collect details about what’s happening with the agent. This info will help pinpoint the root cause. If after trying these steps the issue still persists and you’re unable to delete the agent, please share the following details with me: • The agent ID • The output you get from
lk agent status
• Any error messages you see in the CLI • The timestamps when the issue happened Once I have this information, I’ll be able to escalate the matter to our LiveKit engineers so we can get this resolved for you as quickly as possible. Thank you for your patience—I’m here to help every step of the way! Sources: Agent deployment CLI reference | LiveKit Docs | livekit/livekit_cloud_agent.pb.go | cmd/lk/agent.go
a
unable to create agent: maximum number of agents reached (1/1) MacNicola% lk agent list Using project [agent-sterter] ┌─────────────────┬─────────┬─────────┬──────────────────────┐ │ ID │ Regions │ Version │ Deployed At │ ├─────────────────┼─────────┼─────────┼──────────────────────┤ │ CA_uq4gvF2pdq7d │ us-east │ --- │ 0001-01-01T000000Z │ └─────────────────┴─────────┴─────────┴──────────────────────┘ MacNicola% lk agent status CA_uq4gvF2pdq7d Using project [agent-sterter] Using agent [CA_2kjcjZ2hdV8x] no agents found MacNicola%
t
It looks like you're encountering an issue where the
lk agent list
command shows an agent, but the
lk agent status
command says "no agents found." This usually happens because the commands identify the target agent differently. Let’s work through this together: 1. Check Configuration: First, make sure you're in the right project directory and that the
livekit.toml
file is present. This file needs to be properly set up with the agent's ID. 2. Use Explicit Agent ID: When you run the
lk agent status
command, try specifying the agent ID directly using the
--id
flag, like this:
lk agent status --id CA_uq4gvF2pdq7d
. This helps the command find the correct agent. If you’re still having trouble after these steps, please don’t hesitate to reach out. I’m here to help you troubleshoot further and get this sorted out! Sources: Agent deployment CLI reference | LiveKit Docs | autocomplete/fish_autocomplete
a
looks like the build failed, but I am not able to remove it? """ no agents found MacNicola% lk agent status --id CA_uq4gvF2pdq7d Using project [agent-sterter] Using agent [CA_uq4gvF2pdq7d] ┌─────────────────┬─────────┬─────────┬──────────────┬────────────┬─────────┬───────────┬──────────────────────┐ │ ID │ Version │ Region │ Status │ CPU │ Mem │ Replicas │ Deployed At │ ├─────────────────┼─────────┼─────────┼──────────────┼────────────┼─────────┼───────────┼──────────────────────┤ │ CA_uq4gvF2pdq7d │ --- │ us-east │ Build Failed │ 0m / 2000m │ 0 / 4GB │ 0 / 1 / 1 │ 0001-01-01T000000Z │ """
t
It looks like the agent is currently in a "Build Failed" state, which is why it can’t be deployed or removed the usual way. Don’t worry—I’m here to help you through this! Here’s what you can do: 1. List Your Agents: Start by running
lk agent list
to check the agent ID and see its current status. 2. View Build Logs (Optional): If you want to understand why the build failed, you can take a look at the logs using
lk agent logs --id CA_uq4gvF2pdq7d --log-type build
. This will show you the Docker build logs. 3. Delete the Agent: To remove the agent, use
lk agent delete --id CA_uq4gvF2pdq7d
. Alternatively,
lk agent destroy --id CA_uq4gvF2pdq7d
works too. If you run into any trouble deleting the agent or if it still doesn’t work, please don’t hesitate to reach out. I’m happy to assist further or connect you with the LiveKit engineers to get this sorted out. Sources: autocomplete/fish_autocomplete | livekit/livekit_cloud_agent.pb.go | Log collection | LiveKit Docs | Community & Support | livekit/livekit_composite | DeepWiki | Agent deployment CLI reference | LiveKit Docs
a
amazing,
lk agent destroy --id CA_uq4gvF2pdq7d
this worked!
t
I'm so happy to hear that the issue has been resolved and the agent was successfully deleted! If you have any more questions or need a hand with anything else, please don't hesitate to reach out. I'm here to help!