timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-51726] Slave failed to connect to http/2 Master #9863

Open timja opened 6 years ago

timja commented 6 years ago

Hello,

My problem is that jenkins Slave is not able to connect when using http2/ on the host. I followed the instructions at: link Jenkins Help and added

 

-Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar

to the java prompt in jenkins.xml. }}{{

 

This is how the arguments section in jenkins.xml looks like

 
-Xrs -Xmx4G -Xms3G  -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Xbootclasspath/p:"P:\Programs\Jenkins\alpn-boot-8.1.12.v20180117.jar" -jar "%BASE%\jenkins.war" --httpPort=-1 --http2Port=443 --httpsKeyStore="P:\Programs\Jenkins\SERVER_KEYSTORE.jks" --httpsKeepAliveTimeout=30000 --httpsKeyStorePassword=3WT46jvzPrcpFUoTUXow --webroot="%BASE%\war"
 

The Slave is not seen by the master, so the node is offline. I found the following in the error log of the slave

 

Failing to obtain https://SERVER_NAME/computer/TagNode/slave-agent.jnlp?encrypt=true
java.io.IOException: Invalid Http response
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:491)
    at hudson.remoting.Launcher.run(Launcher.java:314)
    at hudson.remoting.Launcher.main(Launcher.java:275)
Caused by: java.io.IOException: Invalid Http response
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
    at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:481)
    ... 2 more

After googleing around it seems that the Slave, or the jnlp startet via Java Webstart is not able to handle http/2 connections.

 

How can i configure Jenkins to use http/2 at Port 443 and have a Slave accessing the Master?

 

Thanks in advance.

 


Originally reported by bstlwstl, imported from: Slave failed to connect to http/2 Master
  • assignee: jthompson
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 6 years ago

oleg_nenashev:

Not sure whether it is a bug or feature request. Remoting has been never designed to support HTTP/2, but it looks like a feasible feature request since Jenkins supports HTTP/2 since 2.71 (JENKINS-45438).

The library could be bundled into Remoting JAR + there could be some tests of such config