Neither -s nor the JENKINS_URL env var is specified.Jenkins CLIUsage: java -jar jenkins-cli.jar [-s URL] command [opts...] args...Options:-s URL : the server URL (defaults to the JENKINS_URL env var)-i KEY : SSH private key file used for authentication-p HOST:PORT : HTTP proxy host and port for HTTPS proxy tunneling. See http://jenkins-ci.org/https-proxy-tunnel-noCertificateCheck : bypass HTTPS certificate check entirely. Use with caution-noKeyAuth : dont try to load the SSH authentication private key. Conflicts with -iThe available commands depend on the server. Run the help command tosee the list.
Exception in thread "main" java.io.IOException: Failed to connect to http://my.JenkinsServer:8080/at hudson.cli.CLI.getCliTcpPort(CLI.java:271)at hudson.cli.CLI.<init>(CLI.java:126)at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)at hudson.cli.CLI._main(CLI.java:471)at hudson.cli.CLI.main(CLI.java:387)Caused by: java.net.UnknownHostException: my.JenkinsServerat java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:175)at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)at java.net.Socket.connect(Socket.java:543)at java.net.Socket.connect(Socket.java:492)at sun.net.NetworkClient.doConnect(NetworkClient.java:178)at sun.net.www.http.HttpClient.openServer(HttpClient.java:417)at sun.net.www.http.HttpClient.openServer(HttpClient.java:519)at sun.net.www.http.HttpClient.<init>(HttpClient.java:203)at sun.net.www.http.HttpClient.New(HttpClient.java:296)at sun.net.www.http.HttpClient.New(HttpClient.java:315)at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1004)at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:940)at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:858)at hudson.cli.CLI.getCliTcpPort(CLI.java:269)... 4 more
Exception in thread "main" java.io.EOFExceptionat java.io.DataInputStream.readFully(DataInputStream.java:197)at java.io.DataInputStream.readUTF(DataInputStream.java:609)at java.io.DataInputStream.readUTF(DataInputStream.java:564)at hudson.cli.CLI.connectViaCliPort(CLI.java:230)
at hudson.cli.CLI.<init>(CLI.java:126)at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)at hudson.cli.CLI._main(CLI.java:471)at hudson.cli.CLI.main(CLI.java:387)
java.io.EOFException
If on the server side you have such logs (perhaps with another security manager)
This issues was fixed in Jenkins 1.424
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6eef6538-ad55-49e9-8ae0-ed2c727509de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Eric Pyle Siemens PLM Software Lebanon, NH +1 603-277-3060 eric...@siemens.com http://www.siemens.com/plm
Jun 25, 2019 9:48:19 AM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProviderINFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProviderJun 25, 2019 9:48:19 AM hudson.cli.SSHCLI sshConnectionWARNING: No header 'X-SSH-Endpoint' returned by Jenkins
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6eef6538-ad55-49e9-8ae0-ed2c727509de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Eric, thanks for the reply. I'm not using a reverse proxy on my Jenkins server. It's pretty much out of the box. I've been using the jenkins-cli.jar file for about 6 years. I just recently upgraded it and it stopped working. Before, I was able to connect with just the -s and the -i. Not sure why with the new version -i needs the ssh option. Maybe I should just call straight to the jenkins-cli.jar on the server to bypass jenkins remote security functionality?
Thanks,Eric
On Tue, Jun 25, 2019 at 11:10 AM Eric Pyle <eric...@cd-adapco.com> wrote:
Have a look at the docs: https://jenkins.io/doc/book/managing/cli/ . As stated there, if you are using a reverse proxy on your Jenkins server, it won't work using the jenkins-cli.jar as you are. You can try using the property -Dorg.jenkinsci.main.modules.sshd.SSHD.hostName on Jenkins startup, but that didn't work for our installation. I ended up switching to accessing CLI via the ssh command, as documented under "Using the CLI over SSH". Here's a little shell script I set up to access CLI from a bash prompt:
$ cat bin/jenkins
if [ $# == 0 ]; then DEF_ARG=help;fi
port=`curl -Lv ${JENKINS_URL}/login 2>&1 | grep -i 'x-ssh-endpoint'|grep -oE '([0-9]+)'`
ssh -p $port starci $@ $DEF_ARG
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f225f651-4f68-4f1c-81fd-bd0705305414%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- Eric Pyle Siemens PLM Software Lebanon, NH +1 603-277-3060 eric...@siemens.com http://www.siemens.com/plm