Conversation
…stalled on a slave. Not working yet with keys protected by a passphrase.
|
plugins » ssh-agent-plugin #13 FAILURE |
|
Unfortunatelly I wasn't able to test it with the latest master. The last tested version is using pom.xml from commit SHA-1: 7926415 (* Oops didn't mean tp bump parent yet). With the latest master I'm only able to generate the .hpi package but a local jekins is not run properly. version : nullCaused by: java.lang.ArrayIndexOutOfBoundsException: -1 |
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
|
I've found how to test it -> there was a problem with jenkins plugin version. |
|
Hi Mi-La, The fix is still not working for me. I'm using Windows 2012. A SSH key with passphrase. Building in workspace C:\Jenkins\jobs\dev1\workspace |
|
Hi DiSB, |
|
Hi Mi-La, I too have an issue while running Jenkins under windows server 2012 (No slaves). I also installed Cygwin (with OpenSSH) and Putty in this server. I use the latest version of the Jenkins' ssh-agent (1.5). Putty is in the path, and I also copied pageant.exe as ssh-agent.exe and ssh-add.exe. Which is ridiculous but was my last hope ! Maybe I missed something when installing Cygwin or Putty... Could you tell me if I need to write something in the path ? or anything else ? Please help ! I am using:
|
|
Hi nicolasr69, |
|
Hi Mi-La, Thanks for your reactivity :) I did not build the plugin, I installed it from the Jenkins' Plugins Management platform, after I installed (copied) the Tomcat Native Libraries. I also forgot to add C:\cygwin\bin to the path... But I recently did it and it solved nothing. It can be good to know that Cygwin takes at least 3 minutes to start ! I don't know why... But can it be the reason that ssh-agent is marked as not found (if not responding) ? I am trying to use MinGW instead. I added the path to MinGW's binaries to the Path and restarted Tomcat service. It still doesn't want to work ! :) However, in a shell, I can run I don't know what else I can do... I am also not used to Jenkins & Tomcat, but I don't think I did some big mistake... |
|
Since this patch is not applied in standard jenkins ssh-agent plugin, it can work only if you build jenkins plugin by yourself. |
|
Hi Mi-La ! Thanks for the comment I did not realize that your fork was not merged yet ! Sorry ! Anyway I tried to compile it with Maven but I did not get the ssh-agent.hpi that should result (am I right ?) I created a Gist here for the complete stderr output: https://gist.github.com/nicolasr69/9d59d22110affe5ada91 What is strange is that maven-hpi-plugin.pom does exist and is in the same folder ! (as maven-hpi-plugin.jar) Do you have any idea ? |
|
Hi nicolas, Unfortunatelly I'm not able to post my built plugin (the ssh-agent.hpi) now. Let me know if it would help you to get "my" binary. Moreover the plugin still have some problems and it reports errors wrongly. But since it is working it is enough for me. |
|
Hello. Are there any updates/plans on this pull request? The change seems to be useful for me, but seems the pull request has not been finished |
|
Hi, unfortunatelly I'm really busy with other things at the moment. If you know how to manage to get this pull request to be merged, please feel free to do it. If you need some interaction from me just let me know. |
|
+1 |
There was a problem hiding this comment.
Changed this to extends MasterToSlaveCallable to build with latest master branch.
There was a problem hiding this comment.
So what now? Could you do the change in a commit? Or shall I do it? Or do I need to do anything more? Thanks!
There was a problem hiding this comment.
It's easier if you change in your repository and push to the branch you made the pull request from, then this pull request will get the new commit automatically.
|
Running this on Mac OSX, working great. |
|
SSH Agent is not adding keys on OSX. Will this fix the issue? If so, +1 on getting this merged in. |
|
@reviewbybees Please review this pull request for merging. |
|
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
|
What's the status on reviewing this? |
|
This looks good, but the callable needs to extend from |
|
Even when fixing the compile error this doesn't work on Windows. |
|
I can confirm that it actually works if you have the correct executable on your PATH. With MSYS versions of ssh-agent, ssh-add and ssh everything worked. MSYS's commands are included in Git for Windows for example. You have to add the bin-path to the global environment variables on the machine. I've only managed to get it to work with jenkins started directly with java -jar jenkins.war, which is called from the windows service. I did have to extend the Starter with MasterToSlaveCallable, but then everything was fine. |
jglick
left a comment
There was a problem hiding this comment.
Minor Remoting mistakes, but the idea looks sound.
| @Override | ||
| public boolean isSupported(Launcher launcher, final TaskListener listener) { | ||
| try { | ||
| Runtime.getRuntime().exec("ssh-agent -k"); |
There was a problem hiding this comment.
This only tells you if ssh-agent exists on the master. You must use the provided Launcher.
|
FYI: I have rebased Mi-La's changes onto master and it works like a charm for me. Thanks, guys! You may find the code at: https://github.com/janvrany/ssh-agent-plugin/tree/pr2 |
|
Hi all, since I have no power to finish this pull request, I'm closing it right now. I believe that someone else will be able to finish it up correctly ;-). |
|
@janvrany can you open a PR with the updated code? |
|
Hi @janvrany , I also have no real experience with that, but found this: Example: launcher.launch("dir", new String[0], listener.getLogger(), build.getProject().getWorkspace());This seems to now be deprecated in favor of using the ProcStarter, something like this should work for us (untested): In fact, there is an should work too. |
|
@lkraider Perfect, thanks a lot! I'll try to find some time this weekend and have a look. |
|
@lkraider , all: I have just opened a new PR for updated code: New implementation of ssh-agent (second attempt). Let's move there. |
I have created a new ssh-agent implementation. It is related to post here:
https://wiki.jenkins-ci.org/display/JENKINS/SSH+Agent+Plugin?focusedCommentId=73533285&#comment-73533285
This new implementation uses native programs available on a jenkins slave machine.
i.e. If ssh-agent program is available in PATH on a slave, it is used and identities are added using ssh-add.
The current ssh-agent-plugin implementation chooses a first supported ssh agent implementation. It would be greate if a user could assign priorities to ssh agent implementations in the plugin cofiguration.