Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64826

CLI install-plugin can't download plugin by URL with basic auth

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • cli, core

      This used to work, looks like a regression introduced in https://github.com/jenkinsci/jenkins/commit/aee0b50f3b9674ad2f405087f4e2a8b0bc32537d

                 ---- Begin output of java -jar "/tmp/kitchen/cache/jenkins-cli.jar" -s http://localhost:8080 -ssh -user "xxx" -i "/tmp/kitchen/cache/jenkins-key" install-plugin https://xxx:yyy@example.com/plugin.hpi  ----
                 STDOUT: Installing a plugin from https://xxx:yyy@example.com/plugin.hpi
                 STDERR: Feb 09, 2021 8:42:31 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
                 INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
                 
                 ERROR: Unexpected exception occurred while performing install-plugin command.
                 java.io.IOException: Server returned HTTP response code: 401 for URL: https://xxx:yyy@example.com/plugin.hpi
                      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
                      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
                      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
                      at java.net.URL.openStream(URL.java:1068)
                      at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1111)
                      at hudson.cli.InstallPluginCommand.run(InstallPluginCommand.java:110)
                      at hudson.cli.CLICommand.main(CLICommand.java:249)
                      at org.jenkinsci.main.modules.sshd.CLICommandAdapter$1.run(CLICommandAdapter.java:37)
                      at org.jenkinsci.main.modules.sshd.AsynchronousCommand$1.run(AsynchronousCommand.java:112)
                      at java.lang.Thread.run(Thread.java:748)
      

      There doesn't seem to be any other way to pass in any sort of credentials.

            Unassigned Unassigned
            llibicpep Dee Kryvenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: