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

"Upgrade Automatically" does not seem to work on Windows

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Windows 2003 R3
      Java 1.6.0_26
      Apache httpd 2.2 as frontend (apj13 proxy)

      After moving to a Jenkins installation that runs as a service. I noticed it now had the option to download new versions of itself and upgrade. I tried that with 1.452 and was a bit confused that it restarted but still showed 1.452 as version number. But also gives me the option to downgrade to 1.452.

      After a couple more tries I think I can conclude that what happens is that it downloads the new version just fine (as jenkins.war.tmp) and copies the current version fine as well (jenkins.war.bak). But it never actually gets around to replacing the current running version with the new one.

      This appears to be the relevant part of the jenkins.err.log:

      INFO: Starting the installation of jenkins.war on behalf of kpe
      Mar 19, 2012 9:17:19 AM hudson.model.UpdateCenter$UpdateCenterConfiguration download
      INFO: Downloading jenkins.war
      Mar 19, 2012 9:17:19 AM hudson.model.UpdateCenter doSafeRestart
      INFO: Scheduling Jenkins reboot
      Mar 19, 2012 9:17:40 AM hudson.model.UpdateCenter$DownloadJob run
      INFO: Installation successful: jenkins.war
      

      But I am a bit confused on how this would ever actually work on Windows? Since files are generally locked up pretty tight. So replacing or overwriting a file that Java is actively using would be practically impossible. And instead it would require some sort of utility running before starting Jenkins to replace the war file with the newly downloaded one.

          [JENKINS-13153] "Upgrade Automatically" does not seem to work on Windows

          Kristoffer Peterhänsel created issue -

          I have the same problem, and the most strange thing is that there exists no exception or warning during installation.

          Maybe jenkins.exe is a good place for doing this?

          Pei-Tang Huang added a comment - I have the same problem, and the most strange thing is that there exists no exception or warning during installation. Maybe jenkins.exe is a good place for doing this?

          Maybe this functionality should generaly be disabled on Windows?

          Dirk Heinrichs added a comment - Maybe this functionality should generaly be disabled on Windows?
          Jenkins IRC Bot made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: update-center [ 15629 ]

          Daniel Beck added a comment -

          Is this still a problem in recent Jenkins versions?

          Daniel Beck added a comment - Is this still a problem in recent Jenkins versions?

          Not a clue. I no longer work at the place where we had that installation. And don't really have anywhere to replicate the setup either.

          Kristoffer Peterhänsel added a comment - Not a clue. I no longer work at the place where we had that installation. And don't really have anywhere to replicate the setup either.

          Daniel Beck added a comment -

          Thanks for the update Kristoffer!

          Resolving as incomplete as no information about the issue in recent Jenkins versions is known. (there were a few improvements to jenkins.exe since this was filed, so I have reason to believe this may have been fixed)

          If this happens in a recent (no older than six weeks) version of Jenkins, please just file a new issue. Thanks!

          Daniel Beck added a comment - Thanks for the update Kristoffer! Resolving as incomplete as no information about the issue in recent Jenkins versions is known. (there were a few improvements to jenkins.exe since this was filed, so I have reason to believe this may have been fixed) If this happens in a recent (no older than six weeks) version of Jenkins, please just file a new issue. Thanks!
          Daniel Beck made changes -
          Resolution New: Incomplete [ 4 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Peter Hancox added a comment -

          This is still a problem as of version 1.574

          Attempted automatic upgrade from 1.574 to 1.582 and screen stuck on "Jenkins restarting ..." Stop the Jenkins service and copy "jenkins.war.tmp" to "jenkins.war" and restart service. Upgrade is now complete.

          Appears as if upgrade is waiting for the downloaded temporary war to replace the currently active war and this is hanging. My Jenkins is installed in the default "C:\Program Files (x86)\Jenkins\" directory so I would expect that the update process would need elevated privileges, though I suspect it already has them since it can place the new downloaded war file in that directory.

          Hope that helps.

          Peter Hancox added a comment - This is still a problem as of version 1.574 Attempted automatic upgrade from 1.574 to 1.582 and screen stuck on "Jenkins restarting ..." Stop the Jenkins service and copy "jenkins.war.tmp" to "jenkins.war" and restart service. Upgrade is now complete. Appears as if upgrade is waiting for the downloaded temporary war to replace the currently active war and this is hanging. My Jenkins is installed in the default "C:\Program Files (x86)\Jenkins\" directory so I would expect that the update process would need elevated privileges, though I suspect it already has them since it can place the new downloaded war file in that directory. Hope that helps.

          Daniel Beck added a comment -

          Peter: Do you remember the Jenkins version you originally installed, and could look up the creation + last modification dates of jenkins.exe? AFAIK there is a (now resolved) bug that prevented that from getting updated on Jenkins update, and one of the fixed issues was a failure to restart Jenkins as well. So this appears to be an outdated jenkins.exe.

          Current jenkins.exe should have a date from early April, assuming it doesn't get changed when packaged into Jenkins.

          Daniel Beck added a comment - Peter: Do you remember the Jenkins version you originally installed, and could look up the creation + last modification dates of jenkins.exe? AFAIK there is a (now resolved) bug that prevented that from getting updated on Jenkins update, and one of the fixed issues was a failure to restart Jenkins as well. So this appears to be an outdated jenkins.exe. Current jenkins.exe should have a date from early April, assuming it doesn't get changed when packaged into Jenkins.

            hp Halvor Platou
            kristoffer Kristoffer Peterhänsel
            Votes:
            4 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: