This seems like it's going to be a dumb issue that...
# agents
m
This seems like it's going to be a dumb issue that's super easy to fix, but i can't figure it out haha I'm trying to set up a github action to auto-deploy my agent to livekit cloud whenever I push to a branch. I was on Render previously and am wanting to move to Livekit Cloud I'm trying to use an action very similar to this one from the Readme for the action. I already have an agent deployed that I did manually, so I should just need to redeploy it. The issue is that I keep seeing this error message, no matter what I do:
Copy code
{
  "level": "error",
  "ts": 1758859541.90502,
  "caller": "build/main.go:270",
  "msg": "Failed to deploy agent",
  "error": "twirp error internal: secret value cannot be empty",
  "stacktrace": "main.deployAgent\n\t/build/main.go:270\nmain.main\n\t/build/main.go:151\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283"
}
I'll put some more info in the thread
Here is the full action file I'm using:
Copy code
name: Deploy to Staging

on:
  push:
    branches:
      - staging  # Triggers when pushing to staging branch

jobs:
  deploy-staging:
    runs-on: blacksmith-4vcpu-ubuntu-2404  # Using Blacksmith runner
    environment: staging
    
    concurrency:
      group: ${{ github.workflow }}-staging
      cancel-in-progress: true
    
    permissions:
      contents: write
      pull-requests: write
      actions: read
    
    steps:
      - uses: actions/checkout@v4

      - name: Setup staging config
        run: cp livekit.staging.toml livekit.toml
        
      - name: Deploy LiveKit Cloud Agent
        uses: livekit/deploy-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
          LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
          LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }}
          AZURE_OPENAI_API_KEY_EAST_US_2: ${{ secrets.AZURE_OPENAI_API_KEY_EAST_US_2 }}
          AZURE_SPEECH_KEY: ${{ secrets.AZURE_SPEECH_KEY }}
          AZURE_SPEECH_REGION: ${{ secrets.AZURE_SPEECH_REGION }}
          CARTESIA_API_KEY: ${{ secrets.CARTESIA_API_KEY }}
          CEREBRAS_API_KEY: ${{ secrets.CEREBRAS_API_KEY }}
          DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
          ELEVEN_API_KEY: ${{ secrets.ELEVEN_API_KEY }}
          GCP_VERTEX_AI_ACCESS_CREDENTIALS_BASE64: ${{ secrets.GCP_VERTEX_AI_ACCESS_CREDENTIALS_BASE64 }}
          GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
          RIME_API_KEY: ${{ secrets.RIME_API_KEY }}
          TAVUS_API_KEY: ${{ secrets.TAVUS_API_KEY }}
          TELNYX_API_KEY: ${{ secrets.TELNYX_API_KEY }}
          HUGGING_FACE_API_KEY: ${{ secrets.HUGGING_FACE_API_KEY }}
          LLAMA_API_KEY: ${{ secrets.LLAMA_API_KEY }}
          REPLAY_BASE_URL: ${{ secrets.REPLAY_BASE_URL }}
        with:
          OPERATION: deploy
          WORKING_DIRECTORY: .
          
      - name: Deployment Success
        run: |
          echo "✅ Agent successfully deployed to staging!"
and here is my
livekit.staging.toml
file:
Copy code
[project]
  subdomain = "replay-testing-pbpkwgih"

[agent]
  id = "CA_wr3Swv3sa33v"
  cpu = "4"
  memory = "16384"
  replicas = 1
  max_replicas = 10
Here's the full output of the
Deploy Livekit Cloud Agent
step from the action file:
Copy code
Run livekit/deploy-action@main
Run docker run --rm \
Unable to find image 'livekit/cloud-agents-github-plugin:v202' locally
v202: Pulling from livekit/cloud-agents-github-plugin
1b283043fffc: Pulling fs layer
a00d304b7da8: Pulling fs layer
ea5f782fc1c1: Pulling fs layer
a00d304b7da8: Verifying Checksum
a00d304b7da8: Download complete
ea5f782fc1c1: Verifying Checksum
ea5f782fc1c1: Download complete
1b283043fffc: Verifying Checksum
1b283043fffc: Download complete
1b283043fffc: Pull complete
a00d304b7da8: Pull complete
ea5f782fc1c1: Pull complete
Digest: sha256:d233c8e101e4314fa402165b63450f83800515ce61cf7a0f78aab20f7752db10
Status: Downloaded newer image for livekit/cloud-agents-github-plugin:v202
{"level":"info","ts":1758859541.2376797,"caller":"build/main.go:54","msg":"Running in","path":"."}
{"level":"info","ts":1758859541.2377183,"caller":"build/main.go:58","msg":"Using agent IDs from INPUT_AGENT_IDS","agentIds":[""]}
{"level":"info","ts":1758859541.2377253,"caller":"build/main.go:84","msg":"Loading secret","secret":"LIST"}
{"level":"debug","ts":1758859541.237747,"logger":"cloud-agents-github-plugin","caller":"build/config.go:279","msg":"loading livekit.toml file"}
{"level":"error","ts":1758859541.90502,"caller":"build/main.go:270","msg":"Failed to deploy agent","error":"twirp error internal: secret value cannot be empty","stacktrace":"main.deployAgent\n\t/build/main.go:270\nmain.main\n\t/build/main.go:151\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283"}
One other thing i notice that's weird is this line:
Copy code
{
  "level": "info",
  "ts": 1758859541.2377183,
  "caller": "build/main.go:58",
  "msg": "Using agent IDs from INPUT_AGENT_IDS",
  "agentIds": [
    ""
  ]
}
If you look at my TOML file (above) it shows that I have an agent id specified, so I'm not sure why this log is showing an empty string
I can see that the issue is coming from the info log is coming from this line of code in the action repo, I just can't figure out why I'm seeing it
I've tried to use the
SECRET_LIST
method in the GH action, but that gave the same issue It seems it's related to that though because of this line:
Copy code
{
  "level": "info",
  "ts": 1758859541.2377253,
  "caller": "build/main.go:84",
  "msg": "Loading secret",
  "secret": "LIST"
}
Although if you look at my action code, there is no secret named
LIST
, so i don't know why I'm even seeing that log
@refined-appointment-81829 or @jolly-air-155, any initial thoughts on this?
r
Last I checked deploying agent from github action is not supported yet. Let me check if that is still the case.
m
Oh haha I found this but maybe I was jumping the gun: https://github.com/livekit/deploy-action
r
Ok, I will verify. I know team has been working on it but I have not been tracking the feature status.
👌 1
e
hey there, you need to set up the variable secret list using the
SECRET_LIST
env var, otherwise the deploy-action doesn't know what to include. should be something like:
Copy code
env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
          LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
          LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }}
          SECRET_LIST: SECRET_NAME=${{ SECRET_VALUE }},SECRET_NAME_2=${{ SECRET_VALUE_2 }}
the SECRET_VALUE and SECRET_VALUE_2 need to be set as env or repo secrets in the repo Settings
m
Hey @echoing-kitchen-90064! That improved it a little bit. So now, my action yml is this:
Copy code
name: Deploy to Staging

on:
  push:
    branches:
      - staging # Triggers when pushing to staging branch

jobs:
  deploy-staging:
    runs-on: blacksmith-4vcpu-ubuntu-2404 # Using Blacksmith runner
    environment: staging

    concurrency:
      group: ${{ github.workflow }}-staging
      cancel-in-progress: true

    permissions:
      contents: write
      pull-requests: write
      actions: read

    steps:
      - uses: actions/checkout@v4

      - name: Setup staging config
        run: cp livekit.staging.toml livekit.toml

      - name: Deploy LiveKit Cloud Agent
        uses: livekit/deploy-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          LIVEKIT_URL: ${{ secrets.LIVEKIT_URL }}
          LIVEKIT_API_KEY: ${{ secrets.LIVEKIT_API_KEY }}
          LIVEKIT_API_SECRET: ${{ secrets.LIVEKIT_API_SECRET }}
          SECRET_LIST: AZURE_OPENAI_API_KEY_EAST_US_2=${{ secrets.AZURE_OPENAI_API_KEY_EAST_US_2 }}, AZURE_SPEECH_KEY=${{ secrets.AZURE_SPEECH_KEY }}, AZURE_SPEECH_REGION=${{ secrets.AZURE_SPEECH_REGION }}, CARTESIA_API_KEY=${{ secrets.CARTESIA_API_KEY }}, CEREBRAS_API_KEY=${{ secrets.CEREBRAS_API_KEY }}, DEEPGRAM_API_KEY=${{ secrets.DEEPGRAM_API_KEY }}, ELEVEN_API_KEY=${{ secrets.ELEVEN_API_KEY }}, GCP_VERTEX_AI_ACCESS_CREDENTIALS_BASE64=${{ secrets.GCP_VERTEX_AI_ACCESS_CREDENTIALS_BASE64 }}, GOOGLE_APPLICATION_CREDENTIALS=${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}, OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}, POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}, RIME_API_KEY=${{ secrets.RIME_API_KEY }}, TAVUS_API_KEY=${{ secrets.TAVUS_API_KEY }}, TELNYX_API_KEY=${{ secrets.TELNYX_API_KEY }}, HUGGING_FACE_API_KEY=${{ secrets.HUGGING_FACE_API_KEY }}, LLAMA_API_KEY=${{ secrets.LLAMA_API_KEY }}, REPLAY_BASE_URL=${{ secrets.REPLAY_BASE_URL }}
        with:
          OPERATION: deploy
          WORKING_DIRECTORY: .

      - name: Deployment Success
        run: |
          echo "✅ Agent successfully deployed to staging!"
And now I'm getting this error:
Copy code
{
  "level": "error",
  "ts": 1759266012.4024413,
  "caller": "build/main.go:270",
  "msg": "Failed to deploy agent",
  "error": "twirp error internal: failed to save agent",
  "stacktrace": "main.deployAgent\n\t/build/main.go:270\nmain.main\n\t/build/main.go:151\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283"
}
Here's the full stack trace for that step:
Copy code
Run livekit/deploy-action@main
Run docker run --rm \
Unable to find image 'livekit/cloud-agents-github-plugin:v202' locally
v202: Pulling from livekit/cloud-agents-github-plugin
1b283043fffc: Pulling fs layer
a00d304b7da8: Pulling fs layer
ea5f782fc1c1: Pulling fs layer
a00d304b7da8: Verifying Checksum
a00d304b7da8: Download complete
ea5f782fc1c1: Verifying Checksum
ea5f782fc1c1: Download complete
1b283043fffc: Verifying Checksum
1b283043fffc: Download complete
1b283043fffc: Pull complete
a00d304b7da8: Pull complete
ea5f782fc1c1: Pull complete
Digest: sha256:d233c8e101e4314fa402165b63450f83800515ce61cf7a0f78aab20f7752db10
Status: Downloaded newer image for livekit/cloud-agents-github-plugin:v202
{"level":"info","ts":1759266006.7441866,"caller":"build/main.go:54","msg":"Running in","path":"."}
{"level":"info","ts":1759266006.7442446,"caller":"build/main.go:58","msg":"Using agent IDs from INPUT_AGENT_IDS","agentIds":[""]}
{"level":"info","ts":1759266006.744254,"caller":"build/main.go:84","msg":"Loading secret","secret":"LIST"}
{"level":"info","ts":1759266006.7442687,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":"AZURE_OPENAI_API_KEY_EAST_US_2"}
{"level":"info","ts":1759266006.7442777,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" AZURE_SPEECH_KEY"}
{"level":"info","ts":1759266006.7442825,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" AZURE_SPEECH_REGION"}
{"level":"info","ts":1759266006.744287,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" CARTESIA_API_KEY"}
{"level":"info","ts":1759266006.7442918,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" CEREBRAS_API_KEY"}
{"level":"info","ts":1759266006.7442956,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" DEEPGRAM_API_KEY"}
{"level":"info","ts":1759266006.7443037,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" ELEVEN_API_KEY"}
{"level":"info","ts":1759266006.7443082,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" GCP_VERTEX_AI_ACCESS_CREDENTIALS_BASE64"}
{"level":"info","ts":1759266006.7443216,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" GOOGLE_APPLICATION_CREDENTIALS"}
{"level":"info","ts":1759266006.7443323,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" OPENAI_API_KEY"}
{"level":"info","ts":1759266006.7443404,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" POSTHOG_API_KEY"}
{"level":"info","ts":1759266006.7443492,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" RIME_API_KEY"}
{"level":"info","ts":1759266006.7443535,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" TAVUS_API_KEY"}
{"level":"info","ts":1759266006.7443736,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" TELNYX_API_KEY"}
{"level":"info","ts":1759266006.744379,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" HUGGING_FACE_API_KEY"}
{"level":"info","ts":1759266006.744384,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" LLAMA_API_KEY"}
{"level":"info","ts":1759266006.7443917,"caller":"build/main.go:126","msg":"Loading secret from SECRET_LIST","secret":" REPLAY_BASE_URL"}
{"level":"debug","ts":1759266006.744667,"logger":"cloud-agents-github-plugin","caller":"build/config.go:279","msg":"loading livekit.toml file"}
{"level":"error","ts":1759266012.4024413,"caller":"build/main.go:270","msg":"Failed to deploy agent","error":"twirp error internal: failed to save agent","stacktrace":"main.deployAgent\n\t/build/main.go:270\nmain.main\n\t/build/main.go:151\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283"}
Error: Process completed with exit code 1.
0s
"Failed to save agent" doesn't give me a ton to go off, but do you have any thoughts?
e
hmm, whats your agent id or project id?
m
Project is
p_4os609oe5xp
Agent is
CA_wr3Swv3sa33v
I've deployed manually using the Livekit CLI before, if that gives you any more info!
e
oh ha, this is a bug on our end in the deploy-action, but you can fix it as well until we get a change out, looks like all the secret names have a leading-space. can you try removing the spaces between the csv list?
m
She works! Thanks @echoing-kitchen-90064!
🙌 1
e
heya @melodic-arm-17634 there is a new deploy-action (the first) release you should point to instead of main https://github.com/livekit/deploy-action/releases/tag/v0.0.203
m
Sweet thanks, I'll make that update in my action!