I'm seeing the below error when I try to install plugins for Jenkins.
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\tech>cd C:\Program Files (x86)\Jenkins
C:\Program Files (x86)\Jenkins>java -jar jenkins-cli.jar -s http://localhost:8081/ install-plugin ant.hpi -deploy -restart
Exception in thread "main" java.io.IOException: No X-Jenkins-CLI2-Port among [null, X-Required-Permission, X-Jenkins,
X-You-Are-In-Group, X-Hudson, Content-Length, Expires, X-You-Are-Authenticated-As, X-Permission-Implied-By, Set-Cookie,
Server, X-Content-Type-Options, Date, X-Jenkins-Session, Content-Type]
at hudson.cli.CLI.getCliTcpPort(CLI.java:290)
at hudson.cli.CLI.<init>(CLI.java:133)
at hudson.cli.CLIConnectionFactory.connect(CLIConnectionFactory.java:72)
at hudson.cli.CLI._main(CLI.java:474)
at hudson.cli.CLI.main(CLI.java:389)
Suppressed: java.io.IOException: Server returned HTTP response code: 403 for URL: http://localhost:8081/cli
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:78)
at hudson.cli.CLI.connectViaHttp(CLI.java:163)
at hudson.cli.CLI.<init>(CLI.java:137)
... 3 more
From the troubleshooting section of the CLI documentation:
Go to Manage Jenkins > Configure Global Security and choose "Fixed" or "Random" under TCP port for JNLP agents.
The CLI is disabled by default; you need to enable this TCP port in Jenkins so that CLI clients may connect.
Also, assuming that your Jenkins master has access to the internet, you can just specify the ant
plugin ID on the command line to install the Ant Plugin (and its dependencies!) directly from the Jenkins Update Centre, rather than having to download and specify each of the required .hpi files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With