Status: Closed (View Workflow)
Resolution: Won't Fix
Tomcat 8.0 with native library
ssh-agent plugin 1.6
Getting the following exception when attempt to run a job with the ssh-agent plugin enabled:
Started by user anonymous Building in workspace C:\Program Files (x86)\Jenkins\jobs\SmartPhone\workspace [ssh-agent] Using credentials id_rsa_smartphone (Smartphone Repo on GitHub) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] FATAL: Could not find a suitable ssh-agent provider [ssh-agent] Diagnostic report FATAL: [ssh-agent] Unable to start agent hudson.util.IOException2: [ssh-agent] Unable to start agent at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:231) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.preCheckout(SSHAgentBuildWrapper.java:189) at jenkins.scm.SCMCheckoutStrategy.preCheckout(SCMCheckoutStrategy.java:76) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) Caused by: java.lang.RuntimeException: [ssh-agent] Could not find a suitable ssh-agent provider. at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.<init>(SSHAgentBuildWrapper.java:332) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.createSSHAgentEnvironment(SSHAgentBuildWrapper.java:224) ... 7 more Finished: FAILURE
I'm not a Java developer but It appears that the code is attempting to get implementors of RemoteAgentFactory. From what I can tell, there are two - MinaRemoteAgentFactory and JNRRemoteAgentFactory. However, it doesn't appear to find either of these two because of the FATAL: Could not find a suitable ssh-agent provider message that it emits. If it did find MinaRemoteAgentFactory, the MinaRemoteAgentFactory.isSupported() function would either return true or log the Could not find Tomcat Native library message.
I'm not positive that I have the Tomcat native library installed correctly but it appears that it is not even getting to the point where it's checking for the existence of the library. When I installed Tomcat on Windows, I selected the option to include the native library. In the Tomcat logs, it indicates that the native library is being used.
In the end I just wrote a new plugin to spawn an actual ssh-agent.exe process. It's loaded by the ssh-agent plugin so no changes are necessary to pipelines or anything .
If you're interested I can share once I clean it up a little.
externl For sure, share it. Ideally the author of this plugin will pull in your changes so we will get it out of the box standard.
Close if https://github.com/jenkinsci/ssh-agent-plugin/pull/48 is merged.
As far as I can tell, the only way to authenticate properly under Windows is to pass the username/password to an HTTPS url. See http://stackoverflow.com/a/33630506/14731 and JENKINS-28335 for more details.