Jenkins-cli commands returning connection timeout

Any suggestions / corrections for this jenkins-cli error?

I have a deployment task that is parameterized (test, stage, prod). So, whenever there is a deployment in an "intermediate" environment, I try to get Jenkins subordinates to execute a groovy script. Trying to check jenkins-cli.jar, I got this error:

[jenkins@ip-10-0-0-92 scripts]$ java -jar jenkins-cli.jar -s https://my_jenkins_URL/ help
Exception in thread "main" java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:579)
    at hudson.cli.CLI.connectViaCliPort(CLI.java:203)
    at hudson.cli.CLI.<init>(CLI.java:126)
    at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
    at hudson.cli.CLI._main(CLI.java:466)
    at hudson.cli.CLI.main(CLI.java:382)
    Suppressed: java.io.EOFException: unexpected stream termination
        at hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:331)
        at hudson.remoting.Channel.<init>(Channel.java:421)
        at hudson.remoting.Channel.<init>(Channel.java:400)
        at hudson.remoting.Channel.<init>(Channel.java:396)
        at hudson.remoting.Channel.<init>(Channel.java:385)
        at hudson.remoting.Channel.<init>(Channel.java:377)
        at hudson.remoting.Channel.<init>(Channel.java:353)
        at hudson.cli.CLI.connectViaHttp(CLI.java:157)
        at hudson.cli.CLI.<init>(CLI.java:130)
        ... 3 more

I did:

I am using nginx with a valid SSL certificate.

PS: I came to the following two questions. they are close, but no one has a solution, and the problems are unique in their own way.

jenkins-cli.jar Jenkins, https? Jenkins CLI HTTPS

+2
1

, /etc/hosts.

:

10.0.0.11 jenkins.xxxxx.com

, Jenkins. , Jenkins.

0

All Articles