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

LastSuccessful and LastStable symlinks are invalid under Windows

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Windows Server 2008, NTFS, Jenkins runs as Windows Service

      The lastStable and LastSuccessful links are created as invalid symlinks with no destination under Windows. These Files cause the backup to fail, since they are not valid and cause all sorts of zip archivers to fail.

          [JENKINS-17681] LastSuccessful and LastStable symlinks are invalid under Windows

          Jesse Glick added a comment -

          @frankroghair a couple of problems were fixed here. Other problems affecting certain people may well remain, but it would be better to file them separately (with whatever details to reproduce you can muster) and link to this issue.

          Jesse Glick added a comment - @frankroghair a couple of problems were fixed here. Other problems affecting certain people may well remain, but it would be better to file them separately (with whatever details to reproduce you can muster) and link to this issue.

          Joe Knudsen added a comment -

          See issue JENKINS-20725 for an issue with the Maven Plugin that still exists in 1.509.4

          Joe Knudsen added a comment - See issue JENKINS-20725 for an issue with the Maven Plugin that still exists in 1.509.4

          This issue still exists – but running this command at an admin prompt fixes it.

          fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1

          We pushed this out via group policy on our domain to fix it generally, but it is annoying on non-domain machines.

          Josh Santangelo added a comment - This issue still exists – but running this command at an admin prompt fixes it. fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1 We pushed this out via group policy on our domain to fix it generally, but it is annoying on non-domain machines.

          Joe Knudsen added a comment -

          Josh,
          Are you seeing this for a Maven build or in other areas. Take a look at the issue JENKINS-20725 and vote that up if that is what your also experiencing.

          Joe Knudsen added a comment - Josh, Are you seeing this for a Maven build or in other areas. Take a look at the issue JENKINS-20725 and vote that up if that is what your also experiencing.

          Jesse Glick added a comment -

          @endquote Jenkins tries to create symlinks where it can, otherwise falling back to text files. I am not quite sure what you are reporting but it sounds like a different issue. Best to file it separately with steps to reproduce, and of course a pull request to fix it if you can manage.

          Jesse Glick added a comment - @endquote Jenkins tries to create symlinks where it can, otherwise falling back to text files. I am not quite sure what you are reporting but it sounds like a different issue. Best to file it separately with steps to reproduce, and of course a pull request to fix it if you can manage.

          @jesse @joe – My apologies, I'm pretty new to Jenkins and I don't really know how Maven fits in. I'm not specifically doing anything with Maven, but maybe it's involved in all builds?

          The behavior that I'm seeing is that these symlinks can't be followed in the Windows Explorer GUI without applying that fsutil command above. Further, if I look at them from a command line, I see this:

          01/09/2014 05:22 PM <SYMLINK> lastFailedBuild [-1]
          01/10/2014 01:02 PM <SYMLINKD> lastStableBuild [162]
          01/10/2014 01:02 PM <SYMLINKD> lastSuccessfulBuild [162]
          01/05/2014 03:14 PM <SYMLINK> lastUnstableBuild [-1]
          01/09/2014 05:22 PM <SYMLINK> lastUnsuccessfulBuild [-1]

          A regular symlink would show the target of the link instead of a numeric code. I am trying to parse the target in a deployment script.

          If I should enter this bug elsewhere, let me know. Thanks for responding.

          Josh Santangelo added a comment - @jesse @joe – My apologies, I'm pretty new to Jenkins and I don't really know how Maven fits in. I'm not specifically doing anything with Maven, but maybe it's involved in all builds? The behavior that I'm seeing is that these symlinks can't be followed in the Windows Explorer GUI without applying that fsutil command above. Further, if I look at them from a command line, I see this: 01/09/2014 05:22 PM <SYMLINK> lastFailedBuild [-1] 01/10/2014 01:02 PM <SYMLINKD> lastStableBuild [162] 01/10/2014 01:02 PM <SYMLINKD> lastSuccessfulBuild [162] 01/05/2014 03:14 PM <SYMLINK> lastUnstableBuild [-1] 01/09/2014 05:22 PM <SYMLINK> lastUnsuccessfulBuild [-1] A regular symlink would show the target of the link instead of a numeric code. I am trying to parse the target in a deployment script. If I should enter this bug elsewhere, let me know. Thanks for responding.

          Expanding on the above directory listing, note how the links to build numbers show the target, but the "last*" ones don't.

          01/10/2014 02:25 PM <DIR> .
          01/10/2014 02:25 PM <DIR> ..
          01/09/2014 02:09 PM <SYMLINKD> 152 [2014-01-09_14-08-58]
          01/09/2014 03:24 PM <SYMLINKD> 153 [2014-01-09_15-24-00]
          01/09/2014 03:29 PM <SYMLINKD> 154 [2014-01-09_15-29-22]
          01/09/2014 03:44 PM <SYMLINKD> 155 [2014-01-09_15-44-02]
          01/09/2014 04:09 PM <SYMLINKD> 156 [2014-01-09_16-09-01]
          01/09/2014 05:19 PM <SYMLINKD> 157 [2014-01-09_17-19-02]
          01/09/2014 06:29 PM <SYMLINKD> 158 [2014-01-09_18-28-59]
          01/10/2014 11:09 AM <SYMLINKD> 159 [2014-01-10_11-09-02]
          01/10/2014 12:31 PM <SYMLINKD> 160 [2014-01-10_12-31-32]
          01/10/2014 12:49 PM <SYMLINKD> 161 [2014-01-10_12-48-59]
          01/10/2014 12:58 PM <SYMLINKD> 162 [2014-01-10_12-58-51]
          01/09/2014 02:12 PM <DIR> 2014-01-09_14-08-58
          01/09/2014 03:27 PM <DIR> 2014-01-09_15-24-00
          01/09/2014 03:33 PM <DIR> 2014-01-09_15-29-22
          01/09/2014 03:47 PM <DIR> 2014-01-09_15-44-02
          01/09/2014 04:12 PM <DIR> 2014-01-09_16-09-01
          01/09/2014 05:22 PM <DIR> 2014-01-09_17-19-02
          01/09/2014 06:32 PM <DIR> 2014-01-09_18-28-59
          01/10/2014 11:13 AM <DIR> 2014-01-10_11-09-02
          01/10/2014 12:35 PM <DIR> 2014-01-10_12-31-32
          01/10/2014 12:52 PM <DIR> 2014-01-10_12-48-59
          01/10/2014 01:02 PM <DIR> 2014-01-10_12-58-51
          01/08/2014 10:24 PM <DIR> archive
          01/09/2014 05:22 PM <SYMLINK> lastFailedBuild [-1]
          01/10/2014 01:02 PM <SYMLINKD> lastStableBuild [162]
          01/10/2014 01:02 PM <SYMLINKD> lastSuccessfulBuild [162]
          01/05/2014 03:14 PM <SYMLINK> lastUnstableBuild [-1]
          01/09/2014 05:22 PM <SYMLINK> lastUnsuccessfulBuild [-1]

          Josh Santangelo added a comment - Expanding on the above directory listing, note how the links to build numbers show the target, but the "last*" ones don't. 01/10/2014 02:25 PM <DIR> . 01/10/2014 02:25 PM <DIR> .. 01/09/2014 02:09 PM <SYMLINKD> 152 [2014-01-09_14-08-58] 01/09/2014 03:24 PM <SYMLINKD> 153 [2014-01-09_15-24-00] 01/09/2014 03:29 PM <SYMLINKD> 154 [2014-01-09_15-29-22] 01/09/2014 03:44 PM <SYMLINKD> 155 [2014-01-09_15-44-02] 01/09/2014 04:09 PM <SYMLINKD> 156 [2014-01-09_16-09-01] 01/09/2014 05:19 PM <SYMLINKD> 157 [2014-01-09_17-19-02] 01/09/2014 06:29 PM <SYMLINKD> 158 [2014-01-09_18-28-59] 01/10/2014 11:09 AM <SYMLINKD> 159 [2014-01-10_11-09-02] 01/10/2014 12:31 PM <SYMLINKD> 160 [2014-01-10_12-31-32] 01/10/2014 12:49 PM <SYMLINKD> 161 [2014-01-10_12-48-59] 01/10/2014 12:58 PM <SYMLINKD> 162 [2014-01-10_12-58-51] 01/09/2014 02:12 PM <DIR> 2014-01-09_14-08-58 01/09/2014 03:27 PM <DIR> 2014-01-09_15-24-00 01/09/2014 03:33 PM <DIR> 2014-01-09_15-29-22 01/09/2014 03:47 PM <DIR> 2014-01-09_15-44-02 01/09/2014 04:12 PM <DIR> 2014-01-09_16-09-01 01/09/2014 05:22 PM <DIR> 2014-01-09_17-19-02 01/09/2014 06:32 PM <DIR> 2014-01-09_18-28-59 01/10/2014 11:13 AM <DIR> 2014-01-10_11-09-02 01/10/2014 12:35 PM <DIR> 2014-01-10_12-31-32 01/10/2014 12:52 PM <DIR> 2014-01-10_12-48-59 01/10/2014 01:02 PM <DIR> 2014-01-10_12-58-51 01/08/2014 10:24 PM <DIR> archive 01/09/2014 05:22 PM <SYMLINK> lastFailedBuild [-1] 01/10/2014 01:02 PM <SYMLINKD> lastStableBuild [162] 01/10/2014 01:02 PM <SYMLINKD> lastSuccessfulBuild [162] 01/05/2014 03:14 PM <SYMLINK> lastUnstableBuild [-1] 01/09/2014 05:22 PM <SYMLINK> lastUnsuccessfulBuild [-1]

          Jesse Glick added a comment -

          <SYMLINK> lastFailedBuild [-1]
          <SYMLINKD> lastStableBuild [162]

          looks right to me. There are no failed builds, which the bogus target -1 indicates. The last stable build is #162, so lastStableBuild links to that (which is itself a symlink to the actual build directory, 2014-01-10_12-58-51).

          Whether or not the Explorer GUI allows (valid) symlinks to be traversed is a secondary consideration, so long as Jenkins code can read the symlink target.

          Jesse Glick added a comment - <SYMLINK> lastFailedBuild [-1] <SYMLINKD> lastStableBuild [162] looks right to me. There are no failed builds, which the bogus target -1 indicates. The last stable build is #162, so lastStableBuild links to that (which is itself a symlink to the actual build directory, 2014-01-10_12-58-51 ). Whether or not the Explorer GUI allows (valid) symlinks to be traversed is a secondary consideration, so long as Jenkins code can read the symlink target.

          You know, you're right. I was misinterpreting that number. This should work fine for my needs.

          The issue with explorer not following the links by default is real, though.

          Josh Santangelo added a comment - You know, you're right. I was misinterpreting that number. This should work fine for my needs. The issue with explorer not following the links by default is real, though.

          Jesse Glick added a comment -

          If you can find a command which can be run as the Jenkins user which detects whether the fsutil command needs be run (as an administrator), file an RFE for Jenkins to warn you of this, most simply via a console warning but ideally using an AdministrativeMonitor. (Even better would be for Jenkins to offer to run it after you supply an administrator login, using the Windows equivalent of sudo if there is such a thing.)

          Jesse Glick added a comment - If you can find a command which can be run as the Jenkins user which detects whether the fsutil command needs be run (as an administrator), file an RFE for Jenkins to warn you of this, most simply via a console warning but ideally using an AdministrativeMonitor . (Even better would be for Jenkins to offer to run it after you supply an administrator login, using the Windows equivalent of sudo if there is such a thing.)

            jglick Jesse Glick
            fabian_tietz Fabian Tietz
            Votes:
            0 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: