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

Non-HTTP based UpdateCenter URLs cause exception in plugin manager

    • 2.383

      If you use a non http based update center (e.g. file:// or other) then the UpdateCenter validation breaks.

      ```
      2022-12-09 09:31:50.119+0000 [id=107] WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving http://localhost:8080/manage/pluginManager/checkUpdateSiteUrl
      java.lang.ClassCastException: class sun.net.www.protocol.file.FileURLConnection cannot be cast to class java.net.HttpURLConnection (sun.net.www.protocol.file.FileURLConnection and java.net.HttpURLConnection are in module java.base of loader 'bootstrap')
      at hudson.PluginManager.doCheckUpdateSiteUrl(PluginManager.java:1968)
      at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
      at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
      Caused: java.lang.reflect.InvocationTargetException
      ```

      The UpdateCenter check should not assume all UC are HTTP based.

      Steps to reproduce

      1. download a valid update-center.json file and store it locally on the file system (/tmp/foo.json)
      2. start Jenkins
      3. goto the plugin manager
      4. in the Update Site URL enter a URL such as file:/tmp/foo.json

      Expected results

      Validation passes

      Actual results

      Stack trasce and angry Jenkins

      Caused by https://github.com/jenkinsci/jenkins/pull/6886

          [JENKINS-70240] Non-HTTP based UpdateCenter URLs cause exception in plugin manager

          James Nord created issue -
          Julie Heard made changes -
          Assignee New: Julie Heard [ julieheard ]
          Julie Heard made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Julie Heard made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Alexander Brandes made changes -
          Remote Link New: This issue links to "https://github.com/jenkinsci/jenkins/pull/7520 (Web Link)" [ 28396 ]
          Alexander Brandes made changes -
          Labels Original: regression New: lts-candidate regression
          Julie Heard made changes -
          Assignee Original: Julie Heard [ julieheard ]
          James Nord made changes -
          Assignee New: James Nord [ teilo ]
          James Nord made changes -
          Remote Link New: This issue links to "jenkins#7524 PR (Web Link)" [ 28400 ]
          James Nord made changes -
          Remote Link New: This issue links to "jenkins#7520 (obsolete) (Web Link)" [ 28401 ]
          James Nord made changes -
          Remote Link Original: This issue links to "https://github.com/jenkinsci/jenkins/pull/7520 (Web Link)" [ 28396 ]

            teilo James Nord
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: