# Agents become offline if build is stopped during an ssh command exection

**URL:** https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420
**Category:** Bugs
**Tags:** fixed
**Created:** [November 9, 2023, 2:15pm UTC](https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420 "2023-11-09T14:15:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ktopaz](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/ktopaz/32/2390_2.png) [@ktopaz](https://www.finalbuilder.com/forums/u/ktopaz)
#### Post date: [November 9, 2023, 2:15pm UTC](https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420/1 "2023-11-09T14:15:02Z")

</div>

Hi Guys,

We sometimes have issues where agents become offline and have to be killed and restarted to come online again.  
I haven’t run the agents in debug mode yet because the problem was sporadic  
But I think I’ve identified the problem:  
Our iOS developers sometimes stop their running builds while it is still running  
these specific builds are triggering workflows on MAC machines via SSH, and these take long time to complete.  
I noticed agents become offline after having one of these builds stopped by a user while running on them during the “SSH Run Script” Action execution.  
I’ll try to enable debug mode soon and gather more information for you on this.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [November 9, 2023, 9:11pm UTC](https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420/2 "2023-11-09T21:11:05Z")

</div>

Hi

Agents periodically contact the server to let it know they are still available - so for an agent to go offline it will have stopped doing that. We would definitely need to see an agent debug log to figure out if the agent is crashing.

When you say they take a long time to complete, how long? We don’t do ios builds here but we could certainly create the same scenario with ssh calling out to a linux machine to so something long running.

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [November 17, 2023, 6:26am UTC](https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420/3 "2023-11-17T06:26:02Z")

</div>

Hi Arik,

We’ve identified an issue where the SSH Run Script action could enter into a loop using high CPU. This is likely to be the cause of your issue. The fix for this is in [version 1.9.2.1234](https://www.finalbuilder.com/forums/t/continua-ci-v1-9-2-1234-released/7424)

---

<div class="post-metadata">

### Author: ![ktopaz](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/ktopaz/32/2390_2.png) [@ktopaz](https://www.finalbuilder.com/forums/u/ktopaz)
#### Post date: [March 28, 2024, 1:45pm UTC](https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420/4 "2024-03-28T13:45:42Z")

</div>

Hi Guys,

Somehow this issue re-surfaced for us after a while (not sure exactly when)  
Its the same deal -  
If someone STOPS a build during an “SSH Run Script” action execution -  
SOME of times this will cause the agent to become unresponsive and shown as offline under /administration/ci/agents/viewall

When this happens - although the agent service appears to be running on the agent VM - we’re unable to restart it and have to kill the process from task manager before starting it correctly.

We’re running the latest release - 1.9.2.1293  
Could you kindly help us check it again?

Thanks!

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [April 2, 2024, 4:12am UTC](https://www.finalbuilder.com/forums/t/agents-become-offline-if-build-is-stopped-during-an-ssh-command-exection/7420/5 "2024-04-02T04:12:17Z")

</div>

Hi Arik,

We are unable to reproduce this or find any possible cause in the code. We would need an agent debug log and details of the SSH Run Script action settings to investigate this further.
