Showing exception while connecting slave to master using headless jnlp
Asked Answered
R

4

6

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?

Recrimination answered 27/7, 2012 at 13:28 Comment(0)
L
11

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.

Lineolate answered 28/7, 2012 at 13:24 Comment(5)
i checked with url, given fixed port number..still getting error..my admin people told that no firewall on system is activated..while checking tcpdump, each time(5 sec interval) length is getting zero..My master is linux and slave is windows..how can i check whether 8050 of master is accepting packet and sending back..What else i can do for it?Recrimination
The best network sniffers are tcpdump (because it is installed everywhere) and WireShark (because it has a nice GUI). Use those to see which ports on the master the slave is trying to connect. Then use lsof on the master host to see if Jenkins is actually listening those ports.Lineolate
i have checked in master(linux) using wireshark ip.addr=slaveip and tcp.port=8050(port open on master).Without port it's showing Browser protocol connection.it is not displaying anything..In windows using netstat -an |find /i "listening" ..it's showing connection is established with that port number..i think only through browser connection is established..Recrimination
One more thing to add i got error Bad checksum-Ethernet while doing wireshark from slave(Windows) to master(Linux)..What to do?..Recrimination
i was using the Jenkins version 2.387.2, i didn't find this option "Activate security". but your direction is right. my jenkins url configuration was http at here, but i was using https to access jenkins, so i cannot connect to the Server, the Error is : hudson.remoting.jnlp.Main$CuiListener error SEVERE: Unexpected end of file from server. after change the url to https the error was gone. many thanks.Rosin
B
1

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.

Burnette answered 25/1, 2016 at 20:29 Comment(3)
Can you be more specific? What credentials or what kind of credentials changed?Simulated
Good question, as it is not clear enough! If memory serves, it was the login password for the jenkins mac slave.Burnette
Is this anyhow related to Matrix-based security as I just granted all permission to my Jenkins userJonson
H
1

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

Hyperemia answered 22/2, 2016 at 19:31 Comment(0)
S
0

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.

Seiden answered 12/3, 2020 at 21:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.