You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self hosted runners failing with WRITE ERROR: A session for this runner already exists #3441
We are using self-hosted ephimeral runners for our github jobs. Recently we are seeing jobs failing randomly with the error This job failed on the UI. On further digging we found out that it's trying to run the job on a runner which is already in Active state instead of Idle. We also saw the following logs.
ERR Terminal] WRITE ERROR: A session for this runner already exists
It gets stuck in this process for long and then fails. Ex:
Waiting for a runner to pick up this job...
Job is about to start running on the runner: ip-10-0-87-43 (organization)
We even tried upgrading the action agent to v2.319.1 , but the issue still persists.
All of our runners have the same labels hence the job could easily pickup any runner in Idle state, but instead its trying to pickup a runner which is in Active state.
Reacted by Sascha Rucks, Bartosz Woźniak, Kado Yasuyuki, Francisco Cardoso, Junjie Fang, Juan V and bhavin56
👋Hi @soumik-avoma
From our logs, I see that runner attempting to create a session twice. Once at 2024-08-26T10:35:13UTC and again 11 seconds later at 2024-08-26T10:35:24UTC. The 2nd one results in the conflict you were seeing. Is it possible in your setup/automation there is something causing ./run.sh to be called multiple times?
Hi @soumik-avoma please try at least doubling the memory of your runner.
It happens, that after an OOM event, the runner restarts. And then it tries to create a new session whereas the previous session was not gracefully ended.
Hi @soumik-avoma please try at least doubling the memory of your runner. It happens, that after an OOM event, the runner restarts. And then it tries to create a new session whereas the previous session was not gracefully ended.
Running into the same issue with macOS runners. Action runners keep randomly disappearing from github and if I check the local logs, I see they failed like this a few days before.
Reacted by Sascha Rucks, Bhagyesh Patel and Junjie Fang
We had a similar issue. We run the ARC in EKS and deleting the pod wasn't helping because we kept seeing that A session for this runner already exists.
Manually removing the runner (not the runner scale set) helped. After the pod went down, a new one was spawned, a new runner was registered and it started accepting jobs.
Adding more memory to our runners resolved the issue for me, even though I noticed that OOM (Out Of Memory) errors aren't handled as gracefully as I would have expected. Just wanted to share in case it helps others facing similar problems.
I also had some success increasing memory (after I had tried to remove all ARC related components from my kubernetes cluster) and deleting all idle/offline runners on the github side.
If resources are the issue, would it be possible to make this very obvious in a log/event/error?
Increasing memory is only kicking the can down the road. If there's a power outage, network partition, etc. then things are going to be non-gracefully disconnected from GH. The fact that ./config.sh has --replace but then ./run.sh still fails is a failure of the Github API design and only Github can fix that.
Which it hasn't, for several years now :|
Reacted by siarhei-shpakouski-prypco, Junjie Fang, Thorben Westerhuys, Patrick Gallagher, Kyle Zhang, Juan V and Tim Janus
Also happening on our Linux runners after an OOM event, hopefully a reboot fixes it, but a restart of the systemd service definitely doesn't as I've tried that multiple times.
Activity
luketomlinson commentedon Aug 26, 2024
Hi @soumik-avoma, do you have a link to a workflow run where this issue is occurring?
soumik-avoma commentedon Aug 26, 2024
Hi @luketomlinson,
Since the workflow are private, hence won't be able to share that. But here are the logs:
luketomlinson commentedon Aug 26, 2024
👋Hi @soumik-avoma
From our logs, I see that runner attempting to create a session twice. Once at
2024-08-26T10:35:13UTCand again 11 seconds later at2024-08-26T10:35:24UTC. The 2nd one results in the conflict you were seeing. Is it possible in your setup/automation there is something causing./run.shto be called multiple times?soumik-avoma commentedon Aug 27, 2024
This is what we use for registering the runner. We do not call
run.shanywhere explicitly.Donnie commentedon Oct 2, 2024
Hi @soumik-avoma please try at least doubling the memory of your runner.
It happens, that after an OOM event, the runner restarts. And then it tries to create a new session whereas the previous session was not gracefully ended.
liriID commentedon Dec 12, 2024
How can we verify this with logs or other hints?
fgendorf commentedon Jan 24, 2025
We have the same situation in our self hosted runners windows
kaybutter commentedon Jan 31, 2025
Running into the same issue with macOS runners. Action runners keep randomly disappearing from github and if I check the local logs, I see they failed like this a few days before.
wozniakpl commentedon Feb 25, 2025
We had a similar issue. We run the ARC in EKS and deleting the pod wasn't helping because we kept seeing that
A session for this runner already exists.Manually removing the runner (not the runner scale set) helped. After the pod went down, a new one was spawned, a new runner was registered and it started accepting jobs.
mrcat71 commentedon Apr 11, 2025
Same issue, subscribed
kimxogus commentedon May 15, 2025
I'm having the exact same issue like wozniakpl
alexisloiselle commentedon Jul 8, 2025
Adding more memory to our runners resolved the issue for me, even though I noticed that OOM (Out Of Memory) errors aren't handled as gracefully as I would have expected. Just wanted to share in case it helps others facing similar problems.
piyat commentedon Aug 20, 2025
I also had some success increasing memory (after I had tried to remove all ARC related components from my kubernetes cluster) and deleting all idle/offline runners on the github side.
If resources are the issue, would it be possible to make this very obvious in a log/event/error?
Qix- commentedon Nov 20, 2025
Increasing memory is only kicking the can down the road. If there's a power outage, network partition, etc. then things are going to be non-gracefully disconnected from GH. The fact that
./config.shhas--replacebut then./run.shstill fails is a failure of the Github API design and only Github can fix that.Which it hasn't, for several years now :|
julyfun commentedon Nov 24, 2025
same issue on macOS
Add Before and Conflicts directives to service template
chididi commentedon Nov 12, 2026
Also happening on our Linux runners after an OOM event, hopefully a reboot fixes it, but a restart of the systemd service definitely doesn't as I've tried that multiple times.