The inbound agents negotiate the connection calling a HTTP/S URL, because 
of that your fixed inbound does not apear in the URL you see in the UI. The 
URL you see there, it is generated with the setting Jenkins URL you have in 
Manage Jenkins/System Configuration,. Because you see an HTTP URL and you 
said that you have an HTTPS connection probably you have a warning on 
Manage Jenkins about that you do not have your Jenkins URL well configured. 
So if you have a Apache or Nginx in front Jenkins to configure the HTTPS 
you have to set the Jenkins URL to the effective URL that should use all 
clients/agents, it is the URL exposed by Apace/Nginx, then your URL to 
connect you will see in the UI wil be the correct and the negotiation of 
the inbound port will work. 
One last thing, take care that the agent can reach the HTTP/S and inbound 
ports.
 
El sábado, 31 de octubre de 2020 a las 21:27:09 UTC+1, vit...@1-family.net 
escribió:

> Hi,
>
> I'm trying to configure inbound agent (slave).
> For this purpose I've defined in Jenkin's Global security setting
>
> TCP port for inbound agents: Fixed: 8081, and created a new node.
>
> *The node settings page suggests the following command to be run on the 
> agent:*
> java -jar agent.jar <https://ci.adam-cogtec.com:8080/jnlpJars/agent.jar> 
> -jnlpUrl http://ip:8080/computer/NODE/slave-agent.jnlp -secret SECRET 
> -workDir "/home/pi/jenkins"
> This is strange, as I configured the TCP Port for inbound connections to 
> be 8081, not 8080.
> Moreover, the server itself is secuted with TLS, however jenkins suggests 
> to use HTTP.
>
> *Running the command produces the following error:*
> Failed to obtain 
> http://ip:8080/computer/NODE/slave-agent.jnlp?encrypt=true
> java.net.SocketException: Unexpected end of file from server
> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:851)
> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:848)
> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
> at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1593)
> at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
> at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
> at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:517)
> at hudson.remoting.Launcher.run(Launcher.java:347)
> at hudson.remoting.Launcher.main(Launcher.java:298)
> Waiting 10 seconds before retry
>
> *Trying to change port to 8081 produces:*
> Failed to obtain 
> http://ip:8081/computer/NODE/slave-agent.jnlp?encrypt=true
> java.io.IOException: Failed to load 
> http://ci.adam-cogtec.com:8081/computer/VitaliysAutoPi/slave-agent.jnlp?encrypt=true:
>  
> 404 Not Found
> at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:519)
> at hudson.remoting.Launcher.run(Launcher.java:347)
> at hudson.remoting.Launcher.main(Launcher.java:298)
> Waiting 10 seconds before retry
>
> *Changing the URL to https & port 8081 hangs for a long time.*
>
>
> *Changing the URL to https & port 8080 produces the following error:*
> Oct 31, 2020 7:23:14 PM hudson.remoting.jnlp.Main$CuiListener error
> SEVERE: Handshake response not received.
> io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Handshake 
> response not received.
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
> at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
> at hudson.remoting.Engine.runWebSocket(Engine.java:628)
> at hudson.remoting.Engine.run(Engine.java:470)
>
> *So which URL should be the right URL, and how would you troubleshoot this 
> issue?*
>
> Many Thanks!
> Vitaliy
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c1983273-42ed-4376-8025-9d84af082956n%40googlegroups.com.

Reply via email to