Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing exception while connecting slave to master using headless jnlp

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?

like image 549
varghese Avatar asked Dec 21 '22 18:12

varghese


2 Answers

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.

like image 188
sti Avatar answered Apr 27 '23 20:04

sti


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.

like image 28
AnneTheAgile Avatar answered Apr 27 '23 20:04

AnneTheAgile