|
Hi all,
I've got a Jenkins build that runs a Capistrano deploy as a post-build action. Running the Capistrano task as the Jenkins user from the console works absolutely fine and without a password prompt (I've previously set up SSH keys on both build and staging server). However, when running the same script through Jenkins, I suddenly get a password prompt and the build subsequently fails (no TTY present). [workspace] $ /bin/sh -xe /tmp/hudson7321493219694918714.sh It looks like Ruby doesn't pick my SSH key up when running through Jenkins perhaps (`Net::SSH::AuthenticationFailed: not-specified`)? Does anyone have an idea what might be going wrong here? |
|
Hi,
you should check that the HOME variable is defined and accessible to the Jenkins process (or to the slave that is executing the task). I remember having the same kind of issue running git clients.
Hope that helps, Vincent 2012/10/31 Burkhard Reffeling <[hidden email]> Hi all, |
|
So I added the following line to the top of my script:
cd $HOME/.ssh && ls -al && cat id_rsa.pub Looks fine to me: [workspace] $ /bin/sh -xe /tmp/hudson7533718270802434100.sh + cd /var/lib/jenkins/.ssh + ls -al total 24 drwx------ 2 jenkins jenkins 4096 Oct 30 23:48 . drwxr-xr-x 9 jenkins jenkins 4096 Oct 31 17:34 .. -rw-rw-r-- 1 jenkins jenkins 43 Oct 30 23:48 config -rw------- 1 jenkins jenkins 1675 Oct 27 14:09 id_rsa -rw-r--r-- 1 jenkins jenkins 410 Oct 27 14:09 id_rsa.pub -rwx------ 1 jenkins jenkins 1306 Oct 28 22:20 known_hosts + cat id_rsa.pub [MY PUBLIC KEY ...] Software Engineer On 31 October 2012 17:02, Vincent Latombe <[hidden email]> wrote: Hi, |
|
You might want to try out the ssh agent plugin... Though it is a tad rough and ready. It will work if you install tomcat-native on all the build nodes that need the agent
On Wednesday, 31 October 2012, Burkhard Reffeling wrote: So I added the following line to the top of my script: |
|
I actually have the ssh-agent plugin version 0.2 now no-longer requiring tomcat-native (except perhaps on windows)
On 31 October 2012 20:44, Stephen Connolly <[hidden email]> wrote: You might want to try out the ssh agent plugin... Though it is a tad rough and ready. It will work if you install tomcat-native on all the build nodes that need the agent |
|
Thanks, I'll give it a spin tonight (don't use windows, so shouldn't be a problem)
Software Engineer On 1 November 2012 12:44, Stephen Connolly <[hidden email]> wrote: I actually have the ssh-agent plugin version 0.2 now no-longer requiring tomcat-native (except perhaps on windows) |
|
In reply to this post by stephenconnolly
decided to call it 1.0 ;-)
On 1 November 2012 12:44, Stephen Connolly <[hidden email]> wrote: I actually have the ssh-agent plugin version 0.2 now no-longer requiring tomcat-native (except perhaps on windows) |
|
Haha ;) I've got version 1.0 and am getting:
FATAL: [ssh-agent] Unable to start agent java.lang.UnsatisfiedLinkError: no tcnative-1 in java.library.path, no libtcnative-1 in java.library.path(/usr/lib/jvm/java-6-oracle/jre/lib/i386/server:/usr/lib/jvm/java-6-oracle/jre/lib/i386:/usr/lib/jvm/java-6-oracle/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib) at org.apache.tomcat.jni.Library.<init>(Library.java:56) at org.apache.tomcat.jni.Library.initialize(Library.java:157) at org.apache.sshd.agent.unix.AprLibrary.<init>(AprLibrary.java:83) at org.apache.sshd.agent.unix.AprLibrary.initialize(AprLibrary.java:62) at org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddress(AprLibrary.java:109) at org.apache.sshd.agent.unix.AgentServer.start(AgentServer.java:57) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.<init>(SSHAgentBuildWrapper.java:220) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:288) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:269) at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.<init>(SSHAgentBuildWrapper.java:312) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUp(SSHAgentBuildWrapper.java:106) at hudson.model.Build$RunnerImpl.doRun(Build.java:133) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) at hudson.model.Run.run(Run.java:1438) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) Looks like I might still need tomcat-native? Software Engineer On 1 November 2012 13:32, Stephen Connolly <[hidden email]> wrote: decided to call it 1.0 ;-) |
|
After downgrading to 0.1 and installing tomcat native (which was fun!) I got this:
[ssh-agent] Using credentials jenkins FATAL: [ssh-agent] Unable to start agent java.lang.NullPointerException at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:288) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:269) at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.<init>(SSHAgentBuildWrapper.java:312) at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUp(SSHAgentBuildWrapper.java:106) at hudson.model.Build$RunnerImpl.doRun(Build.java:133) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) at hudson.model.Run.run(Run.java:1438) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) Software Engineer On 1 November 2012 17:51, Burkhard Reffeling <[hidden email]> wrote: Haha ;) I've got version 1.0 and am getting: |
|
In reply to this post by burkhard
You shouldn't. Can you send some more details of the node that the job is running on (os & java version)
Downgrading to 0.1 will be less useful as the tomcat-native code is still there, just only used as a last resort if the JNR tricks dont
Can you send the full portion of the console log that has each line prefixed with [ssh-agent] and I might be able to diagnose from there. If you don't feel comfortable sharing your console log with this list, you can send it to Stephen dot Alan dot Connolly at gmail dot com
Thanks. Sent from a phone
On Thursday, 1 November 2012, Burkhard Reffeling wrote: Haha ;) I've got version 1.0 and am getting: |
| Powered by Nabble | Edit this page |
