[JIRA] (JENKINS-57945) p4 sync corrupts symlinks

28 views
Skip to first unread message

mrose@sjm.com (JIRA)

unread,
Jun 10, 2019, 5:52:02 PM6/10/19
to jenkinsc...@googlegroups.com
Michael Rose created an issue
 
Jenkins / Bug JENKINS-57945
p4 sync corrupts symlinks
Issue Type: Bug Bug
Assignee: Paul Allen
Components: p4-plugin
Created: 2019-06-10 21:51
Environment: Jenkins ver. 2.138.2
p4 plugin 1.10.0
Priority: Major Major
Reporter: Michael Rose

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
[mrose@bld0010 ~]$ 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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mrose@sjm.com (JIRA)

unread,
Jun 10, 2019, 6:13:03 PM6/10/19
to jenkinsc...@googlegroups.com
Michael Rose updated an issue
Change By: Michael Rose
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.
{quote}*$ ls -l /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf*
-r--r--r-- 1 jenkins-agent jenkins 23 Jun 10 09:51 /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf
[mrose@bld0010 ~] $ cat /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf
no_integ/coverity.conf
{quote}

When the "checkout scm" works, the output looks like this
{quote}*$ 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
{quote}

mrose@sjm.com (JIRA)

unread,
Jun 10, 2019, 6:13:03 PM6/10/19
to jenkinsc...@googlegroups.com
Michael Rose updated an issue
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.
{quote}*$ ls -l /jenkins/workspace/e_dev-KK246RZWMFT6CWJS6OTBGLMLTACX7NHSGHICXOVCAFVC6S2TK3RA/coverity.conf*
-r--r--r-- 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
{quote}
When the "checkout scm" works, the output looks like this
{quote}*$ 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
{quote}

mrose@sjm.com (JIRA)

unread,
Jun 10, 2019, 6:15:02 PM6/10/19
to jenkinsc...@googlegroups.com
Michael Rose commented on Bug JENKINS-57945
 
Re: p4 sync corrupts symlinks

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

kwirth@perforce.com (JIRA)

unread,
Jun 11, 2019, 4:45:02 AM6/11/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Labels: P4_SUPPORT

kwirth@perforce.com (JIRA)

unread,
Jun 11, 2019, 4:45:02 AM6/11/19
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Karl Wirth
Change By: Karl Wirth
Assignee: Paul Allen Karl Wirth

kwirth@perforce.com (JIRA)

unread,
Jun 11, 2019, 4:47:02 AM6/11/19
to jenkinsc...@googlegroups.com

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

kwirth@perforce.com (JIRA)

unread,
Jun 11, 2019, 6:50:03 AM6/11/19
to jenkinsc...@googlegroups.com
Karl Wirth updated an issue
Change By: Karl Wirth
Labels: P4_SUPPORT P4_A

kwirth@perforce.com (JIRA)

unread,
Jun 11, 2019, 6:50:03 AM6/11/19
to jenkinsc...@googlegroups.com

Michael Rose Thanks again. Problem reproduced.

 

Reproduction steps:

(1) mkdir linktest

(2) cd linktest

(3) echo Content > target.txt

(4) ln -s target.txt link

(5) p4 add * && p4 submit -d "Adding links"

(6) 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'
        }
      }
    }
  }
}

(7) 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 11 10:27 link

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

lrwxrwxrwx 1 jenkins jenkins   20 Jun 11 10:33 link -> target.txt

 

 

kwirth@perforce.com (JIRA)

unread,
Jun 11, 2019, 6:50:03 AM6/11/19
to jenkinsc...@googlegroups.com
Karl Wirth assigned an issue to Unassigned
Change By: Karl Wirth
Assignee: Karl Wirth

msmeeth@perforce.com (JIRA)

unread,
Jun 12, 2019, 8:55:02 AM6/12/19
to jenkinsc...@googlegroups.com

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)

mrose@sjm.com (JIRA)

unread,
Jun 12, 2019, 9:00:02 AM6/12/19
to jenkinsc...@googlegroups.com

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

kwirth@perforce.com (JIRA)

unread,
Jun 12, 2019, 10:55:02 AM6/12/19
to jenkinsc...@googlegroups.com
Karl Wirth edited a comment on Bug JENKINS-57945
[~mrose] 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

(
4 7 ) cd ../links

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

(
5 9 ) cd ..

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

(
6 11 ) Create a new pipeline job that maps the 'linktest' directory. For example:
{code:java}

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'
        }
      }
    }
  }
}
{code}
(
7 12 ) When job runs with 'p4sync' the 'link' file is a plain text file containing the word 'target.txt':
{code:java}
-r--r--r-- 1 jenkins jenkins 20 Jun
11 10 12 15 : 27 51 link{code}

When job runs with 'checkout' the file is a symlink:
{code:java}
lrwxrwxrwx 1 jenkins jenkins   20 Jun
11 10 12 15 : 33 53 link -> ../source/ target.txt

{code}
 

 

kwirth@perforce.com (JIRA)

unread,
Jun 12, 2019, 11:52:02 AM6/12/19
to jenkinsc...@googlegroups.com

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?

heiko.nardmann@itechnical.de (JIRA)

unread,
Jul 3, 2019, 11:40:02 AM7/3/19
to jenkinsc...@googlegroups.com

I have the same problem.

Jenkins v2.107.3.
P4 plugin v1.10.0.

heiko.nardmann@itechnical.de (JIRA)

unread,
Jul 3, 2019, 11:43:02 AM7/3/19
to jenkinsc...@googlegroups.com
Heiko Nardmann edited a comment on Bug JENKINS-57945
I have the same problem.

Jenkins v2.107.3.
P4 plugin v1.10.0.

pallen@perforce.com (JIRA)

unread,
Jul 15, 2019, 6:26:03 AM7/15/19
to jenkinsc...@googlegroups.com
Paul Allen closed an issue as Fixed
 

Released in 1.10.2

Change By: Paul Allen
Status: Open Closed
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages