• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • Jenkins ver 2.89.2
      java.version 1.8.0_51 (Oracle 64bit on RHEL6.6 [master])
      P4 Plugin 1.8.4

      It appears that when the workspace is cleaned by Jenkins after/before use, the targets of symlinks are deleted, but the symlinks themselves are not.

      We now have most workspaces containing dead symlinks - some of which were checked out of the Perforce repository, and some created during the build process (when they had valid targets). None of the symlinks point outside of the workspace - most (all?) are to another file/directory in the same parent directory.

      These builds are driven by Jenkinsfiles as DSL pipeline scripts.

      Explict error – build failure due to Archive trying to fingerprint a broken symlink.

          [JENKINS-49393] Broken symlinks in reused workspaces

          Simon Watts added a comment -

          Note that some symlinks are cleaned out, while others are not.  It is possible that this is related to whether the symlink or target is processed first.

          Simon Watts added a comment - Note that some symlinks are cleaned out, while others are not.  It is possible that this is related to whether the symlink or target is processed first.

          Karl Wirth added a comment -

          If you have a current support contract please email support@perforce.com so I can look at your job description and file mix in more detail.

          Karl Wirth added a comment - If you have a current support contract please email support@perforce.com so I can look at your job description and file mix in more detail.

          Karl Wirth added a comment -

          Working with Simon on this issue.

          Karl Wirth added a comment - Working with Simon on this issue.

          Karl Wirth added a comment -

          Thanks to Simon easily reproduced the problem. Think it may be a bug in P4Java because the command in the log is correct:

          p4 reconcile -w -f FILEPATH
          

          With P4 client synlinks are correctly cleaned up using this command.

           

          Reproductions steps:

          • Create a freestyle job using 'Auto cleanup and sync' setting.
          • Submit a file called f1 to path.
          • Manually run job
          • Go to build slave workspace and create following files and symlinks:
          echo A > A
          echo B > B
          echo C > C
          ln -s A Alink
          ln -s B ABlink
          ln -s A XAlink
          
          
          • Edit and submit f1 from own workspace.
          • Manually run job.
          • No error is seen but following files are left behind:

           

          drwxr-xr-x  2 jenkins jenkins 4096 Feb 16 16:55 .
          drwxr-xr-x 13 jenkins jenkins 4096 Feb 16 16:44 ..
          lrwxrwxrwx  1 jenkins jenkins    1 Feb 16 16:49 Alink -> A
          -r--r--r--  1 jenkins jenkins  275 Feb 16 16:55 f1
          lrwxrwxrwx  1 jenkins jenkins    1 Feb 16 16:49 XAlink -> A
          
          

           

           

          Karl Wirth added a comment - Thanks to Simon easily reproduced the problem. Think it may be a bug in P4Java because the command in the log is correct: p4 reconcile -w -f FILEPATH With P4 client synlinks are correctly cleaned up using this command.   Reproductions steps: Create a freestyle job using 'Auto cleanup and sync' setting. Submit a file called f1 to path. Manually run job Go to build slave workspace and create following files and symlinks: echo A > A echo B > B echo C > C ln -s A Alink ln -s B ABlink ln -s A XAlink Edit and submit f1 from own workspace. Manually run job. No error is seen but following files are left behind:   drwxr-xr-x  2 jenkins jenkins 4096 Feb 16 16:55 . drwxr-xr-x 13 jenkins jenkins 4096 Feb 16 16:44 .. lrwxrwxrwx  1 jenkins jenkins    1 Feb 16 16:49 Alink -> A -r--r--r--  1 jenkins jenkins  275 Feb 16 16:55 f1 lrwxrwxrwx  1 jenkins jenkins    1 Feb 16 16:49 XAlink -> A    

          Paul Allen added a comment -

          Verified P4Java bug P4JAVA-1151

          Paul Allen added a comment - Verified P4Java bug P4JAVA-1151

          Code changed in jenkins
          User: Paul Allen
          Path:
          pom.xml
          http://jenkins-ci.org/commit/p4-plugin/ce840a7fe46684e3040be85869d46172d1fe811d
          Log:
          Update P4Java to 2017.2.1635107

          Fix for ShiftJIS charset JENKINS-49916
          Reconcile -w cleanup of symlinks JENKINS-49393

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: pom.xml http://jenkins-ci.org/commit/p4-plugin/ce840a7fe46684e3040be85869d46172d1fe811d Log: Update P4Java to 2017.2.1635107 Fix for ShiftJIS charset JENKINS-49916 Reconcile -w cleanup of symlinks JENKINS-49393

          Paul Allen added a comment -

          Ready for release.

          Paul Allen added a comment - Ready for release.

          Paul Allen added a comment -

          Released in 1.8.7

          Paul Allen added a comment - Released in 1.8.7

            p4paul Paul Allen
            simon_watts Simon Watts
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: