GiteaActionsStalled¶
Severity: warning. Fires when ubuntu-latest jobs have waited for 15 minutes with no online Actions runner with that label, when the exporter has not read Gitea or Prometheus has not scraped it for 15 minutes, or when any job has waited 30 minutes for a runner. Nearly every CI job in every repository runs on ubuntu-latest, so pull requests get no checks and Renovate and release pipelines stop. The runners are ephemeral pods that KEDA starts per waiting job in namespace ci of the Lima VM k3s on the Mac mini (Gitea Actions Runners on the Mac Mini), which the cluster cannot reach, so the signal comes from Gitea's side. The two pods of gitea/gitea-act-runner on hetzner-mgmt also take ubuntu-latest jobs (CI Runners). No runner online is normal while no job waits: Gitea deletes each runner when its job is done.
Labels: component: gitea-act-runner; the waiting-job rule also has labels, the job's runs-on labels joined by commas (e.g. ubuntu-latest or windows). The summary names the rule that fired.
The metrics come from the Deployment gitea/gitea-actions-exporter (components/gitea/actions-exporter/), which reads Gitea's admin API on every scrape with a read:admin token of a site admin (OpenBao clusters/hetzner-mgmt/gitea/actions-exporter, property token, through the ExternalSecret gitea/gitea-actions-exporter-token). Gitea counts a runner online when it has polled within the last minute. When the exporter cannot read Gitea, it serves only gitea_actions_scrape_success 0.
Read-only checks¶
# Is the exporter reading Gitea? 0 means it is not: its log names the error (401/403: the token)
kubectl --context admin@mgmt-cluster -n gitea get pods -l app=gitea-actions-exporter
kubectl --context admin@mgmt-cluster -n gitea logs deploy/gitea-actions-exporter --tail=20
kubectl --context admin@mgmt-cluster -n gitea get externalsecret gitea-actions-exporter-token
kubectl --context admin@mgmt-cluster get --raw /api/v1/namespaces/gitea/services/http:gitea-actions-exporter:8080/proxy/metrics
The last command reads the exporter through the API server's Service proxy, not a port-forward (rule 8). If it shows gitea_actions_scrape_success 1 while the alert fires, the exporter reads Gitea and Prometheus does not scrape it: check that case next.
# Does Prometheus scrape the exporter? An empty list means it has no target for it
PROM=/api/v1/namespaces/monitoring/services/http:monitoring-kube-prometheus-prometheus:9090/proxy
kubectl --context admin@mgmt-cluster get --raw "$PROM/api/v1/targets?state=active&scrapePool=serviceMonitor/monitoring/gitea-actions-exporter/0" \
| jq '.data.activeTargets'
# Is the job in the config Prometheus loaded, and in the operator's Secret?
kubectl --context admin@mgmt-cluster get --raw "$PROM/api/v1/status/config" \
| jq -r '.data.yaml' | grep gitea-actions-exporter
kubectl --context admin@mgmt-cluster -n monitoring get secret prometheus-monitoring-kube-prometheus-prometheus \
-o jsonpath='{.data.prometheus\.yaml\.gz}' | base64 -d | gunzip | grep gitea-actions-exporter
# Does the pod's mounted copy match the Secret? The two hashes must be equal
kubectl --context admin@mgmt-cluster -n monitoring get secret prometheus-monitoring-kube-prometheus-prometheus \
-o jsonpath='{.data.prometheus\.yaml\.gz}' | base64 -d | sha256sum
kubectl --context admin@mgmt-cluster -n monitoring exec prometheus-monitoring-kube-prometheus-prometheus-0 -c config-reloader -- \
sha256sum /etc/prometheus/config/..data/prometheus.yaml.gz
$PROM is the Service proxy path from Read Alertmanager and Prometheus on a cluster. The checks of this second block come from incident 2026-11-15 (steps 4–7); they were not run again for this page.
Then Gitea's own view: Site Administration → Actions → Runners (the Mac mini's runners with a job, and the two hetzner-mgmt runners), and the waiting job's repository → Actions. If Gitea itself is down, its own alerts lead; this one clears when Gitea is back.
Read it by case:
ubuntu-latestjobs wait and no runner is online. KEDA starts no pod: the Mac mini, the VM, k3s or KEDA is down, KEDA's token is refused, or the ScaledJob is paused. The operational agent reads namespaceciwithkubectl --context mac-mini -n ci:get scaledjob,jobs,pods, andlogs job/<name> -c act-runnerfor a pod that starts but does not register. A person on the Mac mini checks the VM withsudo launchctl print system/io.lima-vm.daemon.k3s | grep stateandsudo -iu agent-ops /opt/homebrew/bin/limactl list k3s, and KEDA withk -n keda logs deploy/keda-operator | grep gitea-act-runner(each poll, and a token or URL error; thekalias is in Install).- The exporter cannot read Gitea. Its log names the HTTP error: 401 or 403 is the token, a connection error is Gitea or the network.
- The exporter reads Gitea, but Prometheus does not scrape it. The exporter serves
gitea_actions_scrape_success 1, and Prometheus has no target inserviceMonitor/monitoring/gitea-actions-exporter/0. The alert's summary still says the exporter "cannot read Gitea"; its description adds "or Prometheus has not scraped it". prometheus-operator writes a job for every ServiceMonitor the Prometheus CR selects into the Secretmonitoring/prometheus-monitoring-kube-prometheus-prometheus, the kubelet keeps the pod's mounted copy current, and theconfig-reloadercontainer reloads Prometheus when that copy changes. Where the job is:- Not in the Secret: the Prometheus CR does not select the ServiceMonitor, or the operator rejected it. The operator does not compare a ServiceMonitor with its Service, so a selector or port mismatch still writes a job (the last case below). Read the CR's
serviceMonitorSelectorandserviceMonitorNamespaceSelectorwithkubectl --context admin@mgmt-cluster -n monitoring get prometheus -o yaml; both should be empty, which selects every ServiceMonitor (serviceMonitorSelectorNilUsesHelmValues: falseincomponents/prometheus-stack/helmrelease.yaml). Then look for a rejected ServiceMonitor withkubectl --context admin@mgmt-cluster -n monitoring logs deploy/monitoring-kube-prometheus-operator | grep gitea-actions-exporter. These two commands were not run for this page; the Deployment name follows the chart'smonitoring-kube-prometheusprefix that the Secret's name also carries. - In the Secret, not in the loaded config, hashes differ: the pod's mounted copy is stale. On 2026-11-15 the kubelet on worker-2 kept a copy from 2026-11-07 (incident).
- In the loaded config, but no target or the target is down: the ServiceMonitor finds no endpoint; compare it with the Service and its EndpointSlice.
- Not in the Secret: the Prometheus CR does not select the ServiceMonitor, or the operator rejected it. The operator does not compare a ServiceMonitor with its Service, so a selector or port mismatch still writes a job (the last case below). Read the CR's
- A job has waited 30 minutes. Every runner with its label is busy for that long (a backlog: below), or the job's
runs-onmatches no runner that is there: a typo,terraformwhile the on-demand Terraform runner is at zero replicas (CI Runners), orwindowsormacos-arm64while that runner is offline. Gitea cancels a job that has waited 24 hours (ABANDONED_JOB_TIMEOUT).
The wait is counted from the first exporter scrape that saw the job queued, so it restarts when the exporter restarts.
This rule has no for: it fires as soon as the oldest wait passes 30 minutes and resolves as soon as that job starts. During a backlog it can fire and resolve several times while the queue drains; on 2026-11-16 it fired twice, for 3 minutes each (incident).
A backlog, or a stuck runner¶
At most four ubuntu-latest jobs run at once: the two pods of gitea/gitea-act-runner on hetzner-mgmt (replicas: 2, capacity: 1 each since #2931, One job per pod) and the two ephemeral pods on the Mac mini (maxReplicaCount: 2). ubuntu-24.04-arm jobs run only on the Mac mini's two pods, which also take ubuntu-latest jobs. More jobs waiting than that is a backlog, not a fault, when all of these hold:
- every online runner with the label is
busy; - the number of jobs in progress matches the number of busy runners;
- on the Mac mini, Jobs start and complete;
- the exporter's
gitea_actions_queued_jobsfalls over the next minutes.
A runner that is online but not busy while jobs wait, Jobs that do not complete, or a queue that does not fall points to a stuck runner: read the case above that fits.
# A token of a site admin with scope read:admin only, like the exporter's
H="Authorization: token $GITEA_ADMIN_TOKEN"
# Every online runner busy? One line per runner: name, status, busy, labels
curl -s -H "$H" "$GITEA_URL/api/v1/admin/actions/runners?limit=50" \
| jq -r '.runners[] | [.name, .status, .busy, ([.labels[].name] | join(","))] | @tsv'
# Jobs in progress: the count matches the busy runners
curl -s -H "$H" "$GITEA_URL/api/v1/admin/actions/jobs?status=in_progress&limit=50" | jq '.total_count'
# Jobs waiting for a runner: which repositories and runs make the queue
curl -s -H "$H" "$GITEA_URL/api/v1/admin/actions/jobs?status=queued&limit=50" \
| jq -r '.total_count, (.jobs[] | [.run_url, .name, (.labels | join(",")), .created_at] | @tsv)'
# On the Mac mini: Jobs that start and complete
kubectl --context mac-mini -n ci get jobs,pods
# The queue over the next minutes: read the exporter again every minute or two
kubectl --context admin@mgmt-cluster get --raw /api/v1/namespaces/gitea/services/http:gitea-actions-exporter:8080/proxy/metrics \
| grep -E '^gitea_actions_(queued_jobs|oldest_queued_job_seconds|runners)'
In the jobs API, status=queued lists the jobs waiting for a runner (Gitea's StatusWaiting, the list the exporter and KEDA read); status=waiting lists the jobs still blocked on the jobs they need (components/gitea/actions-exporter/gitea-actions-exporter.py, ADR 0022). A page holds at most 50 jobs and total_count counts them all. A job's run_url names its repository and run.
These checks were run for incident 2026-11-16 (steps 2, 4–6 and 8–10), which read the queue with status=waiting, and for incident 2026-11-18 (steps 3–5), which ran the admin-API checks above: the runners, status=in_progress and status=queued. The curl and jq lines above were run as written later that day and work: each job carries run_url, the API URL of its run ($GITEA_URL/api/v1/repos/<owner>/<repo>/actions/runs/<id>); html_url is the job's page in the web UI.
Roll forward¶
- Mac mini or VM down: an agent cannot start it. Raise an attention item for the owner naming what the checks showed; the steps are in The k3s VM on the Mac Mini → Operating.
- Runner pods failing in the VM: fix the cause in Git (
cluster/mac-mini/ci/overlay/orcomponents/keda/); Flux in the VM applies it. - KEDA's token refused: the owner replaces the Secret
gitea-queued-jobs-tokenin namespaceci(Install, step 2). - Exporter token refused: an agent cannot create the token. Raise an attention item for the owner: as a site admin, create an access token with scope
read:adminonly, and write it withbao kv put -mount=clusters hetzner-mgmt/gitea/actions-exporter token=<token>, thenkubectl --context admin@mgmt-cluster -n gitea annotate externalsecret gitea-actions-exporter-token force-sync=$(date +%s) --overwriteandkubectl --context admin@mgmt-cluster -n gitea rollout restart deploy/gitea-actions-exporter. -
Prometheus's mounted config is stale: no Git change helps, because Git and the Secret are already right. Recreate the Prometheus pod so it mounts the current Secret. This is a write (log it, rule 2). The StatefulSet recreates the pod and its PVC stays, so the stored metrics are kept, but Prometheus scrapes nothing and evaluates no rule until the new pod is up (about 40 s on 2026-11-15), and the
fortimers of pending and firing alerts restart. First check that the nodes have memory headroom for the new pod, which can start on another node (Prometheus used 865Mi on 2026-11-15), and that no Kustomization or HelmRelease is failing:q='(1 - node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * on(instance) group_left(nodename) node_uname_info' kubectl --context admin@mgmt-cluster get --raw "$PROM/api/v1/query?query=$(jq -rn --arg q "$q" '$q|@uri')" \ | jq -r '.data.result[] | [.metric.nodename, .value[1]] | @tsv' flux --context admin@mgmt-cluster get kustomizations -A --status-selector ready=false flux --context admin@mgmt-cluster get helmreleases -A --status-selector ready=false kubectl --context admin@mgmt-cluster -n monitoring delete pod prometheus-monitoring-kube-prometheus-prometheus-0 --wait=true --timeout=300s kubectl --context admin@mgmt-cluster -n monitoring wait pod prometheus-monitoring-kube-prometheus-prometheus-0 --for=condition=Ready --timeout=300sThen run the checks above again: the hashes match, the job is in the loaded config, and the target is
up. Alertmanager resolved the alert 32 s after the first scrape on 2026-11-15. Recreating the pod fixes this pod only; why the kubelet kept a stale copy is open in #3255. - Backlog, every runner busy: nothing is broken, and no write helps. Watch until the oldest job starts and the alert resolves, and record the queue in the incident: the repositories, runs and jobs from the checks above. How many jobs run at once is the owner's decision (#3286), which waits on the measurement in #3285. Never raisemaxReplicaCount,replicasorcapacityduring an incident: each is held by a memory decision of the owner (#2898, One job per pod; the Mac mini's Operating, "Concurrency"). - Job waits on a label no runner has: tell the repository's owner; nothing to fix on the platform. A Terraform job waits for the owner to scale the Terraform runner up.
Roll back¶
If the alert started with a change to the runners or the exporter, revert that pull request.