java.io.IOException: No X-Jenkins-CLI2-Port among [X-Jenkins, null, Server, X-Content- Type-Options, Connection, X-You-Are-In-Group, X-Hudson, X-Permission-Implied-By, Date, X-Jenkins- Session, X-You-Are-Authenticated-As, X-Required-Permission, Set-Cookie, Expires, Content-Length, Content-Type] at hudson.cli.CLI.getCliTcpPort(CLI.java:284) at hudson.cli.CLI.<init>(CLI.java:128) at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72) at hudson.cli.CLI._main(CLI.java:473) at hudson.cli.CLI.main(CLI.java:384) Suppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://citest.gce.px/cli at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:184 0) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441 ) at hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78) at hudson.cli.CLI.connectViaHttp(CLI.java:152) at hudson.cli.CLI.<init>(CLI.java:132) ... 3 more 

## Server key did not validate 

You may get the error below and find a log entry just below that concerning mismatched keys : 

org.apache.sshd.common.SshException: Server key did not validate at org.apache.sshd.client.session.AbstractClientSession.checkKeys(AbstractClientSession.j ava:523) at org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSessio n.java:616) ... 

This means your SSH configuration does not recognize the public key presented by the server. It’s often the case when you run Jenkins in dev mode and multiple instances of the application are run under the same SSH port over time. 

In a development context, access your ~/.ssh/known_hosts (or in C:/Users/<your_name>/.ssh/known_hosts  for Windows) and remove the line corresponding to your current SSH port (e.g. [localhost]:3485 ). In a production context, check with the Jenkins administrator if the public key of the server changed recently. If so, ask the administrator to do the the steps described above. 

