Hi,

On our dev env, we have Jenkins (2.46.3) behind Proxy i.e. "ci.dev" and 
actual jenkins running on "jenkins.dev:8080", in order to be able to run 
slaves, I'm setting "Tunnel connection through" parameter to 
"jenkins.dev:8080", so launch command will look like this: "java -jar 
slave.jar -jnlpUrl http://ci.dev/computer/slave-name/slave-agent.jnlp";.

But in this case I'm getting below exception on slave machine, when running 
above command

INFO: Protocol JNLP-connect encountered an unexpected exception
java.util.concurrent.ExecutionException: 
org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: Server 
didn't accept the handshake: HTTP/1.1 400 Illegal character 0x0
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at hudson.remoting.Engine.innerRun(Engine.java:385)
        at hudson.remoting.Engine.run(Engine.java:287)
Caused by: org.jenkinsci.remoting.protocol.impl.ConnectionRefusalException: 
Server didn't accept the handshake: HTTP/1.1 400 Illegal character 0x0
        at 
org.jenkinsci.remoting.engine.JnlpProtocol1Handler.sendHandshake(JnlpProtocol1Handler.java:121)
        at 
org.jenkinsci.remoting.engine.LegacyJnlpProtocolHandler$2.call(LegacyJnlpProtocolHandler.java:162)
        at 
org.jenkinsci.remoting.engine.LegacyJnlpProtocolHandler$2.call(LegacyJnlpProtocolHandler.java:158)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
Source)
        at hudson.remoting.Engine$1$1.run(Engine.java:94)
        at java.lang.Thread.run(Unknown Source)

In jenkins logs, error message will be 

May 31, 2017 12:55:10 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn
Illegal character 0x0 in state=START for buffer 
HeapByteBuffer@4b726783[p=1,l=158,c=16384,r=157]={\x00<<<\x16Protocol:JNLP2-c...ab0400e382b65\r\n>>>LHttpRequest\r\nX-C...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}

May 31, 2017 12:55:10 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn
badMessage: 400 Illegal character 0x0 for 
HttpChannelOverHttp@3a1052c5{r=0,c=false,a=IDLE,uri=}

May 31, 2017 12:55:10 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn
Illegal character 0x0 in state=START for buffer 
HeapByteBuffer@7ec287e9[p=1,l=103,c=16384,r=102]={\x00<<<\x15Protocol:JNLP-co...5\x00\x0cwindows-ie11>>>
 
11\r\nOrigin: 
http...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}

May 31, 2017 12:55:10 PM WARNING org.eclipse.jetty.util.log.JavaUtilLog warn
badMessage: 400 Illegal character 0x0 for 
HttpChannelOverHttp@297fe842{r=0,c=false,a=IDLE,uri=}

The thing is that this kind of setup broke after we updated jenkins from 
something < 2.46.3, but I don't remember which one was used

I was able to reproduce this issue without using proxy with docker 
container and debian package.

Steps to reproduce:

   1. Pull container from docker hub https://hub.docker.com/_/jenkins/ and 
   launch using provided docker run command
   2. Access jenkins installation and complete configuration using any 
   configuration. I tried installing default plugins and plain installation too
   3. Create new permanent agent:
   - Name: slave-name
      - Remote root directory: /tmp/slave
      - Launch Method: Launch agent via Java Web Start
      - Tunnel connection through: use the same ip & port, that you are 
      using to access jenkins
      - Save
   4. Try to launch command, that jenkins will show on screen after save. I 
   was using java -jar version to see log messages

If you remove value from "Tunnel connection through" parameter, everything 
will start working. But in case of Proxy setup, we can't do this, as 
jenkins is publicly accessible and Jenkins URL in System Settings should 
point to proxy.

-- 
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/10f451de-38de-4d23-b5e1-48d8e79df3c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to