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

          Hide
          p4paul Paul Allen added a comment -

          I don't think polling is a factor, it looks more like concurrent builds using the same client for global libraries; this might be related to JENKINS-49047

          There is a fix coming in the next release, where the Global Library workspace is unique by path.  However, it may still cause an issue for concurrent builds using the same library.  In an ideal would Jenkins would use the Lightweight checkout for global libraries and not SCM checkouts.

          If you want to try it ahead of the release the latest p4.hpi file is built here: https://ci.jenkins.io/job/Plugins/job/p4-plugin/job/master/

          Show
          p4paul Paul Allen added a comment - I don't think polling is a factor, it looks more like concurrent builds using the same client for global libraries; this might be related to JENKINS-49047 .  There is a fix coming in the next release, where the Global Library workspace is unique by path.  However, it may still cause an issue for concurrent builds using the same library.  In an ideal would Jenkins would use the Lightweight checkout for global libraries and not SCM checkouts. If you want to try it ahead of the release the latest p4.hpi file is built here:  https://ci.jenkins.io/job/Plugins/job/p4-plugin/job/master/
          Hide
          simon_watts Simon Watts added a comment -

          Just encountered this behaviour in an established project from an overnight build – the console output is attached as JENKINS-49525-1.txt (with names redacted).  In this case there is evidence that 'ANOTHERPROJECT' was built successfully at around the same time and the 'PROJECT' which failed.

          These projects are using template workspaces defined in Perforce, and are not using light weight checkout.  Other projects where also built at around the same time (successfully or failing due to code errors).

          Show
          simon_watts Simon Watts added a comment - Just encountered this behaviour in an established project from an overnight build – the console output is attached as  JENKINS-49525-1.txt  (with names redacted).  In this case there is evidence that 'ANOTHERPROJECT' was built successfully at around the same time and the 'PROJECT' which failed. These projects are using template workspaces defined in Perforce, and are not using light weight checkout.  Other projects where also built at around the same time (successfully or failing due to code errors).
          Hide
          p4paul Paul Allen added a comment -

          Hi Simon,

          Please can you raise a support ticket (support@perforce.com) and verify the plugin version e.g. 1.8.6, feel free to CC me (pallen)

          Do you use Global Pipeline Libraries?

             Jenkins>Manage Jenkins>Global Configuration>Global Pipeline Libraries

          I recently added a fix to reduce the chance of this bug, however I have the feeling it may occur in some circumstances.  My concern is around the Perforce client workspace used by Jenkins to sync the Library (pre-build) and what happens if another Job is syncing the same library at the same time.  Jenkins recently added lightweight checkout to Pipeline builds for fetching the Jenkinsfile, this would be perfect for Libraries, but I can't see a way to use it. 

           

          Show
          p4paul Paul Allen added a comment - Hi Simon, Please can you raise a support ticket (support@perforce.com) and verify the plugin version e.g. 1.8.6, feel free to CC me (pallen) Do you use Global Pipeline Libraries?    Jenkins>Manage Jenkins>Global Configuration>Global Pipeline Libraries I recently added a fix to reduce the chance of this bug, however I have the feeling it may occur in some circumstances.  My concern is around the Perforce client workspace used by Jenkins to sync the Library (pre-build) and what happens if another Job is syncing the same library at the same time.  Jenkins recently added lightweight checkout to Pipeline builds for fetching the Jenkinsfile, this would be perfect for Libraries, but I can't see a way to use it.   
          Hide
          p4karl Karl Wirth added a comment -

          Working with Simon on this. Not explicitly the SyncID bug but need to check if that fix solves the problem.

          Show
          p4karl Karl Wirth added a comment - Working with Simon on this. Not explicitly the SyncID bug but need to check if that fix solves the problem.
          Hide
          p4karl Karl Wirth added a comment -

          Cannot reproduce the problem but I do see we use the same workspace name to sync the libarries but different locations:

          $ p4 print -a //spec/client/jenkins-library.p4s | grep Root | grep -v "#"
          Root:    /var/lib/jenkins/workspace/FirstJob%40libs/my-shared-library  
          Root:    /var/lib/jenkins/workspace/AnotherJob%40libs/my-shared-library
          

          Note in the above the same client 'jenkins-library' is used by both jobs to sync the shared library but the workspace 'Root:' is being changed to be a variation on the job name.

          This could in theorey cause a problem so should be changed.

           

          FYI - My global library configuration:

          Possible resolutions:

          • Plugin uses one global location workspace rooted in the same place based on Library Name (although Paul may have said Jenkins does not expose this information).
          • Plugin uses one global library directory per library per job (don't know what the jenkins sync rules are for global libraries).
          Show
          p4karl Karl Wirth added a comment - Cannot reproduce the problem but I do see we use the same workspace name to sync the libarries but different locations: $ p4 print -a //spec/client/jenkins-library.p4s | grep Root | grep -v "#" Root:    / var /lib/jenkins/workspace/FirstJob%40libs/my-shared-library Root:    / var /lib/jenkins/workspace/AnotherJob%40libs/my-shared-library Note in the above the same client 'jenkins-library' is used by both jobs to sync the shared library but the workspace 'Root:' is being changed to be a variation on the job name. This could in theorey cause a problem so should be changed.   FYI - My global library configuration: Possible resolutions : Plugin uses one global location workspace rooted in the same place based on Library Name (although Paul may have said Jenkins does not expose this information). Plugin uses one global library directory per library per job (don't know what the jenkins sync rules are for global libraries).
          Hide
          simon_watts Simon Watts added a comment -

          We are now seeing this quite a bit when something triggers a lot of projects to rebuild.  Currently running on the latest plugins and Jenkins 2.107.2.  Same exception as given in the description.

          Show
          simon_watts Simon Watts added a comment - We are now seeing this quite a bit when something triggers a lot of projects to rebuild.  Currently running on the latest plugins and Jenkins 2.107.2.  Same exception as given in the description.
          Hide
          simon_watts Simon Watts added a comment -

          This issue is endemic when rescanning a multibranch project.  This project is held in GIT, the extension library (bgcc2-jenkins) is in Perforce.

          P4 Task: reverting all pending and shelved revisions.
          ... p4 revert /var/lib/jenkins/workspace/BRANCH-1-GAFQCT573WQMGSBML7___ +
          ERROR: P4JAVA: Error(s):
          Path '/var/lib/jenkins/workspace/BRANCH-1-GAFQCT573WQMGSBML7R37GK3WADSCORFBC2467UU4GSCQZTSWGGQ%40libs/bgc2-jenkins/...' is not under client's root '/var/lib/jenkins/workspace/BRANCH-2-FYEJFRRKPOT6CMEXIOQQ6W4RHD2EEZUQ6PS2JLHAT46TN6ZAZYAA%40libs/bgc2-jenkins'.
          
          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:131)
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          Show
          simon_watts Simon Watts added a comment - This issue is endemic when rescanning a multibranch project.  This project is held in GIT, the extension library (bgcc2-jenkins) is in Perforce. P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/BRANCH-1-GAFQCT573WQMGSBML7___ + ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/BRANCH-1-GAFQCT573WQMGSBML7R37GK3WADSCORFBC2467UU4GSCQZTSWGGQ%40libs/bgc2-jenkins/...' is not under client's root '/var/lib/jenkins/workspace/BRANCH-2-FYEJFRRKPOT6CMEXIOQQ6W4RHD2EEZUQ6PS2JLHAT46TN6ZAZYAA%40libs/bgc2-jenkins'. 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:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
          Hide
          simon_watts Simon Watts added a comment - - edited

          To follow up from this...

          I noticed that the libraries where configured to use the "Legacy SCM" method in Jenkins global configuration.  When set up I didn't realized that "Helix" is an alias for Perforce.

          So I have now tried changing to "Modern SCM" method, using "now" as the version (successfully identified by Jenkins).

          However I now get a different error when the implicit library is loaded:

           

          Obtained Jenkinsfile from af39698113dd5a786c3f362f93c33eacb0b455ca
          Running in Durability level: MAX_SURVIVABILITY
          Loading library bgc2-jenkins@now
          ... p4 changes -m1 //DistributedDevelopment/generic/jenkins/libs/bgc2-jenkins-1.0/.../.___ +
          ... p4 client -o jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenki___ +
          P4: Unable to use Workspace: com.perforce.p4java.exception.RequestException: Wildcards (*, %%%%x, ...) not allowed in 'jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenkins-1.0....'.
          
          ... p4 info +
          ... p4 client -o jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenki___ +
          P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Wildcards (*, %%%%x, ...) not allowed in 'jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenkins-1.0....'.
          
          ERROR: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Wildcards (*, %%%%x, ...) not allowed in 'jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenkins-1.0....'.
          
          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:131)
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE

          Again, the Jenkins extension library is held in Perforce – while the project being built is held in GIT.  However I see the same error when building another project also hosted in Perforce.

          Configuration of the shared library is as follows:

          • Name = bgc2-jenkins
          • Default version = now (currently maps to revision 4171459)
          • Load implicitly = true
          • Allow default version to be overridden = true
          • Include @Library changes in the job recent changes = true
          • Retrieval method = Modern SCM:
            • Helix Library
            • Perforce Credentials = (same as used for source code)
            • Character Set = none
            • Library Depot Path = //DistributedDevelopment/generic/jenkins/libs/bgc2-jenkins-1.0/...

           


           

          UPDATE:

          The issue was with the "Library Depot Path".  This should not include the trailing '/...' wildcard!

          The help associated with this time in the interface does include the '/...' in the example however (which is why I had entered it as such).  BUG

          The example in the P4 plugin source does not include the wildcard.

          Show
          simon_watts Simon Watts added a comment - - edited To follow up from this... I noticed that the libraries where configured to use the "Legacy SCM" method in Jenkins global configuration.  When set up I didn't realized that "Helix" is an alias for Perforce. So I have now tried changing to "Modern SCM" method, using "now" as the version (successfully identified by Jenkins). However I now get a different error when the implicit library is loaded:   Obtained Jenkinsfile from af39698113dd5a786c3f362f93c33eacb0b455ca Running in Durability level: MAX_SURVIVABILITY Loading library bgc2-jenkins@now ... p4 changes -m1 //DistributedDevelopment/generic/jenkins/libs/bgc2-jenkins-1.0/.../.___ + ... p4 client -o jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenki___ + P4: Unable to use Workspace: com.perforce.p4java.exception.RequestException: Wildcards (*, %%%%x, ...) not allowed in 'jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenkins-1.0....'. ... p4 info + ... p4 client -o jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenki___ + P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Wildcards (*, %%%%x, ...) not allowed in 'jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenkins-1.0....'. ERROR: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Wildcards (*, %%%%x, ...) not allowed in 'jenkins-library.DistributedDevelopment.generic.jenkins.libs.bgc2-jenkins-1.0....'. 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:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE Again, the Jenkins extension library is held in Perforce – while the project being built is held in GIT.  However I see the same error when building another project also hosted in Perforce. Configuration of the shared library is as follows: Name = bgc2-jenkins Default version = now (currently maps to revision 4171459) Load implicitly = true Allow default version to be overridden = true Include @Library changes in the job recent changes = true Retrieval method = Modern SCM: Helix Library Perforce Credentials = (same as used for source code) Character Set = none Library Depot Path = //DistributedDevelopment/generic/jenkins/libs/bgc2-jenkins-1.0 /...     UPDATE: The issue was with the "Library Depot Path".  This should not include the trailing '/...' wildcard! The help associated with this time in the interface does include the '/...' in the example however (which is why I had entered it as such).  BUG The example in the P4 plugin source does not include the wildcard.
          Hide
          simon_watts Simon Watts added a comment -

          Spoke too soon.

          Now using the "Modern SCM" to sync the extension library from Perforce; this works in singular cases, but we are still getting errors with concurrent jobs.  In this case, when the Multibranch Plugin rescans branches in a GIT hosted Java project.

          Sample error from logs:

          P4 Task: establishing connection.
          ... server: perforce.xxxx.com:5500
          ... node: xxxx
          
          P4 Task: reverting all pending and shelved revisions.
          ... p4 revert /var/lib/jenkins/workspace/x_System_Build_MATCHBOX-411-EFMJRDIAGFDTWBE32H___ +ERROR: P4JAVA: Error(s):
          Path '/var/lib/jenkins/workspace/x_System_Build_MATCHBOX-411-EFMJRDIAGFDTWBE32HH3RZLDFDWRVAG5TKEI2E3VLRA5ENPUEFUA%40libs/bgc2-jenkins/...' is not under client's root '/var/lib/jenkins/workspace/7-3-state-price-vis-4-state-4DR53P4IMDYIWKA3QKG6AIEBT3DF7X3K4AFR4SLWS6JUMLMNB5AA%40libs/bgc2-jenkins'.
          
          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:131)
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE

          Jenkins version 2.107.2, plugins up-to-date at time of build (2018-06-26).

          Show
          simon_watts Simon Watts added a comment - Spoke too soon. Now using the "Modern SCM" to sync the extension library from Perforce; this works in singular cases, but we are still getting errors with concurrent jobs.  In this case, when the Multibranch Plugin rescans branches in a GIT hosted Java project. Sample error from logs: P4 Task: establishing connection. ... server: perforce.xxxx.com:5500 ... node: xxxx P4 Task: reverting all pending and shelved revisions. ... p4 revert /var/lib/jenkins/workspace/x_System_Build_MATCHBOX-411-EFMJRDIAGFDTWBE32H___ +ERROR: P4JAVA: Error(s): Path '/var/lib/jenkins/workspace/x_System_Build_MATCHBOX-411-EFMJRDIAGFDTWBE32HH3RZLDFDWRVAG5TKEI2E3VLRA5ENPUEFUA%40libs/bgc2-jenkins/...' is not under client's root '/var/lib/jenkins/workspace/7-3-state-price-vis-4-state-4DR53P4IMDYIWKA3QKG6AIEBT3DF7X3K4AFR4SLWS6JUMLMNB5AA%40libs/bgc2-jenkins'. 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:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:325) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE Jenkins version 2.107.2, plugins up-to-date at time of build (2018-06-26).
          Hide
          edeleff Emily Deleff added a comment -

          I am experiencing the same issue with concurrent builds. This works as expected in isolation but any case with multiple jobs being triggered at the same time will result in failure. The first job succeeds while the second one running at the same time fails because the root on the jenkins-libarary workspace is still set to the first one.

          The failed cases have been triggered by either polling or periodic trigger.

          ERROR: P4 Task: failed: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):
          Path 'jenkins/workspace-Job_02/lib/...' is not under client's root 'jenkins/workspace-Job_01/lib/...'.
          
          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:131)
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:329)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE

          I am running Jenkins 2.130 and P4 1.8.10. 

          Show
          edeleff Emily Deleff added a comment - I am experiencing the same issue with concurrent builds. This works as expected in isolation but any case with multiple jobs being triggered at the same time will result in failure. The first job succeeds while the second one running at the same time fails because the root on the jenkins-libarary workspace is still set to the first one. The failed cases have been triggered by either polling or periodic trigger. ERROR: P4 Task: failed: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s): Path 'jenkins/workspace-Job_02/lib/...' is not under client's root 'jenkins/workspace-Job_01/lib/...'. 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:131) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:329) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE I am running Jenkins 2.130 and P4 1.8.10. 
          Hide
          p4paul Paul Allen added a comment -

          Resolved in 1.8.12

          Related to JENKINS-50975

          Show
          p4paul Paul Allen added a comment - Resolved in 1.8.12 Related to  JENKINS-50975

            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: