• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cli
    • None
    • Jenkins 2.189

      java -jar jenkins-cli.jar -s http://localhost:8080/ install-plugin http://updates.jenkins-ci.org/latest/job-dsl.hpi

      reports

      Installing a plugin from http://updates.jenkins-ci.org/latest/job-dsl.hpi

      but fails to install the plugin

      java -jar jenkins-cli.jar -s http://localhost:8080/ list-plugins

      doesn't list it, neither does the GUI

      curl -X POST -d '<jenkins><install plugin="job-dsl@1.34" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins

      does install the plugin

          [JENKINS-29065] CLI install plugin jobs-dsl fails

          But that's a different problem. It's a communication problem between the CLI client and the Jenkins server. You should open another issue for that problem.

          Daniel Spilker added a comment - But that's a different problem. It's a communication problem between the CLI client and the Jenkins server. You should open another issue for that problem.

          Bump? This breaks automation, including the jenkins chef cookbook. A working CLI seems pretty important, no?

          Travis Johnson added a comment - Bump? This breaks automation, including the jenkins chef cookbook . A working CLI seems pretty important, no?

          Daniel Beck added a comment -

          conslo That link is a different issue (the original report, not the later comments). Bundled plugins cannot be uninstalled, period. You delete them, they come back on restart. And bundled plugins cannot be updated via CLI due to JENKINS-29726.

          Daniel Beck added a comment - conslo That link is a different issue (the original report, not the later comments). Bundled plugins cannot be uninstalled, period. You delete them, they come back on restart. And bundled plugins cannot be updated via CLI due to JENKINS-29726 .

          danielbeck sorry, the issue I linked isn't actually related, you're correct, I seemed to have changed "uninstalled" into "installed" with some temporary dyslexia.

          However the chef cookbook for jenkins does use the jenkins-cli to install plugins, and thus, does not work because of this bug (I'll open an issue on the cookbook later).

          Travis Johnson added a comment - danielbeck sorry, the issue I linked isn't actually related, you're correct, I seemed to have changed "uninstalled" into "installed" with some temporary dyslexia. However the chef cookbook for jenkins does use the jenkins-cli to install plugins, and thus, does not work because of this bug (I'll open an issue on the cookbook later).

          Daniel Beck added a comment -

          I expect this to have been an infra issue due to the http -> https redirect (which isn't supported by Jenkins). Accessing http://updates.jenkins-ci.org/latest/job-dsl.hpi redirects me to plain http, so should work.

          Daniel Beck added a comment - I expect this to have been an infra issue due to the http -> https redirect (which isn't supported by Jenkins). Accessing http://updates.jenkins-ci.org/latest/job-dsl.hpi redirects me to plain http, so should work.

          Allan BURDAJEWICZ added a comment - - edited

          danielbeck Maybe this could be reopen. Or maybe this is related to https://issues.jenkins-ci.org/browse/JENKINS-44361 ? The issue with the HTTP / HTTPS redirect is corrupting the file when downloading using the CLI.

          If I use wget https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi and then do a sha1sum groovy.jpi I can see the right sha 85af4e8de47e981d3bf22adaf0c7f5747b991d83.

          If I use the Jenkins CLI to install from https://updates.jenkins.io, it succeeds:

          java -jar jenkins-cli.jar -logger FINE -s http://cje.example.com:8081 -auth admin:admin install-plugin https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi 
          Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.SecurityUtils register
          FINE: register(BC) not registered - enabled=true, supported=false
          Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
          INFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProvider
          Jul 19, 2019 2:34:09 PM hudson.cli.CLI _main
          FINE: using connection mode HTTP
          Jul 19, 2019 2:34:09 PM hudson.cli.CLI plainHttpConnection
          FINE: Trying to connect to http://allan.oss.com:8081/ via plain protocol over HTTP
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: establishing download side
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: established download side
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: establishing upload side
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: established upload side
          Installing a plugin from https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi
          

          but the sha of the $JENKINS_HOME/plugins/groovy.hpi is wrong 7c5e3f4ae6540474cf24bd4cb3ece2d31e701965. The file contains the HTTP response:

          <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
          <html><head>
          <title>302 Found</title>
          </head><body>
          <h1>Found</h1>
          <p>The document has moved <a href="http://mirrors.jenkins-ci.org/plugins/groovy/2.2/groovy.hpi">here</a>.</p>
          </body></html>
          

          This will break Jenkins startup on the next restart.

          If I use the Jenkins CLI to install from http://updates.jenkins.io, it succeeds:

          java -jar jenkins-cli.jar -logger FINE -s http://cje.example.com:8081 -auth admin:admin install-plugin https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi 
          Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.SecurityUtils register
          FINE: register(BC) not registered - enabled=true, supported=false
          Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
          INFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProvider
          Jul 19, 2019 2:34:09 PM hudson.cli.CLI _main
          FINE: using connection mode HTTP
          Jul 19, 2019 2:34:09 PM hudson.cli.CLI plainHttpConnection
          FINE: Trying to connect to http://allan.oss.com:8081/ via plain protocol over HTTP
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: establishing download side
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: established download side
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: establishing upload side
          Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init>
          FINE: established upload side
          Installing a plugin from https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi
          

          And the sha of the $JENKINS_HOME/plugins/groovy.hpi is correct 85af4e8de47e981d3bf22adaf0c7f5747b991d83*

          Note that it works for the update site at jenkins-updates.cloudbees.com/ whether you use http or https

          Allan BURDAJEWICZ added a comment - - edited danielbeck Maybe this could be reopen. Or maybe this is related to https://issues.jenkins-ci.org/browse/JENKINS-44361 ? The issue with the HTTP / HTTPS redirect is corrupting the file when downloading using the CLI. If I use wget https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi and then do a sha1sum groovy.jpi I can see the right sha 85af4e8de47e981d3bf22adaf0c7f5747b991d83 . If I use the Jenkins CLI to install from https://updates.jenkins.io , it succeeds: java -jar jenkins-cli.jar -logger FINE -s http: //cje.example.com:8081 -auth admin:admin install-plugin https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.SecurityUtils register FINE: register(BC) not registered - enabled= true , supported= false Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider INFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProvider Jul 19, 2019 2:34:09 PM hudson.cli.CLI _main FINE: using connection mode HTTP Jul 19, 2019 2:34:09 PM hudson.cli.CLI plainHttpConnection FINE: Trying to connect to http: //allan.oss.com:8081/ via plain protocol over HTTP Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: establishing download side Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: established download side Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: establishing upload side Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: established upload side Installing a plugin from https: //updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi but the sha of the $JENKINS_HOME/plugins/groovy.hpi is wrong 7c5e3f4ae6540474cf24bd4cb3ece2d31e701965 . The file contains the HTTP response: <!DOCTYPE HTML PUBLIC "- //IETF//DTD HTML 2.0//EN" > <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href= "http: //mirrors.jenkins-ci.org/plugins/groovy/2.2/groovy.hpi" >here</a>.</p> </body></html> This will break Jenkins startup on the next restart. If I use the Jenkins CLI to install from http://updates.jenkins.io , it succeeds: java -jar jenkins-cli.jar -logger FINE -s http: //cje.example.com:8081 -auth admin:admin install-plugin https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.SecurityUtils register FINE: register(BC) not registered - enabled= true , supported= false Jul 19, 2019 2:34:09 PM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider INFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProvider Jul 19, 2019 2:34:09 PM hudson.cli.CLI _main FINE: using connection mode HTTP Jul 19, 2019 2:34:09 PM hudson.cli.CLI plainHttpConnection FINE: Trying to connect to http: //allan.oss.com:8081/ via plain protocol over HTTP Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: establishing download side Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: established download side Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: establishing upload side Jul 19, 2019 2:34:09 PM hudson.cli.FullDuplexHttpStream <init> FINE: established upload side Installing a plugin from https: //updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi And the sha of the $JENKINS_HOME/plugins/groovy.hpi is correct 85af4e8de47e981d3bf22adaf0c7f5747b991d83 * Note that it works for the update site at jenkins-updates.cloudbees.com/ whether you use http or https

          Jesse Glick added a comment -

          As of https://github.com/jenkinsci/jenkins/pull/4123 the silent corruption is replaced by an error (and no bogus file except for a *.tmp):

          Installing a plugin from https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi
          
          ERROR: Unexpected exception occurred while performing install-plugin command.
          java.util.zip.ZipException: error in opening zip file
          	at java.util.zip.ZipFile.open(Native Method)
          	at java.util.zip.ZipFile.<init>(ZipFile.java:225)
          	at java.util.zip.ZipFile.<init>(ZipFile.java:155)
          	at java.util.jar.JarFile.<init>(JarFile.java:166)
          	at java.util.jar.JarFile.<init>(JarFile.java:130)
          	at hudson.cli.InstallPluginCommand.moveToFinalLocation(InstallPluginCommand.java:176)
          	at hudson.cli.InstallPluginCommand.run(InstallPluginCommand.java:110)
          	at …
          

          Making it follow redirects would be a nice enhancement.

          Jesse Glick added a comment - As of https://github.com/jenkinsci/jenkins/pull/4123 the silent corruption is replaced by an error (and no bogus file except for a *.tmp ): Installing a plugin from https://updates.jenkins.io/download/plugins/groovy/2.2/groovy.hpi ERROR: Unexpected exception occurred while performing install-plugin command. java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:225) at java.util.zip.ZipFile.<init>(ZipFile.java:155) at java.util.jar.JarFile.<init>(JarFile.java:166) at java.util.jar.JarFile.<init>(JarFile.java:130) at hudson.cli.InstallPluginCommand.moveToFinalLocation(InstallPluginCommand.java:176) at hudson.cli.InstallPluginCommand.run(InstallPluginCommand.java:110) at … Making it follow redirects would be a nice enhancement.

          Oleg Nenashev added a comment -

          Some follow-ups were addressed in Jenkins 2.189

          Oleg Nenashev added a comment - Some follow-ups were addressed in Jenkins 2.189

          Jesse Glick added a comment -

          Not sure I would consider this “fixed”, exactly—Jenkins still does not follow redirects—but the behavior is certainly better than before.

          Jesse Glick added a comment - Not sure I would consider this “fixed”, exactly—Jenkins still does not follow redirects—but the behavior is certainly better than before.

          Daniel Beck added a comment -

          The part where Jenkins comes up with failures to load (potentially many) plugins is fixed; so seems reasonable to me to close this. What's left is the lack of supporting HTTP redirects, which can be filed in a new issue if desired.

          Daniel Beck added a comment - The part where Jenkins comes up with failures to load (potentially many) plugins is fixed; so seems reasonable to me to close this. What's left is the lack of supporting HTTP redirects, which can be filed in a new issue if desired.

            Unassigned Unassigned
            anthonygreen Anthony Green
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: