Skip to main content

Why is my GitHub Actions deployment failing?

4 min read

Summary​

A workflow that targets a SonicInfra GitHub Action Runner Set can fail for reasons that have nothing to do with your application code — the runner set itself isn't ready, the job never matches a runner, or it runs fine but can't reach your deploy target. Work through these roughly in order: is a runner available, did the job land on it, can it reach where it's deploying to.

Common causes​

  • The runner set isn't Ready, or has no active runners yet to pick up the job.
  • runs-on doesn't exactly match the runner set's Name.
  • The runner set's GitHub Org doesn't match the org the workflow's repo lives in.
  • The runner VM's image or size can't boot.
  • The job reaches the runner fine, but the deploy step's SSH connection to the target instance fails.

How to resolve it​

Check the runner set's status. sonic <runner-set-resource> get <name> (the resource id is gha-runner-sets) returns its current state:

sonic gha-runner-sets get ci-runners

Look at status.ready (boolean) and status.activeRunners (count of runner pods currently up). If you just created or resized the set, give it a couple of minutes — the runner VMs need to boot and register with GitHub before jobs pick up. If creation itself failed (bad image, invalid org, etc.), the operation records an error rather than the set ever going Ready:

sonic wait-for <operation-id>

Check runs-on against the exact runner set Name. Unlike traditional self-hosted runner labels, a gha-runner-set is targeted by a single exact scale-set name, not a list of labels:

jobs:
deploy:
runs-on: ci-runners # must equal the runner set's Name field exactly

A typo or stale name here just leaves the job queued forever — GitHub Actions Runner Controller has nothing to route it to, and there's no error to surface.

Check the runner set's GitHub Org. The runner set registers against https://github.com/<githubOrg> — if that org doesn't match the org (or user) the workflow's repo belongs to, GitHub never offers the runner to that repo's jobs, and again the job just sits queued rather than failing loudly.

Check the VM image and size. The runner set's vm.image field takes either a standard container disk image (e.g. ubuntu:22.04, fedora) or a prebuilt-{name} custom image. A typo'd or nonexistent image tag means the boot disk import fails and the VM never comes up — status.activeRunners will stay at 0 well past the normal couple-minute boot window. Undersized vm.cores / vm.memory won't stop the runner from registering, but can cause the job itself to fail or get OOM-killed partway through the build.

Check the deploy step's SSH access. If your workflow's last step SSHes into a compute instance to deploy (as in Deploy your first compute instance), the instance needs the key the runner is using — either baked in at creation via cloudInit.ssh_authorized_keys, or added after the fact:

sonic ssh-copy-id web-01

Runner VMs sit on SonicInfra's private network already, so sonic ssh/plain SSH reaches the instance the same way it does from your laptop — no public IP or extra network config needed, so a failure here is almost always a missing key rather than a networking issue.

Still stuck?​

Search the Knowledge Base for your exact error, or reach out from your dashboard's support panel.