Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.138.2
      p4 plugin 1.10.0
    • Similar Issues:

      Description

      The "checkout scm" pipeline task when used for the p4plugin intermittently corrupts symlinks. Instead of create a symlink, it seems that the "p4 sync" is create a text file and the content of the file is the destination that the symlink would point to.

      $ ls -l /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf
      rrr- 1 jenkins-agent jenkins 23 Jun 10 09:51 /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf
      $ cat /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf
      no_integ/coverity.conf

      When the "checkout scm" works, the output looks like this

      $ ls -l /jenkins/workspace/dev-ZKMEBZTMPZSI7NMLJWXPTTFRX3Z67EZAASPHONVQ32DG2EV3MQDQ/coverity.conf
      lrwxrwxrwx. 1 jenkins-agent jenkins 22 May 27 03:08 /jenkins/workspace/dev-ZKMEBZTMPZSI7NMLJWXPTTFRX3Z67EZAASPHONVQ32DG2EV3MQDQ/coverity.conf -> no_integ/coverity.conf

        Attachments

          Activity

          Hide
          mrose Michael Rose added a comment -

          This issue only started happening after we updated p4 plugin from 1.9.6 to 10.0.0.

          Show
          mrose Michael Rose added a comment - This issue only started happening after we updated p4 plugin from 1.9.6 to 10.0.0.
          Hide
          p4karl Karl Wirth added a comment -

          Hi Michael Rose - Thanks for letting us know. I will qualify this then get dev involved.

          Show
          p4karl Karl Wirth added a comment - Hi Michael Rose - Thanks for letting us know. I will qualify this then get dev involved.
          Hide
          p4karl Karl Wirth added a comment - - edited

          Michael Rose Thanks again. Problem reproduced.

           

          Reproduction steps:

          (1) mkdir linktest

          (2) cd linktest

          (3) mkdir source

          (4) mkdir links

          (5) cd source

          (6) echo Content > target.txt

          (7) cd ../links

          (8) ln -s ../source/target.txt link

          (9) cd ..

          (10) p4 add ... && p4 submit -d "Adding links"

          (11) Create a new pipeline job that maps the 'linktest' directory. For example:

          pipeline {
            agent { label 'master' }
            stages {
              stage("Repro") {
                steps {
                  script {
                      // Try same sync with checkout and p4sync. Swap by commenting out command not being tested.
                      
                     // p4sync charset: 'none', credential: 'Jenkins', populate: forceClean(have: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: false), source: depotSource('//depot/testlink/...')
          
                      checkout perforce(credential: 'Jenkins', populate: forceClean(have: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: false), workspace: manualSpec(charset: 'none', cleanup: false, name: 'jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}', pinHost: false, spec: clientSpec(allwrite: false, backup: true, changeView: '', clobber: true, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, serverID: '', streamName: '', type: 'WRITABLE', view: '//depot/testlink/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...')))
                      
                      // List directory contents
                      sh 'ls -lR'
                  }
                }
              }
            }
          }
          

          (12) When job runs with 'p4sync' the 'link' file is a plain text file containing the word 'target.txt':

          -r--r--r-- 1 jenkins jenkins 20 Jun 12 15:51 link

          When job runs with 'checkout' the file is a symlink:

          lrwxrwxrwx 1 jenkins jenkins   20 Jun 12 15:53 link -> ../source/target.txt
          

           

           

          Show
          p4karl Karl Wirth added a comment - - edited Michael Rose Thanks again. Problem reproduced.   Reproduction steps: (1) mkdir linktest (2) cd linktest (3) mkdir source (4) mkdir links (5) cd source (6) echo Content > target.txt (7) cd ../links (8) ln -s ../source/target.txt link (9) cd .. (10) p4 add ... && p4 submit -d "Adding links" (11) Create a new pipeline job that maps the 'linktest' directory. For example: pipeline { agent { label 'master' } stages { stage( "Repro" ) { steps { script { // Try same sync with checkout and p4sync. Swap by commenting out command not being tested. // p4sync charset: 'none' , credential: 'Jenkins' , populate: forceClean(have: false , parallel: [enable: false , minbytes: '1024' , minfiles: '1' , threads: '4' ], pin: '', quiet: false ), source: depotSource(' //depot/testlink/...') checkout perforce(credential: 'Jenkins' , populate: forceClean(have: false , parallel: [enable: false , minbytes: '1024' , minfiles: '1' , threads: '4' ], pin: '', quiet: false ), workspace: manualSpec(charset: ' none ', cleanup: false , name: ' jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER} ', pinHost: false , spec: clientSpec(allwrite: false , backup: true , changeView: ' ', clobber: true , compress: false , line: ' LOCAL ', locked: false , modtime: false , rmdir: false , serverID: ' ', streamName: ' ', type: ' WRITABLE ', view: ' //depot/testlink/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/...'))) // List directory contents sh 'ls -lR' } } } } } (12) When job runs with 'p4sync' the 'link' file is a plain text file containing the word 'target.txt': -r--r--r-- 1 jenkins jenkins 20 Jun 12 15:51 link When job runs with 'checkout' the file is a symlink: lrwxrwxrwx 1 jenkins jenkins 20 Jun 12 15:53 link -> ../source/target.txt    
          Hide
          msmeeth Matthew Smeeth added a comment -

          Hi Michael,

          Do you possibly have text files nested within your symlinks?

          for example:

          //depot/path/symlink#1 (symlink) 
          //depot/path/symlink/textfile#1 (text)
          Show
          msmeeth Matthew Smeeth added a comment - Hi Michael, Do you possibly have text files nested within your symlinks? for example: //depot/path/symlink#1 (symlink) //depot/path/symlink/textfile#1 (text)
          Hide
          mrose Michael Rose added a comment -

          No. The symlink is to a file. There is no version where it was a folder.

          Show
          mrose Michael Rose added a comment - No. The symlink is to a file. There is no version where it was a folder.
          Hide
          p4karl Karl Wirth added a comment -

          Hi Michael Rose - Matthew Smeeth was uanble to repro this on 2.166 so I just tried upgrading my Jenkins to 2.164.2 and it seems to have solved the problem. Therefore this looks like a Jenkins bug or at least related to the version of Java it ships with or other dependencies.

          Are you able to upgrade jenkins to confirm this?

          Show
          p4karl Karl Wirth added a comment - Hi Michael Rose - Matthew Smeeth was uanble to repro this on 2.166 so I just tried upgrading my Jenkins to 2.164.2 and it seems to have solved the problem. Therefore this looks like a Jenkins bug or at least related to the version of Java it ships with or other dependencies. Are you able to upgrade jenkins to confirm this?
          Hide
          heiko_nardmann Heiko Nardmann added a comment - - edited

          I have the same problem.

          Jenkins v2.107.3.
          P4 plugin v1.10.0.

          Does v1.10.1 fix that problem? See https://github.com/jenkinsci/p4-plugin/blob/master/RELEASE.md.

          Show
          heiko_nardmann Heiko Nardmann added a comment - - edited I have the same problem. Jenkins v2.107.3. P4 plugin v1.10.0. Does v1.10.1 fix that problem? See https://github.com/jenkinsci/p4-plugin/blob/master/RELEASE.md .
          Hide
          p4paul Paul Allen added a comment -

          Released in 1.10.2

          Show
          p4paul Paul Allen added a comment - Released in 1.10.2

            People

            • Assignee:
              Unassigned
              Reporter:
              mrose Michael Rose
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: