when `lk agent create` i got errors ```Created age...
# ask-ai
b
when
lk agent create
i got errors
Copy code
Created agent with ID [CA_xxxxx]
[+] Building 0.8s (3/3) FINISHED
 => [internal] load remote build context                                                      0.1s
 => copy /context /                                                                           0.0s
 => ERROR [internal] load metadata for docker.io/library/python:3.11.6-slim                   0.1s
------
 > [internal] load metadata for docker.io/library/python:3.11.6-slim:
------
build failed for iad.ocir.io/axyci3pr8vxm/production-cloud-agents:p-4jc2x7232ty-ca-nr9nbbadoguy-v20250925000745: failed to solve: python:3.11.6-slim: failed to resolve source metadata for docker.io/library/python:3.11.6-slim: unexpected status from HEAD request to <https://registry-1.docker.io/v2/library/python/manifests/3.11.6-slim>: 401 Unauthorized
t
Thanks for reaching out, Rongrong. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
b
what does this error mean and how to fix it?
t
It looks like the error you ran into when running
lk agent create
might be related to authentication or permissions, rather than the Docker image itself. No worries—let’s walk through some steps together to get this sorted out: 1. Verify Agent Hosting Permissions: First, please make sure that agent hosting is enabled for your LiveKit Cloud project. If it’s not, you might need to join the beta program by signing up here. 2. Check Authentication and Project Configuration: Try running
lk cloud auth
to authenticate yourself. Then, use
lk project list
and
lk project set-default "<project-name>"
to confirm you’re working within the right project. 3. Inspect the Build Context: It’s a good idea to check that your current directory isn’t excluding important files like
requirements.txt
or
pyproject.toml
through
.dockerignore
or
.gitignore
. 4. Check for Existing Configuration: If there’s a
livekit.toml
file already in your folder, it could be causing a conflict when creating a new agent. Try removing or renaming it to see if that helps. 5. Review Build Logs: If you’re still having trouble after these steps, you can dig deeper by running
lk agent logs --id <agent_id> --log-type=build
to check the build logs. Please feel free to reach out if you’d like me to guide you through any of these steps or if you have any other questions. I’m here to help! Sources: cmd/lk/agent.go | Deploying to production | LiveKit Docs | Agent deployment CLI reference | LiveKit Docs | Builds and Dockerfiles | LiveKit Docs | examples/Dockerfile-example
It looks like the LiveKit CLI is having trouble accessing the Docker image
python:3.11.6-slim
because of an unauthorized status (401). This usually points to an authentication, permissions, or project configuration hiccup in LiveKit Cloud, rather than an issue with the Docker image itself. Here are some steps that can help you get this sorted out: 1. Make Sure Agent Hosting is Enabled: If you haven’t enabled agent hosting for your LiveKit Cloud project yet, you can sign up for the beta program right here. 2. Double-Check Authentication and Project Settings: Try running
lk cloud auth
to authenticate. Then, use
lk project list
and
lk project set-default "<project-name>"
to confirm that you’re working within the correct project. 3. Look Out for Existing Configuration: If you’re creating a new agent, make sure there isn’t a
livekit.toml
file lingering in your working directory that might cause conflicts. 4. Validate Your Build Context: Check that your working directory includes all the necessary files like
requirements.txt
,
pyproject.toml
, and your agent script. Also, ensure these files aren’t being accidentally ignored by
.dockerignore
or
.gitignore
. 5. Take a Peek at the Logs: If things still aren’t working, you can run
lk agent logs --id <agent_id> --log-type=build
to get more detailed info that might help pinpoint the issue. Feel free to reach out if you want me to walk you through any of these steps or if you have any other questions. I’m here to help!
b
tried all these still error
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!