When using --secret-mount option I am getting "una...
# ask-ai
b
When using --secret-mount option I am getting "unable to create agent: failed to create secret: Something went wrong while saving your secret. Please try again." but no other details, can you help me troubleshoot.
t
Thanks for reaching out, Jannik. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I can help troubleshoot the
--secret-mount
failure. I’m responding to your error: "unable to create agent: failed to create secret: Something went wrong while saving your secret. Please try again." Can you provide the following so I can narrow the cause? 1. The exact CLI command you ran (remove any sensitive values). 2. Path, filename, and size of the file you tried to mount. 3. File permissions (output of
ls -l <path>
). 4. OS and CLI version (
uname -a
and
livekit-agent --version
if available). 5. Any other secret-related flags you used (
--secrets
,
--secrets-file
, env vars). Quick checks you can run now: • Confirm the file is readable by your user and smaller than 16KB. • Ensure the filename doesn’t conflict with auto-injected secrets like
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
, or
LIVEKIT_URL
. • Try mounting a tiny test file (e.g., a 1KB text file) with the same command to see if the error reproduces. Send the requested details and results of the quick checks and I’ll suggest the next steps. Sources: Agent deployment CLI reference | LiveKit docs | Secrets management | LiveKit docs | Server-side | livekit/livekit_composite | DeepWiki | livekit/livekit_composite | DeepWiki
b
This is the command, and I now the file is present: lk agent create --project "AgentV1" --silent --secret-mount "/Users/xxxx/Work/Agent1/environment.json" Version is: lk version 2.12.2
t
Thanks — I’m looking at your
lk agent create
command and version. To troubleshoot the secret save error, please provide: 1. File size (
stat -f%z /Users/xxxx/Work/Agent1/environment.json
on macOS or
stat -c%s <file>
on Linux). 2. File permissions (
ls -l /Users/xxxx/Work/Agent1/environment.json
). 3. OS (
uname -a
). 4. Whether you used any other secret flags (
--secrets
,
--secrets-file
) or env vars when running the command. 5. Whether the filename
environment.json
might conflict with any LiveKit auto-injected names (you can try renaming to
env_test.json
as a quick test). Quick tests to run now: • Create a small test file and retry: a.
echo "test" > /tmp/lk-test.txt
b.
lk agent create --project "AgentV1" --silent --secret-mount "/tmp/lk-test.txt"
• Check file is readable by your user (try
cat /Users/xxxx/Work/Agent1/environment.json
). Share the outputs or test results and I’ll guide the next steps.
b
stat -f%s gives: 860 mac os no other secret flags is used than --secret-mount. renamed file to agent_env.json and it did not work.
t
Thanks — I’m responding to your
lk agent create --secret-mount
failure with the info you provided (macOS, 860 bytes file, lk 2.12.2, renamed file tried). Please try the following targeted checks and tell me the results: 1. Use an explicit absolute source: lk agent create --project "AgentV1" --silent --secret-mount "/Users/xxxx/Work/Agent1/agent_env.json:/etc/secret/agent_env.json" 1. Run the command with verbose output and paste any extra error lines: lk --verbose agent create --project "AgentV1" --secret-mount "/Users/xxxx/Work/Agent1/agent_env.json:/etc/secret/agent_env.json" 1. Confirm the file is readable by the CLI user: cat /Users/xxxx/Work/Agent1/agent_env.json 1. Try a minimal test file with the explicit mount to see if any file content edge-case matters: echo "test" > /tmp/lk-test.txt lk agent create --project "AgentV1" --silent --secret-mount "/tmp/lk-test.txt:/etc/secret/lk-test.txt" If the verbose output shows additional error text, paste it here. If those tests still fail, tell me the verbose logs and the exact command outputs and I’ll suggest the next steps. Sources: Secrets management | LiveKit docs | Agent deployment CLI reference | LiveKit docs