livekit-cli icon indicating copy to clipboard operation
livekit-cli copied to clipboard

Cannot create agent when `.env` contains empty vars

Open korya opened this issue 5 months ago • 5 comments

Creating agent with lk agent create fails when .env contains an empty env var (a var with empty value).

The error is twirp error internal: failed to convert secrets

A sample .env file to reproduce:

FOO=1
BAR=
BAZ=3

Here is the full log:

❯ lk agent create --verbose --secrets-file .env.lk
2025-09-09T23:43:59.521-0400	DEBUG	lk	config/livekit.go:91	loading livekit.toml file
Using project [test]
2025-09-09T23:44:00.809-0400	DEBUG	lk	lk/agent.go:363	Creating agent	{"working-dir": "."}
Using agent configuration [livekit.toml]
Creating new agent
Using secrets file [.env.lk]
Detected project type [python.uv]
Using existing Dockerfile
twirp error internal: failed to convert secrets

korya avatar Sep 10 '25 03:09 korya

Changing the .env file to

FOO=1
BAR=2
BAZ=3

solves the problem.

korya avatar Sep 10 '25 03:09 korya

This is an error on the service side, not on the CLI. Will log the issue in appropriate place. cc @yoonsio

rektdeckard avatar Sep 10 '25 21:09 rektdeckard

Thanks!

I would argue that the issue should stay open until it is fixed. Unless it is a nofix.

By the end of the day, the lk tool fails. For me as the end user, it does not matter if it is a server side error or a client side. My experience is the Livekit agents tool fails as a whole.

korya avatar Sep 11 '25 02:09 korya

Also, is the service side open source? If not, is there any ETA on this issue?

korya avatar Sep 11 '25 02:09 korya

@korya no, the service is closed-source. I'm happy to leave it open as a placeholder until we resolve on our end.

rektdeckard avatar Sep 11 '25 19:09 rektdeckard