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

Plugin update installer downloads "302 redirect" response as the .hpi file, then reports success.

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • core
    • None
    • Hudson ver. 1.377
      Sun GlassFish Enterprise Server v2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs)
      SunOS 5.10 Generic_120012-14 i86pc i386 i86pc Solaris


      The Plugin update installer should follow 302 redirects, not download them.

      Attempting to update a plugin via the "Update Center" on the web console appears to succeed, but actually always downloads a "302 redirect" file. Subsequent Hudson re-start then results in plugin failure. (And Hudson offers to discard the configuration)

      eg. attempting to update "LavaLampNotifier", the LavaLampNotifier.hpi downloaded is as attached.
      Note this happens when we try to update any plugin - it is not restricted just to lavaLampNotifier. Can fetch the plugins fine using "wget" :-

      $ wget http://updates.hudson-labs.org/download/plugins/LavaLampNotifier/1.2/LavaLampNotifier.hpi
      -11:01:20- http://updates.hudson-labs.org/download/plugins/LavaLampNotifier/1.2/LavaLampNotifier.hpi
      => `LavaLampNotifier.hpi.2'
      Resolving updates.hudson-labs.org... 173.203.118.45
      Connecting to updates.hudson-labs.org|173.203.118.45|:80... connected.
      HTTP request sent, awaiting response... 302 Found
      Location: http://download.hudson-labs.org/plugins/LavaLampNotifier/1.2/LavaLampNotifier.hpi [following]
      -11:01:24- http://download.hudson-labs.org/plugins/LavaLampNotifier/1.2/LavaLampNotifier.hpi
      => `LavaLampNotifier.hpi.2'
      Resolving download.hudson-labs.org... 192.18.49.134
      Connecting to download.hudson-labs.org|192.18.49.134|:80... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 25,455 (25K) [text/plain]

      100%[============================================================================================================>] 25,455 2.17K/s ETA 00:00

      11:02:04 (983.61 B/s) - `LavaLampNotifier.hpi.2' saved [25455/25455]

          [JENKINS-8028] Plugin update installer downloads "302 redirect" response as the .hpi file, then reports success.

          Ed Randall created issue -

          Daniel Beck added a comment -

          Recent Jenkins versions use the JRE's HttpURLConnection for this, and it handles these redirects automatically. Shouldn't be an issue (anymore)

          Daniel Beck added a comment - Recent Jenkins versions use the JRE's HttpURLConnection for this, and it handles these redirects automatically . Shouldn't be an issue (anymore)
          Daniel Beck made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 138131 ] New: JNJira + In-Review [ 187858 ]

          Yuanfei Zhu added a comment -

          This issue regresses on 2.7.4

          Downloaded plugins content:

          jenkins@22feb80c2a1c:/$ cat /var/jenkins_home/plugins/slack.jpi.tmp
          <!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="https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/slack/2.0.1/slack.hpi">here</a>.</p>
          </body></html>
          

          Java version:

          jenkins@22feb80c2a1c:/$ java -version
          openjdk version "1.8.0_102"
          OpenJDK Runtime Environment (build 1.8.0_102-8u102-b14.1-1~bpo8+1-b14)
          OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
          

          Yuanfei Zhu added a comment - This issue regresses on 2.7.4 Downloaded plugins content: jenkins@22feb80c2a1c:/$ cat / var /jenkins_home/plugins/slack.jpi.tmp <!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= "https: //mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/slack/2.0.1/slack.hpi" >here</a>.</p> </body></html> Java version: jenkins@22feb80c2a1c:/$ java -version openjdk version "1.8.0_102" OpenJDK Runtime Environment (build 1.8.0_102-8u102-b14.1-1~bpo8+1-b14) OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)

          ethn chao added a comment - - edited

          It happened again!

          [ xxx ]$ cat /home/irm/.jenkins/plugins/workflow-cps.jpi.tmp
          <!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="https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/workflow-cps/2.17/workflow-cps.hpi">here</a>.</p>
          </body></html>
          
          [ xxx ]$ java -version
          java version "1.7.0_80"
          Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
          Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
          

          ethn chao added a comment - - edited It happened again! [ xxx ]$ cat /home/irm/.jenkins/plugins/workflow-cps.jpi.tmp <!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= "https: //mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/workflow-cps/2.17/workflow-cps.hpi" >here</a>.</p> </body></html> [ xxx ]$ java -version java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

          ethn chao added a comment -

          This issue just happened again, please check the comment below this issue.

          ethn chao added a comment - This issue just happened again, please check the comment below this issue.
          ethn chao made changes -
          Assignee New: Ed Randall [ edrandall ]
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Daniel Beck added a comment -

          What's the output of e.g. curl -L -I https://updates.jenkins-ci.org/latest/groovy-events-listener-plugin-master.hpi from a machine that gets served the same mirror?

          Daniel Beck added a comment - What's the output of e.g. curl -L -I https://updates.jenkins-ci.org/latest/groovy-events-listener-plugin-master.hpi from a machine that gets served the same mirror?
          Ed Randall made changes -
          Assignee Original: Ed Randall [ edrandall ]

            Unassigned Unassigned
            edrandall Ed Randall
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: