actions-runner-controller: Scale Set Listener Stops Responding
Checks
- I’ve already read https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/troubleshooting-actions-runner-controller-errors and I’m sure my issue is not covered in the troubleshooting guide.
- I am using charts that are officially provided
Controller Version
0.7.0
Deployment Method
Helm
Checks
- This isn’t a question or user support case (For Q&A and community support, go to Discussions).
- I’ve read the Changelog before submitting this issue and I’m sure it’s not due to any recently-introduced backward-incompatible changes
To Reproduce
1. Install both ARC and the ScaleSet helm charts to a kubernetes cluster.
2. Run Github Actions workflows/jobs normally with a self hosted runner.
Beyond this we do not have specific steps to reproduce and would very much appreciate suggestions for how we could gather more information to trigger this bug.
Describe the bug
Symptom:
- Developers reported that jobs were pending for over 20 minutes (in the github workflow job view)
- Restarted the controller and nothing happened
- Deleted the listener and once a new listener pod starts, then new runner pods start. (Alternative we have now discovered that after about an hour, the listener will begin responding again and the logs says “refreshing token”)
Diagnostics:
- The listener stops logging
- The only association we can make to alert on is using something like this ((gha_assigned_jobs > 0) and (rate(gha_assigned_jobs[10m]) == 0)) from the metrics provided by the listener.
Another symptom I’ve noticed: When the controller pod is updated (for instance, between 0.7.0 and 0.8.0) two inconsistencies happen:
- If there are old job pods running, they will block the new listener from starting. I need to delete the pods and do a rollout restart of the controller to get the listener going
- Just updating the deployument doesn’t seem to consistently start the listener either. There is always a chance that a rollout restart is needed to get it going.
A separate instance where we observed the issue
Currently running listener gha-runner-scale-set-controller:0.7.0 No logs were being generated, had found a workflow job in a pending state (from the listener logs). 10 Runners were online but the runner group was offline when looking at our org’s action runner group settings ( url like this: https://github.com/organizations/bigcorp/settings/actions/runner-groups/9 )
Verified listener metrics had flatlined, for example:
Then the queued job being watched was assigned with no intervention. Below is the section of logs where the listener had stopped and then started working again with no intervention.
2023-12-28T17:10:14Z INFO service process batched runner scale set job messages. {"messageId": 13462, "batchSize": 4}
2023-12-28T17:10:14Z INFO service job started message received. {"RequestId": 1026947, "RunnerId": 1062477}
2023-12-28T17:10:14Z INFO service update job info for runner {"runnerName": "self-hosted-pqbsj-runner-dkmf2", "ownerName": "bigcorp", "repoName": "cc-api-orc-kt", "workflowRef": "bigcorp/github-actions-shared/.github/workflows/sql-migration-lint.yaml@refs/heads/v1", "workflowRunId": 7349734264, "jobDisplayName": "build / sql-lint / lint-migrations", "requestId": 1026947}
2023-12-28T17:10:14Z INFO KubernetesManager Created merge patch json for EphemeralRunner status update {"json": "{\"status\":{\"jobDisplayName\":\"build / sql-lint / lint-migrations\",\"jobRepositoryName\":\"bigcorp/cc-api-orc-kt\",\"jobRequestId\":1026947,\"jobWorkflowRef\":\"bigcorp/github-actions-shared/.github/workflows/sql-migration-lint.yaml@refs/heads/v1\",\"workflowRunId\":7349734264}}"}
2023-12-28T17:10:14Z INFO service job started message received. {"RequestId": 1026948, "RunnerId": 1062478}
2023-12-28T17:10:14Z INFO service update job info for runner {"runnerName": "self-hosted-pqbsj-runner-gl8pq", "ownerName": "bigcorp", "repoName": "cc-api-orc-kt", "workflowRef": "bigcorp/github-actions-shared/.github/workflows/gradle.yaml@refs/heads/v1", "workflowRunId": 7349734264, "jobDisplayName": "build / build / code build", "requestId": 1026948}
2023-12-28T17:10:14Z INFO KubernetesManager Created merge patch json for EphemeralRunner status update {"json": "{\"status\":{\"jobDisplayName\":\"build / build / code build\",\"jobRepositoryName\":\"bigcorp/cc-api-orc-kt\",\"jobRequestId\":1026948,\"jobWorkflowRef\":\"bigcorp/github-actions-shared/.github/workflows/gradle.yaml@refs/heads/v1\",\"workflowRunId\":7349734264}}"}
2023-12-28T17:10:14Z INFO service job assigned message received. {"RequestId": 1026947}
2023-12-28T17:10:14Z INFO service job assigned message received. {"RequestId": 1026948}
2023-12-28T17:10:14Z INFO auto_scaler acquiring jobs. {"request count": 0, "requestIds": "[]"}
2023-12-28T17:10:15Z INFO auto_scaler deleted message. {"messageId": 13462}
2023-12-28T17:10:15Z INFO service waiting for message...
2023-12-28T18:10:15Z INFO refreshing_client message queue token is expired during GetNextMessage, refreshing...
2023-12-28T18:10:15Z INFO refreshing token {"githubConfigUrl": "https://github.com/bigcorp"}
2023-12-28T18:10:15Z INFO getting access token for GitHub App auth {"accessTokenURL": "https://api.github.com/app/installations/43625644/access_tokens"}
2023-12-28T18:10:15Z INFO getting runner registration token {"registrationTokenURL": "https://api.github.com/orgs/bigcorp/actions/runners/registration-token"}
2023-12-28T18:10:15Z INFO getting Actions tenant URL and JWT {"registrationURL": "https://api.github.com/actions/runner-registration"}
2023-12-28T18:10:16Z INFO service process message. {"messageId": 13463, "messageType": "RunnerScaleSetJobMessages"}
2023-12-28T18:10:16Z INFO service current runner scale set statistics. {"available jobs": 26, "acquired jobs": 0, "assigned jobs": 0, "running jobs": 0, "registered runners": 10, "busy runners": 0, "idle runners": 10}
2023-12-28T18:10:16Z INFO service process batched runner scale set job messages. {"messageId": 13463, "batchSize": 1}
2023-12-28T18:10:16Z INFO service job completed message received. {"RequestId": 1026947, "Result": "succeeded", "RunnerId": 1062477, "RunnerName": "self-hosted-pqbsj-runner-dkmf2"}
2023-12-28T18:10:16Z INFO auto_scaler acquiring jobs. {"request count": 0, "requestIds": "[]"}
Describe the expected behavior
Ideally the listener would never stop responding.
Additional Context
The only additional thing we tried was using the opt out button on our github app advanced features. This was kind of a hail mary since we saw the logs related to refreshing the token.
It seems to have helped but maybe that’s just a fluke.
Controller Logs
Here's the logs from the time 10 min before through 10 min after the lister stops responding.
https://gist.github.com/jameshounshell/597358f9b0b624d1f80f98057ddddcf0
Runner Pod Logs
N/A
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 30 (1 by maintainers)
Hey @niodice,
We found the issue, and it should be fixed now. Please let us know here if you experience it again.
Hey everyone, I believe we found the root cause of this issue, and it is now fixed in 0.9.2. This was the fix: https://github.com/actions/actions-runner-controller/pull/3529
I will leave this issue opened for now until someone confirms they are not seeing these problems with the newest release ☺️
Same here with GKE
v1.29.1andgha-runner-scale-set-0.9.0We got a new error this morning…unsure what to make of it:
@angusjellis We’re on 1.27.10 in a GKE cluster. We did an upgrade from 1.26 to 1.27 while this was happening without any change in listener behavior for what it’s worth.
We are on 0.8.1 (with the LISTENER_ENTRYPOINT workaround) and I think we saw this today, one of our four listeners just stopped responding. The controller finalised and removed its remaining runner pods as they finished their jobs but didn’t produce any errors or otherwise appear to notice. About 45 mins later a node scaledown evicted the controller and it all came back to life after that.
We also saw a token refresh just before this happened, listener logs:
We have been using the current version for about a month without seeing it until today, but we are on EKS and upgraded from 1.28 to 1.29 yesterday. If it happens again I may downgrade and see if it goes away.
We’ve had a pretty huge break in the case.
It appears that the listener stopping responding is directly linked to when the token is refreshed.
In the image in yellow you can see every time the token refreshes with the log message “refreshing_client”. It appears to be reactive, in response to a failed http call, approximately happening every 60-65m. (which seems to jive with the max token lifetime of 1h for a github app) But before the outage there is no token refresh. Then 1 hour later the token refreshes and the logs begin again (and jobs start running again)
We believe we also may be seeing this; can we re-open this issue @nikola-jokic ?
In our case the logs we see are as follows: a bunch of “job assigned” messages followed by the listener computing zero new runners should be deployed, and then a token refresh a few minutes later. Perhaps related?
We are running on the scale sets
0.11.0versionI’ll send the logs a bit later. We are staying on version 0.9.0 as we are waiting for a fix that will be added in this PR.
@nikola-jokic yes, that sounds very much like it! Thanks 😃
With
ghcr.io/actions/gha-runner-scale-set-controller:0.8.3we still getonce/twice a day (k8s v1.28.5)
Hey @jameshounshell,
Is it possible that there are network interrupts causing problems? At version 0.8.0, we did add client timeouts to retriable client that could help determine if there are any network issues. Just keep in mind, we are missing metrics on the newest listener app (Will be part of 0.8.2, and to enable metrics, you can use the old listener app as described here)