-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listener registration failing with RunnerScaleSetNotFoundException #3935
Comments
Hello! Thank you for filing an issue. The maintainers will triage your issue shortly. In the meantime, please take a look at the troubleshooting guide for bug reports. If this is a feature request, please review our contribution guidelines. |
@nikola-jokic following from the problems we saw a few weeks ago, could this be an issue on the Github API side? |
Hey @tomhaynes, It seems like the scale set has been removed at |
Hi thanks for the response @nikola-jokic, I'm perhaps being stupid but where do you see that timestamp? This is a development cluster, and its shutdown at midnight 2025-02-19T00:00:00Z. I did wonder if perhaps its a race condition between the controller shutting down, and it not correctly cleaning up the various CRDs that it controls? We are also seeing this error now:
Uninstalling a specific gha-runner-scale-set chart, cleaning up all associated CRDs and reinstalling does appear to resolve the problem for that runner. Are there any logs to look out for in the controller that might indicate a non-graceful shutdown? |
We looked into traces on the back-end side to understand what is going on. It is likely the race condition. If the controller shuts down without having enough time to clean up the environment, it can cause issues like this. As for the log, this is also tricky. Basically, you would have to inspect the log and see that some steps that should be taken are missing. Having said that, it would be a good idea to log as soon as the shutdown is received, so you can spot these issues by checking logs below the termination mark. This solution cannot be perfect, especially when the controller is stopped without any graceful termination period, but it would help to diagnose issues with the cleanup process. |
We've got slightly closer possibly with one of the errors. A runnerset is throwing this error:
And I can see that the "Runner scale set" is missing when I look at the repository in Github UI. What would have removed that runner set on the github side? Could we raise a feature request to have the autoscalingrunnerset recreate it when this happens? |
could it be related to this? actions/runner#756 |
we've worked out a semi unpleasant way to force re-registration:
.. which at least avoids the finalizer hell of helm uninstalls. It'd be great to understand what causes the runner sets to disappear on the Github repo side? Also is there any way to request an API to list the runner sets on the repo? I saw it was raised here #2990 and the raiser was directed to the community page.. I tried and failed to see whether it has been requested there... |
So the deletion probably occured inside the autoscaling runner set controller. The shell script you just wrote forces the controller to think this is a new installation and re-creates resources properly, removing old resources and starting from scratch. As for the API documentation, we did talk about documenting scale sets APIs, but not just yet. There are some improvements we want to do, and some of them would be considered as breaking changes. |
solution proposed by @tomhaynes also worked for me as I was facing the exact same issue, thanks a lot |
Hi @nikola-jokic we've hit this issue quite a lot this morning. I've attached logs from an example listener, and the controller from shutdown time on Friday evening, and startup this morning. I can't see anything particularly relevant in them, mind. The controller does not seem to log anything at all at the point that it is shutdown. Could you please answer the following:
|
Hey @tomhaynes, Just to confirm I understood correctly, you removed the installation on Friday along with the controller, and you re-installed it this morning? To answer your questions, here is the area that is responsible for the cleanup. Basically, we uninstall the listener. Then we uninstall the ephemeral runner set which can take some time depending on the number of runners that are online. Once we are finished, we delete the scale set. At that point, the cleanup is successful. To answer the second question, I would first need to understand how the environment is shut down. I think probably there is the root of the issue, so please help me understand the shutdown steps. You are right, the lifetime of the listener must be shorter than the lifetime of the controller. Please help me understand the shutdown, so I can try to reproduce it properly. |
Hi @nikola-jokic thanks for the quick reply - we don't remove the installation / any CRDs, we just gracefully terminate the Kubernetes worker nodes i.e. shutdown the pods via SIGTERM. The entire cluster is shutdown at the same time, so there are no guarantees around which GHA pods shutdown first. The next day / week the environment powers back up with the CRDs unchanged. We've not changed this design for a long time - we used to use the summerwinds controllers but migrated over to arc in ~March last year. |
hmm the controller's helm chart doesn't support lifecycle hooks, I could add this in but if this was the issue surely others would be seeing the same.. |
@nikola-jokic things have started fairly healthy this morning - given these issues seem to largely happen after the weekend, when our dev environments have been down for a few days, it seems highly probable that it is not some kind of shutdown race condition, but rather some kind of expiry process happening in the Github backend .. if I gave you a specific runner set for a specific repo do you have an api audit log that would show what removed it? |
Hey @tomhaynes, yes please! It might be something related to session expiration, so please send the scale sets that are misbehaving, so we can see what wen't wrong there. Thank you for providing everything I'm asking for in a timely manner! |
great thanks @nikola-jokic, so over the weekend on this repo the following runner scale set disappeared (redacted after analysis done):
First incidence of the log error:
|
Hey @tomhaynes, We found the root cause of this issue! We disabled the cleanup for your scale sets until we permanently fix it, so you shouldn't encounter similar problem anymore. I will keep you all posted about the progress, and if anyone else experiences a similar issue before the fix is done, please let me know! And thank you again for providing all the necessary information we needed to find the root cause! |
Brilliant thanks @nikola-jokic! thank you for all your help |
|
There should be no risks, we just disabled the automatic cleanup for now, until we completely fix it. That just means that if you stop the cluster and the scale set is not talking to our API for more than 7 days, they won't be cleaned up automatically. |
Morning @nikola-jokic as I said above could you confirm this has been done for our entire org? We've seen more disappearing scale sets this morning 😢 |
Hey, our support reached out to your company to ask for specifics of your setup. This feature is scale set based, so if you have some scale sets registered on the repo level, and others registered on the org level, we need to enable this feature for org, and for each repository. Please let them know so we can properly enable it for all scale sets you have running. Sorry for the inconvenience, I thought it will be sorted out through that channel of communication. |
Chiming in that we're experiencing the same issues, where listener wasn't able to come up, and effectively reregistering scale set with: #3935 (comment) works |
@cmiller01 @dagi3d We've just had a reply from a separate support thread, so hopefully we should stop seeing these issues 🙏 :
|
Checks
Controller Version
0.9.3,0.10.1
Deployment Method
Helm
Checks
To Reproduce
Describe the bug
Having previously been healthy, our listeners are failing to register with the Github API, throwing the following error:
This causes them to repeatedly retry until we have exhausted our API limits, causing all runners to cease to work.
Describe the expected behavior
Successful registration
Additional Context
Controller Logs
Runner Pod Logs
The text was updated successfully, but these errors were encountered: