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

Exception sync'ing global pipeline library with new project

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins 2.89.2
      P4 Plugin 1.8.4
      Pipeline 2.5
    • Similar Issues:

      Description

      I've seen this a couple of times now – when first building a new project in Jenkins, an exception is thrown when loading the global pipeline library used by all our projects.  This does not happen every time.  There seems to be some confusion with the exception mentioning a job folder for a different project (see below).

      The exception has not been seen to reoccur when another build is triggered immediately after this failure (this may be due to the low frequency of this occurance).  We have not seen this type of failure in projects which are not new – so seems related to the initial checkout?

      Note that no other projects where building at the time, and none where scheduled to build.  The 'ANOTHERPROJECT' in the logs below was not recently rebuilt, and is not lexcially close to the project being built.

      Complete log for the initial failed build (with named redacted):

      Started by user anonymous
      Obtained DEPOT/PROJECT/Jenkinsfile from p4-HASH-PROJECT
      Running in Durability level: MAX_SURVIVABILITY
      Loading library LIBRARY@1.0
      (p4):cmd:... p4 client -o extlib-LIBRARY
      p4 client -o extlib-LIBRARY
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 client -o extlib-LIBRARY
      p4 client -o extlib-LIBRARY
      
      (p4):stop:6
      (p4):cmd:... p4 client -i
      p4 client -i
      
      Client extlib-LIBRARY saved.
      
      (p4):stop:7
      ... client: extlib-LIBRARY
      (p4):cmd:... p4 client -o extlib-LIBRARY
      p4 client -o extlib-LIBRARY
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      (p4):cmd:... p4 counter change
      p4 counter change
      
      (p4):stop:6
      (p4):cmd:... p4 changes -m1 -ssubmitted //extlib-LIBRARY/...
      p4 changes -m1 -ssubmitted //extlib-LIBRARY/...
      
      Change 4138936 on 2018/02/09 by USER@WORKSPACE 'JENKINS : enablePerforce() - re'
      (p4):stop:7
      (p4):cmd:... p4 repos -C
      p4 repos -C
      
      (p4):stop:8
      Building on Node: master
      (p4):cmd:... p4 client -o extlib-LIBRARY
      p4 client -o extlib-LIBRARY
      
      (p4):stop:4
      (p4):cmd:... p4 info
      p4 info
      
      (p4):stop:5
      
      P4 Task: establishing connection.
      ... server: PERFORCE:5500
      ... node: NODE
      
      P4 Task: reverting all pending and shelved revisions.
      (p4):cmd:... p4 revert /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...
      p4 revert /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...
      
      /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/... - file(s) not opened on this client.
      
      (p4):stop:6
      ... rm [abandoned files]
      duration: (230ms)
      
      P4 Task: cleaning workspace to match have list.
      (p4):cmd:... p4 reconcile -w -f /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/..___
      p4 reconcile -w -f /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...
      
      Path '/var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...' is not under client's root '/var/lib/jenkins/jobs/ANOTHERPROJECT'.
      
      No file(s) to reconcile.
      
      (p4):stop:7
      duration: (229ms)
      
      P4 Task: syncing files at change: 4138936
      (p4):cmd:... p4 sync -q /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...@413893___
      p4 sync -q /var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...@4138936
      
      Path '/var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...' is not under client's root '/var/lib/jenkins/jobs/ANOTHERPROJECT'.
      
      (p4):stop:8
      P4 Task: attempt: 1
      P4 Task: failed: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):
      Path '/var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...' is not under client's root '/var/lib/jenkins/jobs/ANOTHERPROJECT'.
      
      ERROR: P4 Task: failed: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):
      Path '/var/lib/jenkins/workspace/PROJECT%40libs/LIBRARY/...' is not under client's root '/var/lib/jenkins/jobs/ANOTHERPROJECT'.
      
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: Loading libraries failed
      
      1 error
      
      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:133)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:557)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:518)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:290)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:421)
      Finished: FAILURE

      Workaround:

      Rebuild the project.

        Attachments

          Activity

            People

            • Assignee:
              p4paul Paul Allen
              Reporter:
              simon_watts Simon Watts
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: