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

a file:// update center will always be offline


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • windows

      The code in hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCentermakes blind assumptions about the protocol and validity of an update center URL.

      Blindly appending a string to a URL does not necessarily a valid URL for connection checking make.

      For example the URL could be a file based url
      and the URL file://c:/some/path/to/updates.json will become file://c:/some/path/to/updates.json?uctest

      Later on the URL is used in hudson.model.UpdateCenter.UpdateCenterConfiguration.test connection(URL) - and if it is not a http URL it will try Util.copyStreamAndClose(connection.getInputStream(),new NullOutputStream()); which on windows will fail as it will try and open c:\some\path\to\updates.json?uctest which will fail with an exception - and then fail the update check.

              public void checkUpdateCenter(ConnectionCheckJob job, String updateCenterUrl) throws IOException {
                  testConnection(new URL(updateCenterUrl + "?uctest"));

            stephenconnolly Stephen Connolly
            teilo James Nord
            0 Vote for this issue
            2 Start watching this issue