Showing exception while connecting slave to master using headless jnlp

27k Views Asked by At

i am using jenkins 1.447.2 version.My master is linux and slave is windows

    Jul 27, 2012 12:44:17 PM hudson.remoting.jnlp.Main$CuiListener <init>
    INFO: Hudson agent is running in headless mode.
    Jul 27, 2012 12:44:17 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Locating server among [http://10.10.1.162:8080/jenkins/, http://dem
     Jul 27, 2012 12:44:38 PM hudson.remoting.jnlp.Main$CuiListener status
    INFO: Connecting to demo.sigmainfo.in:8050
     Jul 27, 2012 12:44:38 PM hudson.remoting.jnlp.Main$CuiListener status
     INFO: Handshaking
     Jul 27, 2012 12:44:58 PM hudson.remoting.jnlp.Main$CuiListener error
     SEVERE: The server rejected the connection:
     java.lang.Exception: The server rejected the connection:
     at hudson.remoting.Engine.onConnectionRejected(Engine.java:258)
     at hudson.remoting.Engine.run(Engine.java:233)

I am getting above error while tring to connect slave to master of jenkins..I got this error since i make master as static.(IP).

How to resolve this problem?

4

There are 4 best solutions below

5
sti On BEST ANSWER

JNLP slave connection problems are usually due to incorrect "Jenkins URL" setting in Jenkins global configuration. Please verify it.

If the setting is correct, I think you need to seriously consider the possibility that something is blocking the connection between your Windows slave and Linux master. Could there be a firewall installed on one or both hosts?

If there is a firewall, you might want to first set up a fixed port for JNLP connections and then configure the firewall on Linux master to accept inbound connections to that port and configure Windows firewall to accept outbound connections to that port.

The first part I can show you: Go to Jenkins master, Manage Jenkins, System Configuration. Check the box "Activate security".

A new section will appear. Check the box "TCP port for JNLP slave agents" and set any free port number you want. Please note that non-root processes cannot use ports under 1024, so you should choose something above that. Port numbers are 16 bit unsigned integers, so maximum is 65535.

The second part about firewall configuration I cannot help you with. How to allow access to the JNLP port is entirely up to the firewall software on your master and slave. Please refer to the manuals of those for details.

If it still does not work, I suggest you use tcpdump host demo.sigmainfo.in to see if the slave is really sending packets to the right interface of the right host.

3
AnneTheAgile On

With a windows master and mac jenkins slave, I got;

 java.lang.exception: the serverrejected the connection: None of the protocols were accepted

because I had changed our machine's credentials and had failed to inform jenkins. Since the error seems so far off from the issue, I thought I would post for my future self.

0
Ibrahim Buamod On

Once, I had this error because I already had a connection up, so check your connections.

0
Sarabesh n.r On

I had the same case of error log. But my setup was different. I had jenkins master running in my local pc. And configured to use kubernetes pods in docker-for-mac local pc for jenkins slave using the kubernetes jenkins plugin.

I had to change fixed port for tcp agents to 8888. Jenkins -> Manage jenkins -> Configure Global Security -> Agents -> fixed 8888 I am not sure if the problem was slaves could only try connecting to this port, but this solved the issue.