• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Jenkins 2.46.2
      openjdk 1.8.0
      ubnutu 16.04 lts
    • 2.198

      I maintain few jenkinses, various versions (2.x). Some of jobs on them publish artifacts even when build result is failure. Using jenkins UI I can access artifacts via http url

      JENKINS_URL/job/jobname/lastCompletedBuild/artifact/file.ext

      But I need to access this artifact directly from filesystem where artifacts are stored, in my case it is custom path:

      /mnt/jenkins/builds/jobname/lastCompletedBuild/archive/file.ext

      On disk, lastCompletedBuild symlink is not created. I still can access the file, but I have to know build number. The same is for lastBuild. To sum up: it works for lastCompletedBuild, lastUnstableBuild, lastFailedBuild, lastUnsuccessfulBuild. All shorthand urls from job page have their respective symlinks created, except lastCompletedBuild.

      Is it intentional?

          [JENKINS-56809] No lastCompletedBuild symlink

          Jesse Glick added a comment -

          Not sure offhand, but note that as of JENKINS-37862 in new versions of Jenkins, symlinks are not created at all. If you have some need for them, you need to install the Build Symlink plugin. If you have any issues with that, file them in that component (though I would consider it a very low priority).

          Jesse Glick added a comment - Not sure offhand, but note that as of JENKINS-37862 in new versions of Jenkins, symlinks are not created at all. If you have some need for them, you need to install the Build Symlink plugin. If you have any issues with that, file them in that component (though I would consider it a very low priority).

          Jesse Glick added a comment -

          Note that normally you would use the Copy Artifact plugin and not mess around with $JENKINS_HOME.

          Jesse Glick added a comment - Note that normally you would use the Copy Artifact plugin and not mess around with $JENKINS_HOME .

          Daniel Jeznach added a comment - - edited

          Thanks for explaining. Still, I don't see new solution handles lastCompletedBuild.

          Copy Artifact does not satisfy me, because I need to access files directly on filesystem, before jenkins handles it (I use reverse proxy to intercept /artifact/ url).

          For my test job, I found there is permalinks file created, which can be use as symlinks equivalent, this is great, so I don't need to install plugin, but its contents is:

          lastFailedBuild -1
          lastStableBuild 2
          lastSuccessfulBuild 2
          lastUnstableBuild -1
          lastUnsuccessfulBuild -1

          As you can see, no lastCompletedBuild entry, but when I type lastCompletedBuild in build URL (/job/test/lastCompletedBuild/), it's handled correctly. So it seems inconsistent to me.

          Daniel Jeznach added a comment - - edited Thanks for explaining. Still, I don't see new solution handles lastCompletedBuild. Copy Artifact does not satisfy me, because I need to access files directly on filesystem, before jenkins handles it (I use reverse proxy to intercept /artifact/ url). For my test job, I found there is permalinks file created, which can be use as symlinks equivalent, this is great, so I don't need to install plugin, but its contents is: lastFailedBuild -1 lastStableBuild 2 lastSuccessfulBuild 2 lastUnstableBuild -1 lastUnsuccessfulBuild -1 As you can see, no lastCompletedBuild entry, but when I type lastCompletedBuild in build URL (/job/test/lastCompletedBuild/), it's handled correctly. So it seems inconsistent to me.

          Jesse Glick added a comment -

          I need to access files directly on filesystem

          This is not supported. If somehow works this way for you, fine, but it may not, or may stop working in the future.

          While a lastCompletedBuild is defined in the code as of JENKINS-26270, it is not actually used by Job.getLastCompletedBuild(), which is odd. But LAST_COMPLETED_BUILD is in the BUILTIN list which is normally updated by PeepholePermalink.RunListenerImpl.onCompleted; I think the actual issue here is that LAST_COMPLETED_BUILD is a general Permalink and not a PeepholePermalink.

          Jesse Glick added a comment - I need to access files directly on filesystem This is not supported. If somehow works this way for you, fine, but it may not, or may stop working in the future. While a lastCompletedBuild is defined in the code as of JENKINS-26270 , it is not actually used by Job.getLastCompletedBuild() , which is odd. But LAST_COMPLETED_BUILD is in the BUILTIN list which is normally updated by PeepholePermalink.RunListenerImpl.onCompleted ; I think the actual issue here is that LAST_COMPLETED_BUILD is a general Permalink and not a PeepholePermalink .

          I need to access files directly on filesystem

          This is not supported. If somehow works this way for you, fine, but it may not, or may stop working in the future.

          I'm fully aware, that it's not supported. I saw the missing links issue has been fixed, thank you.

          Daniel Jeznach added a comment - I need to access files directly on filesystem This is not supported. If somehow works this way for you, fine, but it may not, or may stop working in the future. I'm fully aware, that it's not supported. I saw the missing links issue has been fixed, thank you.

            jglick Jesse Glick
            daniel_jeznach_img Daniel Jeznach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: