Slave Jenkins on an RHEL box

76 views
Skip to first unread message

Peter Berghold

unread,
Nov 14, 2016, 11:28:20 AM11/14/16
to jenkins...@googlegroups.com
I have Jenkins running merrily on an Ubuntu box and want to set up a slave on an RHEL box. 

Created a script on the RHEL box that essentially launches a script that in turn launches the slave.jar.  Trying to invoke it over SSH and there's where things take a turn for the worse.

I'm getting this:
[11/14/16 16:22:37] Launching agent
$ /usr/share/tomcat8/startSlave0
Host key verification failed.
ERROR: Unable to launch the agent for <host>
java.io.EOFException: unexpected stream termination
	at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:365)
	at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:310)
	at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:388)
	at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:131)
	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:261)
	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
ERROR: Process terminated with exit code 255

That first line is a script on the master that does the SSH.    What I'm not sure about is exactly what is complaining about Host key verification.  Given I can run that script by hand and it starts the jar file I'm a bit confused about what's going on here. 

Has anybody gotten this to work?

Donald Morton

unread,
Nov 14, 2016, 5:45:37 PM11/14/16
to Jenkins Users
Sounds like the ssh command is failing. Maybe the password or private key is wrong? 

Peter Berghold

unread,
Nov 15, 2016, 9:14:51 AM11/15/16
to Jenkins Users
wish that were the case.  Nope:  running the same command from the command line yields the results I'm after.  Since the script runs as tomcat8 and tomcat8 is trusted between the hosts I'm at a complete loss as to why this is happening.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b9a359bf-eef0-4855-9178-515ee70acce6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dirk Heinrichs

unread,
Nov 15, 2016, 9:25:35 AM11/15/16
to jenkins...@googlegroups.com
Am 14.11.2016 um 17:28 schrieb Peter Berghold:

[11/14/16 16:22:37] Launching agent
$ /usr/share/tomcat8/startSlave0
Host key verification failed.

There's a problem with the host key of the slave. This usually means that the SSH server (your Jenkins slave) offers a different host key than the one the SSH client (your Jenkins master) has in it's known_hosts file already. Check the ~/.ssh/known_hosts file of the user your Jenkins master runs as. If there's a key already present for the slave host, delete it. Then establish a connection to the slave via SSH from the command line (still as that very same user) and accept the new host key of the slave.

HTH...

    Dirk

--

Dirk Heinrichs | Senior Systems Engineer, Delivery Pipeline
http://mimage.opentext.com/alt_content/binary/images/email-signature/recommind-ot.png
Tel: +49 2226 159666 (Ansage) 1149
Email: dirk.he...@recommind.com
Skype: dirk.heinrichs.recommind

Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach

Vertretungsberechtigte Geschäftsführer John Marshall Doolittle, Gordon Davies, Roger Illing, Registergericht Amtsgericht Bonn, Registernummer HRB 10646

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.

Fritz Elfert

unread,
Nov 15, 2016, 11:26:54 AM11/15/16
to jenkins...@googlegroups.com
On 15.11.2016 15:14, Peter Berghold wrote:
> wish that were the case. Nope: running the same command from the
> command line yields the results I'm after. Since the script runs as
> tomcat8 and tomcat8 is trusted between the hosts I'm at a complete loss
> as to why this is happening.

Really?
When manuall trying ssh to a remote slave, you *must* do that *as the
jenkins user* not with your user-account. That's because ssh stores the
remote host keys in $HOME/.ssh/known_hosts and $HOME of jenkins points
most likely somewhere else than with *your* user account. Therefore do
the following on your jenkins master:

1. sudo -i
2. su - jenkins
(or whatever your jenkins user is named on the master)
3. ssh rhelhost
(or ssh otheruser@hrelhost if named different than your master
jenkins user)

If *that* works *without* being asked any hostkey-questions, then
jenkins should be able to login too.

If *that* works *whithout* questions but jenkins still complains about
the host key, then the only explanation would be that $HOME inside the
running jenkins points somewhere else.

And BTW:
> I have Jenkins running merrily on an Ubuntu box and want to set
> up a slave on an RHEL box.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you merely want a slave host you neither need tomcat or any special
scripts for starting slave.jar, Just java on the rhel host.
If jenkins can login via ssh, it does everything automatically (copying
slave jar to the rhel-machine and starting it etc).

Cheers
-Fritz

signature.asc

Fritz Elfert

unread,
Nov 15, 2016, 11:42:10 AM11/15/16
to jenkins...@googlegroups.com
On 15.11.2016 17:26, Fritz Elfert wrote:
> most likely somewhere else than with *your* user account. Therefore do
> the following on your jenkins master:
>
> 1. sudo -i
> 2. su - jenkins
> (or whatever your jenkins user is named on the master)
> 3. ssh rhelhost
> (or ssh otheruser@hrelhost if named different than your master
> jenkins user)
>

Forgot to tell: If you don't know the jenkins user on your master, you
can lookup in the GUI: Select "Manage Jenkins->System Information"

Look for the system property named "user.name". Also the homedir is
shown there as "user.home".

Cheers

signature.asc
Reply all
Reply to author
Forward
0 new messages