jenkins-cli install-plugin issue

582 views
Skip to first unread message

Daniel Gront

unread,
Oct 23, 2018, 12:33:03 AM10/23/18
to Jenkins Developers
  • I've enabled 'Enable CLI over remoting'.
  • I've set TCP port for JNLP either fixed or random.
  • I've downloaded the jenkins-cli.jar successfully.

when performing plugin-install command I receive:

  • When executing: java -jar jenkins-cli.jar -auth user:pass -s http://localhost:8080 install-plugin file:///folder/plugin.hpi

    ERROR: Unexpected exception occurred while performing install-plugin command. java.io.FileNotFoundException: /folder/plugin.hpi (No such file or directory)

  • Without the file://

    /folder/plugin.hpi is neither a valid file, URL, nor a plugin artifact name in the update center

I've tried every possible combination, the file does exist.

Edit: from the exception, it keeps thinking that it's URL instead of file:

at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at java.net.URL.openStream(URL.java:1045)
    at hudson.FilePath.copyFrom(FilePath.java:890)

"

Edit 2: It does work when given HTTP URL, but it will require me to upload it to a server which I don't have every time.

Edit 3: I tried moving the file to the same folder of Jenkins at /var/lib/jenkins and gave it permissions of 777.

Daniel Gront

unread,
Oct 23, 2018, 2:25:52 AM10/23/18
to Jenkins Developers
It was Linux permission problem, after solving that I am receiving:

java.net.ConnectException: Connection refused (Connection refused)
        at java.net.PlainSocketImpl.socketConnect(Native Method)

Jesse Glick

unread,
Oct 24, 2018, 10:46:40 PM10/24/18
to jenkin...@googlegroups.com
On Tue, Oct 23, 2018 at 12:33 AM Daniel Gront <gro...@gmail.com> wrote:
> I've enabled 'Enable CLI over remoting'.

Do not do that! You can use the `install-plugin` command without it.
Check the help.

This would be a users’ list question I think.
Reply all
Reply to author
Forward
0 new messages