Re: Script behaves differently when run through Jenkins
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 stephen.alan.conno...@gmail.comwrote: 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: 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 ...] * * *Burkhard Reffeling* Software Engineer On 31 October 2012 17:02, Vincent Latombe vincent.lato...@gmail.comwrote: 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 burkhard.reffel...@gmail.com 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 Performing Post build task... Match found for : : True Logical operation result is TRUE Running script : cap _2.13.4_ deploy [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh + cap _2.13.4_ deploy * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' triggering before callbacks for `deploy:update_code' [32m-- Updating code base with checkout strategy[0m executing locally: git ls-remote g...@my.staging-server.com:my_project.git master command finished in 1200ms * executing git clone -q g...@my.staging-server.com:my_project.git /var/www/staging/my_project/releases/20121029223619 cd /var/www/staging/my_project/releases/20121029223619 git checkout -q -b deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01 (echo 1fb11d669a6cb5a714d077162305dfcfaba82f01 /var/www/staging/my_project/releases/20121029223619/REVISION) servers: [my.staging-server.com] Password: stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device *** [deploy:update_code] rolling back * executing rm -rf /var/www/staging/my_project/releases/20121029223619; true servers: [my.staging-server.com] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified) connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) POST BUILD TASK : FAILURE 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?
Re: Script behaves differently when run through Jenkins
Thanks, I'll give it a spin tonight (don't use windows, so shouldn't be a problem) * * *Burkhard Reffeling* Software Engineer On 1 November 2012 12:44, Stephen Connolly stephen.alan.conno...@gmail.comwrote: 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 stephen.alan.conno...@gmail.com 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 On Wednesday, 31 October 2012, Burkhard Reffeling wrote: 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 ...] * * *Burkhard Reffeling* Software Engineer On 31 October 2012 17:02, Vincent Latombe vincent.lato...@gmail.comwrote: 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 burkhard.reffel...@gmail.com 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 Performing Post build task... Match found for : : True Logical operation result is TRUE Running script : cap _2.13.4_ deploy [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh + cap _2.13.4_ deploy * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' triggering before callbacks for `deploy:update_code' [32m-- Updating code base with checkout strategy[0m executing locally: git ls-remote g...@my.staging-server.com:my_project.git master command finished in 1200ms * executing git clone -q g...@my.staging-server.com:my_project.git /var/www/staging/my_project/releases/20121029223619 cd /var/www/staging/my_project/releases/20121029223619 git checkout -q -b deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01 (echo 1fb11d669a6cb5a714d077162305dfcfaba82f01 /var/www/staging/my_project/releases/20121029223619/REVISION) servers: [my.staging-server.com] Password: stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device *** [deploy:update_code] rolling back * executing rm -rf /var/www/staging/my_project/releases/20121029223619; true servers: [my.staging-server.com] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified) connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) POST BUILD TASK : FAILURE 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?
Re: Script behaves differently when run through Jenkins
decided to call it 1.0 ;-) On 1 November 2012 12:44, Stephen Connolly stephen.alan.conno...@gmail.comwrote: 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 stephen.alan.conno...@gmail.com 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 On Wednesday, 31 October 2012, Burkhard Reffeling wrote: 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 ...] * * *Burkhard Reffeling* Software Engineer On 31 October 2012 17:02, Vincent Latombe vincent.lato...@gmail.comwrote: 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 burkhard.reffel...@gmail.com 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 Performing Post build task... Match found for : : True Logical operation result is TRUE Running script : cap _2.13.4_ deploy [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh + cap _2.13.4_ deploy * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' triggering before callbacks for `deploy:update_code' [32m-- Updating code base with checkout strategy[0m executing locally: git ls-remote g...@my.staging-server.com:my_project.git master command finished in 1200ms * executing git clone -q g...@my.staging-server.com:my_project.git /var/www/staging/my_project/releases/20121029223619 cd /var/www/staging/my_project/releases/20121029223619 git checkout -q -b deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01 (echo 1fb11d669a6cb5a714d077162305dfcfaba82f01 /var/www/staging/my_project/releases/20121029223619/REVISION) servers: [my.staging-server.com] Password: stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device *** [deploy:update_code] rolling back * executing rm -rf /var/www/staging/my_project/releases/20121029223619; true servers: [my.staging-server.com] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified) connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) POST BUILD TASK : FAILURE 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?
Re: Script behaves differently when run through Jenkins
Haha ;) I've got version 1.0 and am getting: FATAL: [ssh-agent] Unable to start agentjava.lang.UnsatisfiedLinkError http://stacktrace.jenkins-ci.org/search?query=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) http://stacktrace.jenkins-ci.org/search/?query=org.apache.tomcat.jni.Library.%3Cinit%3Eentity=method at org.apache.tomcat.jni.Library.initialize(Library.java:157) http://stacktrace.jenkins-ci.org/search/?query=org.apache.tomcat.jni.Library.initializeentity=method at org.apache.sshd.agent.unix.AprLibrary.init(AprLibrary.java:83) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.%3Cinit%3Eentity=method at org.apache.sshd.agent.unix.AprLibrary.initialize(AprLibrary.java:62) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.initializeentity=method at org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddress(AprLibrary.java:109) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddressentity=method at org.apache.sshd.agent.unix.AgentServer.start(AgentServer.java:57) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AgentServer.startentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.init(SSHAgentBuildWrapper.java:220) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.%3Cinit%3Eentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:288) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:269) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at hudson.remoting.LocalChannel.call(LocalChannel.java:45) http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.LocalChannel.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.init(SSHAgentBuildWrapper.java:312) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.%3Cinit%3Eentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUp(SSHAgentBuildWrapper.java:106) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUpentity=method at hudson.model.Build$RunnerImpl.doRun(Build.java:133) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Build$RunnerImpl.doRunentity=method at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractRunner.runentity=method at hudson.model.Run.run(Run.java:1438) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.runentity=method at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.FreeStyleBuild.runentity=method at hudson.model.ResourceController.execute(ResourceController.java:88) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.executeentity=method at hudson.model.Executor.run(Executor.java:239) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.runentity=method Looks like I might still need tomcat-native? * * *Burkhard Reffeling* Software Engineer On 1 November 2012 13:32, Stephen Connolly stephen.alan.conno...@gmail.comwrote: decided to call it 1.0 ;-) On 1 November 2012 12:44, Stephen Connolly stephen.alan.conno...@gmail.com wrote: 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 stephen.alan.conno...@gmail.com 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 On Wednesday, 31 October 2012, Burkhard Reffeling wrote: 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
Re: Script behaves differently when run through Jenkins
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 agentjava.lang.NullPointerException http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:288) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:269) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at hudson.remoting.LocalChannel.call(LocalChannel.java:45) http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.LocalChannel.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.init(SSHAgentBuildWrapper.java:312) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.%3Cinit%3Eentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUp(SSHAgentBuildWrapper.java:106) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUpentity=method at hudson.model.Build$RunnerImpl.doRun(Build.java:133) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Build$RunnerImpl.doRunentity=method at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractRunner.runentity=method at hudson.model.Run.run(Run.java:1438) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.runentity=method at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.FreeStyleBuild.runentity=method at hudson.model.ResourceController.execute(ResourceController.java:88) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.executeentity=method at hudson.model.Executor.run(Executor.java:239) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.runentity=method * * *Burkhard Reffeling* Software Engineer On 1 November 2012 17:51, Burkhard Reffeling burkhard.reffel...@gmail.comwrote: Haha ;) I've got version 1.0 and am getting: FATAL: [ssh-agent] Unable to start agentjava.lang.UnsatisfiedLinkError http://stacktrace.jenkins-ci.org/search?query=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) http://stacktrace.jenkins-ci.org/search/?query=org.apache.tomcat.jni.Library.%3Cinit%3Eentity=method at org.apache.tomcat.jni.Library.initialize(Library.java:157) http://stacktrace.jenkins-ci.org/search/?query=org.apache.tomcat.jni.Library.initializeentity=method at org.apache.sshd.agent.unix.AprLibrary.init(AprLibrary.java:83) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.%3Cinit%3Eentity=method at org.apache.sshd.agent.unix.AprLibrary.initialize(AprLibrary.java:62) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.initializeentity=method at org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddress(AprLibrary.java:109) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddressentity=method at org.apache.sshd.agent.unix.AgentServer.start(AgentServer.java:57) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AgentServer.startentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.init(SSHAgentBuildWrapper.java:220) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.%3Cinit%3Eentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:288) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:269) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at
Re: Script behaves differently when run through Jenkins
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: FATAL: [ssh-agent] Unable to start agentjava.lang.UnsatisfiedLinkError http://stacktrace.jenkins-ci.org/search?query=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) http://stacktrace.jenkins-ci.org/search/?query=org.apache.tomcat.jni.Library.%3Cinit%3Eentity=method at org.apache.tomcat.jni.Library.initialize(Library.java:157) http://stacktrace.jenkins-ci.org/search/?query=org.apache.tomcat.jni.Library.initializeentity=method at org.apache.sshd.agent.unix.AprLibrary.init(AprLibrary.java:83) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.%3Cinit%3Eentity=method at org.apache.sshd.agent.unix.AprLibrary.initialize(AprLibrary.java:62) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.initializeentity=method at org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddress(AprLibrary.java:109) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AprLibrary.createLocalSocketAddressentity=method at org.apache.sshd.agent.unix.AgentServer.start(AgentServer.java:57) http://stacktrace.jenkins-ci.org/search/?query=org.apache.sshd.agent.unix.AgentServer.startentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.init(SSHAgentBuildWrapper.java:220) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentImpl.%3Cinit%3Eentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:288) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.call(SSHAgentBuildWrapper.java:269) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$RemoteAgentStarter.callentity=method at hudson.remoting.LocalChannel.call(LocalChannel.java:45) http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.LocalChannel.callentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.init(SSHAgentBuildWrapper.java:312) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper$SSHAgentEnvironment.%3Cinit%3Eentity=method at com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUp(SSHAgentBuildWrapper.java:106) http://stacktrace.jenkins-ci.org/search/?query=com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper.setUpentity=method at hudson.model.Build$RunnerImpl.doRun(Build.java:133) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Build$RunnerImpl.doRunentity=method at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractRunner.runentity=method at hudson.model.Run.run(Run.java:1438) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.runentity=method at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.FreeStyleBuild.runentity=method at hudson.model.ResourceController.execute(ResourceController.java:88) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.executeentity=method at hudson.model.Executor.run(Executor.java:239) http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.runentity=method Looks like I might still need tomcat-native? * * *Burkhard Reffeling* Software Engineer On 1 November 2012 13:32, Stephen Connolly stephen.alan.conno...@gmail.com wrote: decided to call it 1.0 ;-) On 1 November 2012 12:44, Stephen Connolly stephen.alan.conno...@gmail.com wrote: I actually have the ssh-agent plugin version 0.2 now
Re: Script behaves differently when run through Jenkins
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 burkhard.reffel...@gmail.com 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 Performing Post build task... Match found for : : True Logical operation result is TRUE Running script : cap _2.13.4_ deploy [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh + cap _2.13.4_ deploy * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' triggering before callbacks for `deploy:update_code' [32m-- Updating code base with checkout strategy[0m executing locally: git ls-remote g...@my.staging-server.com:my_project.git master command finished in 1200ms * executing git clone -q g...@my.staging-server.com:my_project.git /var/www/staging/my_project/releases/20121029223619 cd /var/www/staging/my_project/releases/20121029223619 git checkout -q -b deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01 (echo 1fb11d669a6cb5a714d077162305dfcfaba82f01 /var/www/staging/my_project/releases/20121029223619/REVISION) servers: [my.staging-server.com] Password: stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device *** [deploy:update_code] rolling back * executing rm -rf /var/www/staging/my_project/releases/20121029223619; true servers: [my.staging-server.com] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) POST BUILD TASK : FAILURE 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?
Re: Script behaves differently when run through Jenkins
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 ...] * * *Burkhard Reffeling* Software Engineer On 31 October 2012 17:02, Vincent Latombe vincent.lato...@gmail.com wrote: 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 burkhard.reffel...@gmail.com 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 Performing Post build task... Match found for : : True Logical operation result is TRUE Running script : cap _2.13.4_ deploy [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh + cap _2.13.4_ deploy * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' triggering before callbacks for `deploy:update_code' [32m-- Updating code base with checkout strategy[0m executing locally: git ls-remote g...@my.staging-server.com:my_project.git master command finished in 1200ms * executing git clone -q g...@my.staging-server.com:my_project.git /var/www/staging/my_project/releases/20121029223619 cd /var/www/staging/my_project/releases/20121029223619 git checkout -q -b deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01 (echo 1fb11d669a6cb5a714d077162305dfcfaba82f01 /var/www/staging/my_project/releases/20121029223619/REVISION) servers: [my.staging-server.com] Password: stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device *** [deploy:update_code] rolling back * executing rm -rf /var/www/staging/my_project/releases/20121029223619; true servers: [my.staging-server.com] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified) connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) POST BUILD TASK : FAILURE 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?
Re: Script behaves differently when run through Jenkins
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: 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 ...] * * *Burkhard Reffeling* Software Engineer On 31 October 2012 17:02, Vincent Latombe vincent.lato...@gmail.comjavascript:_e({}, 'cvml', 'vincent.lato...@gmail.com'); wrote: 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 burkhard.reffel...@gmail.comjavascript:_e({}, 'cvml', 'burkhard.reffel...@gmail.com'); 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 Performing Post build task... Match found for : : True Logical operation result is TRUE Running script : cap _2.13.4_ deploy [workspace] $ /bin/sh -xe /tmp/hudson1545664641721322948.sh + cap _2.13.4_ deploy * executing `deploy' * executing `deploy:update' ** transaction: start * executing `deploy:update_code' triggering before callbacks for `deploy:update_code' [32m-- Updating code base with checkout strategy[0m executing locally: git ls-remote g...@my.staging-server.com:my_project.git master command finished in 1200ms * executing git clone -q g...@my.staging-server.com:my_project.git /var/www/staging/my_project/releases/20121029223619 cd /var/www/staging/my_project/releases/20121029223619 git checkout -q -b deploy 1fb11d669a6cb5a714d077162305dfcfaba82f01 (echo 1fb11d669a6cb5a714d077162305dfcfaba82f01 /var/www/staging/my_project/releases/20121029223619/REVISION) servers: [my.staging-server.com] Password: stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device stty: standard input: Inappropriate ioctl for device *** [deploy:update_code] rolling back * executing rm -rf /var/www/staging/my_project/releases/20121029223619; true servers: [my.staging-server.com] ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: my.staging-server.com (Net::SSH::AuthenticationFailed: not-specified) connection failed for: my.staging-server.com(Net::SSH::AuthenticationFailed: not-specified) POST BUILD TASK : FAILURE 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?