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

Jenkins 2.168 prevent HTML Publisher to copy html report from agent to master

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core

      Hi there,

       

      After updating Jenkins to version 2.168 I started experiencing build failure using the html publisher plugin

       

      publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'target', reportFiles: 'docs/index.html', reportName: 'SmartRoaming API', reportTitles: ''])

       

      Would result into the following console output and build failure:

       

      08:26:47  [htmlpublisher] Archiving at BUILD level C:/Jenkins2/workspace/t_RDSFTUKTCL_comms-app-api_PR-12/smart-roaming-api/target to /var/lib/jenkins/jobs/Bitbucket Project/jobs/RDSFTUKTCL/jobs/comms-app-api/branches/PR-12/builds/14/htmlreports/SmartRoaming_20API
      08:26:47  ERROR: Directory 'C:/Jenkins2/workspace/t_RDSFTUKTCL_comms-app-api_PR-12/smart-roaming-api/target' exists but failed copying to '/var/lib/jenkins/jobs/Bitbucket Project/jobs/RDSFTUKTCL/jobs/comms-app-api/branches/PR-12/builds/14/htmlreports/SmartRoaming_20API'. 

       

      Downgrading Jenkins to version 2.167 fixes the issue.

       

      Would you please advise/support me with that matter?

       

       

          [JENKINS-56578] Jenkins 2.168 prevent HTML Publisher to copy html report from agent to master

          rvangoethem just to check, do you actually have a duplicate `publishHTML` in your Jenkinsfile or is that just a typo on the issue description?

          Richard Bywater added a comment - rvangoethem just to check, do you actually have a duplicate `publishHTML` in your Jenkinsfile or is that just a typo on the issue description?

          Typo sorry! 

          Remi Van Goethem added a comment - Typo sorry! 

          Oleg Nenashev added a comment -

          JENKINS-56114 is likely a root cause, CC wfollonier

          Oleg Nenashev added a comment - JENKINS-56114 is likely a root cause, CC wfollonier

          I upped the priority because it will stop everyone using HTMLPublisher to update to version > 2.167

          Remi Van Goethem added a comment - I upped the priority because it will stop everyone using HTMLPublisher to update to version > 2.167

          Remi Van Goethem added a comment - - edited

          `reportDir` is not descending into subdirectories, so it misses files; if `reportFiles` are in subdirectories then the build fails

           

          This was observed on a Windows 2012 R2 but works on any of our Linux agents. Not sure the platform is relevant here, because it might not be.

          Our agent workspace is in a RAM disk under a directory junction.

           
          C:\Jenkins2 is a directory junction to E:\Jenkins2
          E:\Jenkins2\workspace is a symlink to RAMDISK R:

          the Jenkins build runs in C:\Jenkins2\workspace\<job build folder>

          {{}}

          By fixing Docker simlink JENKINS-56114 has broken regular symlink as it ignores the value with a LinkOption.NOFOLLOW_LINKS
          https://github.com/jenkinsci/jenkins/commit/5562b2fec6428b730a7b88ad6390a7ed741ba792#diff-d0a9bd4f4582762fd1d1f31a88d4753cR3345

           

          Should they be using java.nio.file.Files.readSymbolicLink instead?

          Remi Van Goethem added a comment - - edited `reportDir` is not descending into subdirectories, so it misses files; if ` reportFiles` are in subdirectories then the build fails   This was observed on a Windows 2012 R2 but works on any of our Linux agents. Not sure the platform is relevant here, because it might not be. Our agent workspace is in a RAM disk under a directory junction.   C:\Jenkins2 is a directory junction to E:\Jenkins2 E:\Jenkins2\workspace is a symlink to RAMDISK R: the Jenkins build runs in C:\Jenkins2\workspace\<job build folder> {{}} By fixing Docker simlink  JENKINS-56114 has broken regular symlink as it ignores the value with a LinkOption.NOFOLLOW_LINKS https://github.com/jenkinsci/jenkins/commit/5562b2fec6428b730a7b88ad6390a7ed741ba792#diff-d0a9bd4f4582762fd1d1f31a88d4753cR3345   Should they be using java.nio.file.Files.readSymbolicLink instead?

          rvangoethem are you able to confirm if this is still an issue in newer versions of Jenkins? (wfollonier are you able to confirm that it should be fixed?)

          Richard Bywater added a comment - rvangoethem are you able to confirm if this is still an issue in newer versions of Jenkins? ( wfollonier are you able to confirm that it should be fixed?)

          Hi r2b2_nz, I cannot confirm this because we worked around the problem by avoiding using simlink... 

          You can check if the "fix" in place for Docker is still present on latest version because it is definitely responsible for the issue observed.

          Remi Van Goethem added a comment - Hi  r2b2_nz , I cannot confirm this because we worked around the problem by avoiding using simlink...  You can check if the "fix" in place for Docker is still present on latest version because it is definitely responsible for the issue observed.

          Sorry r2b2_nz but I did not get any time to work on that issue, it's still in our backlog but not a priority yet.
          Avoiding using symlinks is a good strategy from my PoV.

          Wadeck Follonier added a comment - Sorry r2b2_nz but I did not get any time to work on that issue, it's still in our backlog but not a priority yet. Avoiding using symlinks is a good strategy from my PoV.

          Jeff Thompson added a comment - - edited

          (I deleted this comment because it looks like I misread who was saying what. I'll try again.)

          Jeff Thompson added a comment - - edited (I deleted this comment because it looks like I misread who was saying what. I'll try again.)

          Jeff Thompson added a comment -

          This does look like something caused by a change in Jenkins 2.168. I don't think it has anything to do with htmlpublisher plugin, so I've removed it from the components field. Specifically it is highly likely that the change for JENKINS-56114 caused this. This is similar to JENKINS-56249. Though the exact manifestations and cause are different, they concern the same areas of code.

          I'll see if I can figure something out to make it work better. It may take a while to get that change put together.

           

           

          Jeff Thompson added a comment - This does look like something caused by a change in Jenkins 2.168. I don't think it has anything to do with htmlpublisher plugin, so I've removed it from the components field. Specifically it is highly likely that the change for  JENKINS-56114  caused this. This is similar to  JENKINS-56249 . Though the exact manifestations and cause are different, they concern the same areas of code. I'll see if I can figure something out to make it work better. It may take a while to get that change put together.    

            wfollonier Wadeck Follonier
            rvangoethem Remi Van Goethem
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: