2
votes

I have a Jenkins master installed on a Unix system (OEL). I configured two Unix slaves (also OEL) to be launched via SSH. The slaves never get launched and there is no error reported in the GUI on the master (no output at all, just a spinning ball):

Start slave status: spinning wheel...

The only warnings I see in the jenkins.log file are:

WARNING: Cron is not defined. WARNING: Making sc11136233 offline because it’s not responding WARNING: Making sc11136289 (OEL 6.5) offline because it’s not responding

I can connect from the master system to the slave via SSH as the same user, no problem. I can also connect from master to slave with a Java program as the same user that's used by Jenkins (using JSch):`

[jenkins@slcn03vmf0256 debug]$ java -classpath JSch:. SSHExeCommand Establishing Connection to sc11136289... Connection established. Preparing for command execution. Executing command: ls. 1 : bash_logout 2 : bash_profile 3 : bashrc 4 : bashrc-DEFAULT 5 : cshrc 6 : cshrc-DEFAULT 7 : cshrc-DEFAULT.06292004 8 : cshrc-DEFAULT_old 9 : emacs 10 : now.txt 11 : screenrc Done!

The JDK version on the master is:

$ java -version java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) Server VM (build 24.71-b01, mixed mode)

Java version on the slave:

$ java -version java version "1.7.0_45" OpenJDK Runtime Environment (rhel-2.4.3.4.0.1.el6_5-x86_64 u45-b15) OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

It looks like Jenkins cannot connect to the slave at all, but I'm not sure why.

  1. There are no log files under $JENKINS_HOME/logs/slaves/SLAVE_NAME on the master system. The directories for each slave are there, but they are empty.
  2. Jenkins did not copy any of its files to the slave systems either.
  3. I tried launching a slave while watching /var/log/secure on the slave system (equivalent of auth.log), but this file did not get updated.
  4. When executing my Java SSH test program, I can see the following with netstat on the master system:

    [jenkins@slcn03vmf0256 debug]$ netstat -a | grep sc111
    tcp        0      0 slcn03vmf0256:32508 sc11136289:ssh ESTABLISHED
    

    However, when I try to launch a slave from Jenkins, netstat returns no match when I grep for the slave.

It looks like Jenkins does not start any SSH connection.

After upgrading Jenkins to version 1.607 I get the following error printed when attempting to start a slave:

ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins
org.jruby.exceptions.RaiseException: (NameError) undefined local variable or method `listener' for #<Jenkins::Slaves::ComputerListenerProxy:0x1c0ee3>
at RUBY.preLaunch(/var/lib/jenkins/plugins/nodeofflinenotification/WEB-INF/classes/vendor/gems/bundler/gems/jenkins-plugin-runtime-39cc789729c0/lib/jenkins/slaves/computer_listener_proxy.rb:6)
2
Are you using an updated version of Jenkins? Can you access the master from the slave?Eldad Assis
You could use netstat or lsof to find out more details like Jenkins was able to connect, but was then stuck. Maybe Jenkins wasn't able to copy its slave.jar to the target? Double check that you didn't make any mistakes with the credentials. If you can you should also check the auth.log (or equivalent) on the slave-host.pitseeker
A couple of other debugging tips: 1) Does your Jenkins master have security enabled ? If so, make sure you're logged in and have permission to view the slave logs (this is either view or configure permission for slaves, I would use configure to make sure). 2) Check whether there is anything in $JENKINS_HOME/logs/slaves/SLAVE_NAME on the master.gareth_bowles
This is Jenkins 1.590. Yes I can connect via ssh from slave to master as well.Lidia
@gareth_bowles There are no log files under $JENKINS_HOME/logs/slaves/SLAVE_NAME. The directories for each slave are there but they are empty. I have security enabled, and just changed from matrix to 'logged in user can do anything'. I'm logged in, still the same issue. I have also enabled 'slave to master access control'. No change.Lidia

2 Answers

1
votes

As mentioned, after upgrading to 1.607, I got an error message, when trying to launch a slave:

ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins
org.jruby.exceptions.RaiseException: (NameError) undefined local variable or method `listener' for #<Jenkins::Slaves::ComputerListenerProxy:0x1c0ee3>
at RUBY.preLaunch(/var/lib/jenkins/plugins/nodeofflinenotification/WEB-INF/classes/vendor/gems/bundler/gems/jenkins-plugin-runtime-39cc789729c0/lib/jenkins/slaves/computer_listener_proxy.rb:6)

This led me to the following bugs in Jenkins:

I uninstalled the ruby-runtime plugin and launching slaves via SSH works again.

0
votes

I encountered another "weird" cause for a slave failing to start.

The .bashrc of the user jenkins was using for ssh contained a line with "su root", which caused the slave to hang on ssh init.

The end of my log was this:

[04/24/17 11:19:50] [SSH] Checking java version of java
[04/24/17 11:19:55] [SSH] java -version returned 1.7.0_80.
[04/24/17 11:19:55] [SSH] Starting sftp client.

Just removing this stupid su command did the trick.