I am usnig SSH plugin to run commands on Linux server, i started one script using SSH that script takes more than 1 hr time to run , i dont want to wait that much time so i put 30 sec time at Exec time out . But it showing error ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 30,000 ms] and it is unstable. I dont want to unstable my build , for that i used Jenkins text finder to stable this build . In that jenkins Text finder i searched the string in Regular expression is "Exception when publishing " . But still my build is unstable. please help me in this issue.
-
What 'exec' are you talking about? Can you reproduce the command? – malenkiy_scot Jul 02 '12 at 09:43
-
i am running sahi using the below command DISPLAY=:0.0 xterm -hold -e "sh sahi.sh – babu Jul 02 '12 at 09:51
-
So where is the timeout? – malenkiy_scot Jul 02 '12 at 09:53
-
in advaced options i set Exec timeout (ms): 30000 after 30 sec i am getting "Exec timed out or was interrupted after 30,000 ms "error message – babu Jul 02 '12 at 10:00
-
ssh plugin advancded options in jenkins – babu Jul 02 '12 at 10:18
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/13301/discussion-between-babu-and-malenkiy-scot) – babu Jul 02 '12 at 10:23
3 Answers
You've set a timeout for Publish over SSH Plugin which has nothing to do with your build step (which is - or should be - Execute shell Script on remote host using SSH). You probably have a Send build artifacts via SSH post-build step that then fails due to that timeout.
The confusion here is that options for Publish over SSH Plugin and SSH Plugin are set in the same section.

- 16,415
- 6
- 64
- 87
-
-
I know only of a way to "downgrade" build result (via [Groovy Postbuild plugin](https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin)) say, from SUCCESS to UNSTABLE or FAILURE. It can't 'upgrade' the build result from UNSTABLE to SUCCESS. – malenkiy_scot Jul 02 '12 at 12:56
-
Thanks for your response, i am also found that we can't 'upgrade' the build result from UNSTABLE to SUCCESS – babu Jul 03 '12 at 06:33
Since you are executing a script from a non-TTY environment; The Jenkins is not able to get the exit properly, out of your script.
What you want is to exit immediately, after script execution! Don't want to wait for the entire timeout to happen and then disconnect improperly!
Solution: Make it Exec in PTY. (Please tick the check-box as shown in attached screenshot)
I had the same issue and it is working perfect for me now.

- 91
- 1
- 8