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

Failure to rewrite files during rekeying on Windows Server 2003 R2

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • Jenkins as a Windows service on Windows Server 2003 R2 Standard Edition (32-bit) with Service Pack 2

      In an upgrade from Jenkins 1.487 to 1.500 the rekey operation fails due to being unable to rewrite the necessary files. This seems to be the same or similar to the issue resolved in JENKINS-16319, which was included in the Jenkins 1.500 release. I seem to be unable to upgrade beyond Jenkins 1.497, as this problem first occurred in an attempted upgrade from Jenkins 1.497 to 1.498. The re-key log is as follows:

      Started re-keying Wed Jan 09 10:13:00 CST 2013
      Scanning E:\Jenkins\config.xml
      ERROR: Failed to rewrite E:\Jenkins\config.xml
      java.io.IOException: Unable to delete E:\Jenkins\config.xml
      at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112)
      at hudson.util.SecretRewriter.rewrite(SecretRewriter.java:121)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:170)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:143)
      at jenkins.security.RekeySecretAdminMonitor$RekeyThread.run(RekeySecretAdminMonitor.java:182)
      Scanning E:\Jenkins\jobs\BuildAllFromTrunk\builds\2012-12-11_06-16-44\changelog.xml
      Scanning E:\Jenkins\jobs\MakeCustomerService\builds\2012-12-15_06-40-38\changelog.xml
      Scanning E:\Jenkins\jobs\MakeCustomerService\builds\2013-01-08_06-40-28\changelog.xml
      Scanning E:\Jenkins\jobs\MakeFlash\builds\2012-12-29_07-07-22\build.xml
      Scanning E:\Jenkins\jobs\MakeImageOne\builds\2012-12-18_10-16-06\changelog.xml
      Scanning E:\Jenkins\jobs\MakeMsgProc\builds\2012-12-11_07-07-21\build.xml
      Scanning E:\Jenkins\jobs\MakeMsgProc\builds\2013-01-03_05-35-18\build.xml
      Scanning E:\Jenkins\jobs\MakePortal\builds\2012-12-20_07-21-50\changelog.xml
      Scanning E:\Jenkins\jobs\MakePrintAndPopcorn\builds\2012-12-13_10-33-18\build.xml
      Scanning E:\Jenkins\jobs\MakePrintAndPopcorn\builds\2013-01-05_07-07-37\build.xml
      Scanning E:\Jenkins\jobs\MakeTools\builds\2012-12-19_06-41-33\changelog.xml
      Scanning E:\Jenkins\jobs\MakeWeb\builds\2012-12-13_05-35-40\build.xml
      Scanning E:\Jenkins\jobs\MakeWeb\builds\2013-01-05_05-34-53\build.xml
      Scanning E:\Jenkins\jobs\RefreshBranchSourceCode\builds\2012-12-13_07-01-20\changelog.xml
      Scanning E:\Jenkins\jobs\RefreshBranchSourceCode\builds\2012-12-15_07-01-41\changelog.xml
      Scanning E:\Jenkins\jobs\RefreshBranchSourceCode\builds\2012-12-20_06-16-43\changelog.xml
      Scanning E:\Jenkins\jobs\RefreshBranchSourceCode\builds\2012-12-27_07-01-46\changelog.xml
      Scanning E:\Jenkins\jobs\RefreshBranchSourceCode\builds\2013-01-03_05-31-58\changelog.xml
      Scanning E:\Jenkins\jobs\RefreshBranchSourceCode\builds\2013-01-08_05-31-46\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-11_06-16-45\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-13_06-01-10\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-14_06-48-53\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-15_07-01-37\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-18_07-00-54\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-20_06-16-38\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-24_09-27-10\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-28_05-31-39\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2012-12-30_06-16-41\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2013-01-03_05-59-52\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2013-01-05_06-48-03\changelog.xml
      Scanning E:\Jenkins\jobs\UnregisterAllBranches\builds\2013-01-08_06-16-39\changelog.xml
      ERROR: Failed to rewrite E:\Jenkins\proxy.xml
      java.io.IOException: Unable to delete E:\Jenkins\proxy.xml
      at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112)
      at hudson.util.SecretRewriter.rewrite(SecretRewriter.java:121)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:170)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:143)
      at jenkins.security.RekeySecretAdminMonitor$RekeyThread.run(RekeySecretAdminMonitor.java:182)
      ERROR: Failed to rewrite E:\Jenkins\users\agoldberg\config.xml
      java.io.IOException: Unable to delete E:\Jenkins\users\agoldberg\config.xml
      at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112)
      at hudson.util.SecretRewriter.rewrite(SecretRewriter.java:121)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:170)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:182)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:182)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:143)
      at jenkins.security.RekeySecretAdminMonitor$RekeyThread.run(RekeySecretAdminMonitor.java:182)
      ERROR: Failed to rewrite E:\Jenkins\users\build\config.xml
      java.io.IOException: Unable to delete E:\Jenkins\users\build\config.xml
      at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112)
      at hudson.util.SecretRewriter.rewrite(SecretRewriter.java:121)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:170)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:182)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:182)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:143)
      at jenkins.security.RekeySecretAdminMonitor$RekeyThread.run(RekeySecretAdminMonitor.java:182)
      ERROR: Failed to rewrite E:\Jenkins\users\dodren\config.xml
      java.io.IOException: Unable to delete E:\Jenkins\users\dodren\config.xml
      at hudson.util.AtomicFileWriter.commit(AtomicFileWriter.java:112)
      at hudson.util.SecretRewriter.rewrite(SecretRewriter.java:121)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:170)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:182)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:182)
      at hudson.util.SecretRewriter.rewriteRecursive(SecretRewriter.java:143)
      at jenkins.security.RekeySecretAdminMonitor$RekeyThread.run(RekeySecretAdminMonitor.java:182)
      Completed re-keying 0 files on Wed Jan 09 10:13:21 CST 2013

          [JENKINS-16560] Failure to rewrite files during rekeying on Windows Server 2003 R2

          Jesse Glick added a comment -

          Judging by the lines in the stack trace, you are still running with the old code (1.498/1.499), not with what was included in 1.500. Does the Jenkins UI really claim to be 1.500?

          Jesse Glick added a comment - Judging by the lines in the stack trace, you are still running with the old code (1.498/1.499), not with what was included in 1.500. Does the Jenkins UI really claim to be 1.500?

          David Odren added a comment - - edited

          I was at 1.497 and told Jenkins to upgrade automatically to 1.500, then restart Jenkins. After Jenkins restarted, the version reported at the bottom of the page was 1.500. (I even repeated the test again this morning to make sure it wasn't reporting 1.498, which is where the original problem occurred for me weeks ago.)

          David Odren added a comment - - edited I was at 1.497 and told Jenkins to upgrade automatically to 1.500, then restart Jenkins. After Jenkins restarted, the version reported at the bottom of the page was 1.500. (I even repeated the test again this morning to make sure it wasn't reporting 1.498, which is where the original problem occurred for me weeks ago.)

          shinsato added a comment -

          I worked around this issue by re-keying in the background after the initial failure.

          shinsato added a comment - I worked around this issue by re-keying in the background after the initial failure.

          David Odren added a comment -

          Thank you shinsato! I was able to work around the issue by re-keying the the background as well.

          David Odren added a comment - Thank you shinsato! I was able to work around the issue by re-keying the the background as well.

            Unassigned Unassigned
            dodren David Odren
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: