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

Build records not migrated due to “failed to rename” on Windows

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core
    • None
    • 1.597 on Windows

      After updating from 1.596 to 1.597 I seem to have wrong "last success" timestamps. See attached images.

        1. 2014-11-26_03-40-28 build.xml
          5 kB
        2. build.png
          build.png
          6 kB
        3. builds directory.jpg
          builds directory.jpg
          170 kB
        4. Error Log SH - 3953 .txt
          902 kB
        5. jenkins.err.log_on-startup.txt
          119 kB
        6. job.dir.txt
          0.8 kB
        7. job-builds.dir.txt
          0.8 kB
        8. lastSuccess.png
          lastSuccess.png
          6 kB
        9. tag-builds-dir.txt
          1 kB

          [JENKINS-26519] Build records not migrated due to “failed to rename” on Windows

          Jesse Glick added a comment -

          Confusingly, for Windows on Java 6, 1, 2, etc. were created as true symlinks; the text files with build numbers were only used for permalinks like lastStableBuild, meaning my attempted fix in 056b446 was pointless and can probably just be reverted. (One of the unusual cases where “reopening” a bug is really correct.)

          Jesse Glick added a comment - Confusingly, for Windows on Java 6, 1 , 2 , etc. were created as true symlinks; the text files with build numbers were only used for permalinks like lastStableBuild , meaning my attempted fix in 056b446 was pointless and can probably just be reverted. (One of the unusual cases where “reopening” a bug is really correct.)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/jenkins/model/RunIdMigrator.java
          core/src/test/java/jenkins/model/RunIdMigratorTest.java
          http://jenkins-ci.org/commit/jenkins/388c4b5e6ba52037cae117c5c69f9f4156d41401
          Log:
          [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6.
          In this environment, Util.createSymlink and .isSymlink are implemented, but resolveSymlink is not.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/jenkins/model/RunIdMigrator.java core/src/test/java/jenkins/model/RunIdMigratorTest.java http://jenkins-ci.org/commit/jenkins/388c4b5e6ba52037cae117c5c69f9f4156d41401 Log: [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6. In this environment, Util.createSymlink and .isSymlink are implemented, but resolveSymlink is not.

          Jesse Glick added a comment -

          tdtappe I think your problem is now fixed in this build, toward 1.600. If you confirm I will try to backport it to the 1.599 release candidate branch so it gets out earlier.

          martouf My latest fix might help in your case, but since you say you are running Java 8, you should not have been hitting it to begin with. Your symptoms are similar; the root cause may or may not be related. I would suggest trying once again with my newest build, assuming you still have the original build directories to reproduce against. First be sure to enable fine logging on this component.

          Jesse Glick added a comment - tdtappe I think your problem is now fixed in this build , toward 1.600. If you confirm I will try to backport it to the 1.599 release candidate branch so it gets out earlier. martouf My latest fix might help in your case, but since you say you are running Java 8, you should not have been hitting it to begin with. Your symptoms are similar; the root cause may or may not be related. I would suggest trying once again with my newest build, assuming you still have the original build directories to reproduce against. First be sure to enable fine logging on this component.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3958
          [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6. (Revision 388c4b5e6ba52037cae117c5c69f9f4156d41401)

          Result = SUCCESS
          jesse glick : 388c4b5e6ba52037cae117c5c69f9f4156d41401
          Files :

          • changelog.html
          • core/src/test/java/jenkins/model/RunIdMigratorTest.java
          • core/src/main/java/jenkins/model/RunIdMigrator.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3958 [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6. (Revision 388c4b5e6ba52037cae117c5c69f9f4156d41401) Result = SUCCESS jesse glick : 388c4b5e6ba52037cae117c5c69f9f4156d41401 Files : changelog.html core/src/test/java/jenkins/model/RunIdMigratorTest.java core/src/main/java/jenkins/model/RunIdMigrator.java

          Heiko Tappe added a comment -

          Yeah! That's it. No more 45 year old builds
          Thank you so much for your efforts. I very much appreciate it!

          --Heiko

          Heiko Tappe added a comment - Yeah! That's it. No more 45 year old builds Thank you so much for your efforts. I very much appreciate it! --Heiko

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/jenkins/model/RunIdMigrator.java
          core/src/test/java/jenkins/model/RunIdMigratorTest.java
          http://jenkins-ci.org/commit/jenkins/4a75e058bafd3cd98832a2a129c9f23c71d26f55
          Log:
          JENKINS-26519 Attempting to improve diagnostics in case rename fails.
          (cherry picked from commit 0633beef0868c59a7e853731aee5f5c0745fa3fc)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/jenkins/model/RunIdMigrator.java core/src/test/java/jenkins/model/RunIdMigratorTest.java http://jenkins-ci.org/commit/jenkins/4a75e058bafd3cd98832a2a129c9f23c71d26f55 Log: JENKINS-26519 Attempting to improve diagnostics in case rename fails. (cherry picked from commit 0633beef0868c59a7e853731aee5f5c0745fa3fc)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/jenkins/model/RunIdMigrator.java
          http://jenkins-ci.org/commit/jenkins/22dc8add0e106d100a73c16cb628f1c5d1f94538
          Log:
          JENKINS-26519 More diagnostics in case a numeric rename target already exists.
          (cherry picked from commit 75c8c31f2fdc98081a0446dd3ee03da7243304a1)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/jenkins/model/RunIdMigrator.java http://jenkins-ci.org/commit/jenkins/22dc8add0e106d100a73c16cb628f1c5d1f94538 Log: JENKINS-26519 More diagnostics in case a numeric rename target already exists. (cherry picked from commit 75c8c31f2fdc98081a0446dd3ee03da7243304a1)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/jenkins/model/RunIdMigrator.java
          core/src/test/java/jenkins/model/RunIdMigratorTest.java
          http://jenkins-ci.org/commit/jenkins/7f82ab94a4f6247abaf9f65998360be5c3136bf8
          Log:
          [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6.
          In this environment, Util.createSymlink and .isSymlink are implemented, but resolveSymlink is not.
          (cherry picked from commit 388c4b5e6ba52037cae117c5c69f9f4156d41401)

          Conflicts:
          changelog.html

          Compare: https://github.com/jenkinsci/jenkins/compare/1debf06fe6d6...7f82ab94a4f6

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/jenkins/model/RunIdMigrator.java core/src/test/java/jenkins/model/RunIdMigratorTest.java http://jenkins-ci.org/commit/jenkins/7f82ab94a4f6247abaf9f65998360be5c3136bf8 Log: [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6. In this environment, Util.createSymlink and .isSymlink are implemented, but resolveSymlink is not. (cherry picked from commit 388c4b5e6ba52037cae117c5c69f9f4156d41401) Conflicts: changelog.html Compare: https://github.com/jenkinsci/jenkins/compare/1debf06fe6d6...7f82ab94a4f6

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3961
          JENKINS-26519 Attempting to improve diagnostics in case rename fails. (Revision 4a75e058bafd3cd98832a2a129c9f23c71d26f55)
          JENKINS-26519 More diagnostics in case a numeric rename target already exists. (Revision 22dc8add0e106d100a73c16cb628f1c5d1f94538)
          [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6. (Revision 7f82ab94a4f6247abaf9f65998360be5c3136bf8)

          Result = SUCCESS
          jesse glick : 4a75e058bafd3cd98832a2a129c9f23c71d26f55
          Files :

          • core/src/main/java/jenkins/model/RunIdMigrator.java
          • core/src/test/java/jenkins/model/RunIdMigratorTest.java

          jesse glick : 22dc8add0e106d100a73c16cb628f1c5d1f94538
          Files :

          • core/src/main/java/jenkins/model/RunIdMigrator.java

          jesse glick : 7f82ab94a4f6247abaf9f65998360be5c3136bf8
          Files :

          • core/src/test/java/jenkins/model/RunIdMigratorTest.java
          • core/src/main/java/jenkins/model/RunIdMigrator.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3961 JENKINS-26519 Attempting to improve diagnostics in case rename fails. (Revision 4a75e058bafd3cd98832a2a129c9f23c71d26f55) JENKINS-26519 More diagnostics in case a numeric rename target already exists. (Revision 22dc8add0e106d100a73c16cb628f1c5d1f94538) [FIXED JENKINS-26519] Build record migration failed on Windows using Java 6. (Revision 7f82ab94a4f6247abaf9f65998360be5c3136bf8) Result = SUCCESS jesse glick : 4a75e058bafd3cd98832a2a129c9f23c71d26f55 Files : core/src/main/java/jenkins/model/RunIdMigrator.java core/src/test/java/jenkins/model/RunIdMigratorTest.java jesse glick : 22dc8add0e106d100a73c16cb628f1c5d1f94538 Files : core/src/main/java/jenkins/model/RunIdMigrator.java jesse glick : 7f82ab94a4f6247abaf9f65998360be5c3136bf8 Files : core/src/test/java/jenkins/model/RunIdMigratorTest.java core/src/main/java/jenkins/model/RunIdMigrator.java changelog.html

          FYI: I ran into this same issue on CentOS 6.5. Old directories had symlinks like:
          lrwxrwxrwx. 1 jenkins jenkins 19 Apr 22 09:06 401 -> 2015-04-22_09-06-23

          New directories looked like:
          drwxr-xr-x. 2 jenkins jenkins 4096 Mar 1 01:28 317

          The UI showed the old builds as having run before I was born! In order to re-run the migration I did the following:
          sudo find /var/lib/jenkins/ -name legacyIds -delete
          sudo service jenkins restart

          Once this was done things looked correct.

          Forest Handford added a comment - FYI: I ran into this same issue on CentOS 6.5. Old directories had symlinks like: lrwxrwxrwx. 1 jenkins jenkins 19 Apr 22 09:06 401 -> 2015-04-22_09-06-23 New directories looked like: drwxr-xr-x. 2 jenkins jenkins 4096 Mar 1 01:28 317 The UI showed the old builds as having run before I was born! In order to re-run the migration I did the following: sudo find /var/lib/jenkins/ -name legacyIds -delete sudo service jenkins restart Once this was done things looked correct.

            jglick Jesse Glick
            tdtappe Heiko Tappe
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: