0

We have a Jenkins matrix job with "SSH Agent" enabled in "Build Environment" with SSH credentials and a post-build action of "Execute Scripts On Matrix" with a shell command that runs ssh expecting to use the credentials stored by ssh-agent.

We recently upgraded from Jenkins v2.249.3 to v2.263.1 (and potentially upgraded some plugins at the same time, though I don't believe that we upgraded any of the ssh-related ones.) The aforementioned shell command now fails because it no longer has access to the ssh credentials it requires.

Comparing the build logs, we see a new call to ssh-agent -k in the Jenkins v2.263.1 parent job log immediately after the matrix children complete and before "[PostBuildScript] - [INFO] Executing post build scripts." that wasn't present with Jenkins v2.249.3.

It would appear that the agent is being killed before running the post-build operations by Jenkins v2.263.1 whereas it wasn't with Jenkins v2.249.3. I was unable to find a setting that controls this.

I entered JENKINS-64394 for this, but I wasn't really sure which components to label it with which I suspect mean that the right people haven't seen it. Does anyone here have any ideas?

Mike Crowe
  • 642
  • 6
  • 18
  • Did you ever find a solution for this? – TyMarc Aug 16 '21 at 21:34
  • No. There hasn't been any activity on the bug either. I've been wondering whether using pipelines would help, but I haven't found enough time to get them working well enough to find out. – Mike Crowe Aug 18 '21 at 08:30
  • That's actually what I did yesterday, you can use sshPublisher in one of your pipeline stages, it works properly. As for a normal Jenkins job, didn't try for ssh, but for Git Publisher I replaced it for normal git command through an Execute Shell build step to fix my issue – TyMarc Aug 18 '21 at 16:26

0 Answers0