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

checkout with scm: perforce, fails in parallel pipelines

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None

      I have a multi-branch pipeline job configured with a Jenkins declarative pipeline script. The script will disable the default checkout, and perform a checkout in a separate stage/step in the declarative pipeline. 

      The nodes involved are a mix of Linux, Windows and Mac VMs or physical devices. Jenkins is setup on a Linux VM with each of the build-nodes are dispatched via a Jenkins Remote agent (configured via SSH). This setup works well for all other jobs when run individually.

      When running a checkout on each of the nodes, the process fails (maybe now 1 in a 100 builds), where it cannot resolve the root of the client workspace to that of a different machine. 

       

      ERROR: P4: Task Exception: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):
      Path '/var/lib/jenkins/workspace/Project/...' is not under client's root '/Users/jenkins/workspace/Project'.
      

      This exception happens when the Mac pipeline is cleaning up 

      post {
         cleanup {
             cleanup(true)
         }
      }

      And when another Linux pipeline is concurrently executing 

      checkout (changelog: false, poll: false, scm: perforce (
          credentials: 'Credentials-Perforce',
          populate: autoClean (
              delete: true,
              parallel: [
                 enable: true,
                 minbytes: '1024',
                 minfiles: '1',
                 threads: '4],
              pin: change,
              quiet: true,
              tidy: true),
          workspace: manualSpec (
              name: P4_CLIENT,       // locally defined variable
              spec: cl_spec),        // globally defined variable
          browser: swarm('url'))) 

       

      It appears that somehow the p4-plugin is using variables in the pipeline that "leaks" over to other stages when run in parallel. 

      It's the Linux checkout that encounters the use of the wrong path. Note that the Mac and Linux configurations differs in their paths, e.g. Mac: /Users/jenkins/workspace/Project vs. Linux: /var/lib/Jenkins/workspace/Project.

       

      p4 Task: reverting all pending and shelved revisions.
      ... p4 revert /var/lib/jenkins/workspace/Project/... +
      /var/lib/jenkins/workspace/Project/... - file(s) not opened on this client.
      ... rm [abandoned files]
      duration: (9ms)
      
      P4 Task: cleaning workspace to match have list.
      ... p4 reconcile -f -w /var/lib/jenkins/workspace/Project/... +
      duration: 0m 14s
      
      P4 Task: syncing files at change: 317521
      ... p4 sync --parallel=threads=4,min=1,minsize=1024 -q /var/lib/jenkins/workspace/Proj___ +
      Path '/var/lib/jenkins/workspace/Project/...' is not under client's root '/Users/netmotiontest/workspace/Project'.
      
      P4 Task: attempt: 1
      
      P4: Task Exception: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: 
      
      P4JAVA: Error(s):
      Path '/var/lib/jenkins/workspace/Project/...' is not under client's root '/Users/jenkins/workspace/Project'. 

            Unassigned Unassigned
            enaess Eivind
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: