Hi,

If a jenkins slave's launch method is configured as "launch slave via 
execution of command on the master", it can be launched by a script.  I 
want to do the following in my launch script:

1) ssh to the slave to install some Linux kernel packages and reboot
2) wait for 2 minutes for the slave to reboot
3) ssh to the slave again and invoke slave.jar

The script can successfully install the kernel packages and reboot the 
slave, but step 3 always fails with the following error:

<===[JENKINS REMOTING CAPACITY]===>channel started
Ping failed. Terminating
ERROR: Unexpected error in launching a slave. This is probably a bug in 
Jenkinshudson.remoting.RequestAbortedException 
<http://stacktrace.jenkins-ci.org/search?query=hudson.remoting.RequestAbortedException>:
 hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected 
termination of the channel
        at hudson.remoting.Request.call(Request.java:174) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.Request.call&entity=method>
        at hudson.remoting.Channel.call(Channel.java:663) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.Channel.call&entity=method>
        at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:349) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.SlaveComputer.setChannel&entity=method>
        at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:317) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.SlaveComputer.setChannel&entity=method>
        at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:122) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.CommandLauncher.launch&entity=method>
        at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:200) 
<http://stacktrace.jenkins-ci.org/search/?query=hudson.slaves.SlaveComputer$1.call&entity=method>
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: hudson.remoting.RequestAbortedException: java.io.IOException: 
Unexpected termination of the channel
        at hudson.remoting.Request.abort(Request.java:299)
        at hudson.remoting.Channel.terminate(Channel.java:719)
        at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:69)
Caused by: java.io.IOException: Unexpected termination of the channel
        at 
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)
Caused by: java.io.EOFException



The last line of my launch script is:

   ssh root@192.168.1.100 "java -jar /root/jenkins/slave.jar"

If I remove all other lines from the launch script and keep only the above 
line, the slave can be successfully launched online by the script:

[07/13/12 00:18:00] Launching slave agent
$ /home/jenkins/scripts/launch.sh
<===[JENKINS REMOTING CAPACITY]===>channel started
Slave.jar version: 2.16
This is a Unix slave
Copied maven-agent.jar
Copied maven3-agent.jar
Copied maven3-interceptor.jar
Copied maven-interceptor.jar
Copied maven2.1-interceptor.jar
Copied plexus-classworld.jar
Copied classworlds.jar

Evacuated stdout
Slave successfully connected and online


I also tried the following launch script:

   ssh root@192.168.1.100 "uname -a"
   ssh root@192.168.1.100 "java -jar /root/jenkins/slave.jar"

'uname -a' can be successfully executed but still slave can't be launched, 
same error as above.

I guess it's because stdin/stdout got messed up by other lines before the 
slave.jar invoking line?

Any idea?  Thanks in advance.

Jenkins version: 1.474


Romu

Reply via email to