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

Cant run P4Groovy sync on multiple executors

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins 2.138.1/2.164.2
      P4-Plugin 1.10.0
    • Similar Issues:

      Description

      If you try to run concurrent P4Groovy jobs that need to create a workspace you will see the error:

       ... p4 client -i p4 client -i Error in client specification. Embedded special characters (*, %%, #, @) not allowed in '/var/lib/jenkins/workspace/JOB_NAME@2'.

      This is caused by the 'root' field being parsed as if its a view field.

       

       Reproduction Steps:

      (1) Create a pipeline job using the following build script:

       

      node ('master'){
              stage('Checkout') {
                        def p4Workspace = 'jenkins-${NODE_NAME}-${JOB_NAME}-$[EXECUTOR}-src'
                        def ws = [$class: 'ManualWorkspaceImpl', name: p4Workspace , spec: [view: '//depot/Data/... //'+p4Workspace+'/...']]
                        def p4 = p4(credential: 'JenkinsCredential', workspace: ws)
                        def response3 = p4.run('sync')
                        echo (response3.toString())
                       sleep 30                
                        
              }
          }
      

      (2) Run build.

      (3) Wait 5 seconds

      (4) Run build again.

       

      The first build will run without error. The second build will fail immediatly due to '@2' being appended to the workspace root path by Jenkins:

      Started by user unknown or anonymous
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] node
      Running on Jenkins in /var/lib/jenkins/workspace/P4Groovy@2
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Checkout)
      [Pipeline] p4
      ... p4 client -o jenkins-master-P4Groovy-$[EXECUTOR}-src +... p4 info +... p4 info +... p4 client -o jenkins-master-P4Groovy-$[EXECUTOR}-src +... p4 client -i +P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
      Embedded special characters (*, %%, #, @) not allowed in '/var/lib/jenkins/workspace/P4Groovy@2'.
      
      	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleErrorStr(ResultMapParser.java:145)
      	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.parseCommandResultMapIfIsInfoMessageAsString(ResultMapParser.java:96)
      	at com.perforce.p4java.impl.mapbased.server.cmd.ClientDelegator.updateClient(ClientDelegator.java:195)
      	at com.perforce.p4java.impl.mapbased.server.Server.updateClient(Server.java:1506)
      	at com.perforce.p4java.impl.mapbased.client.Client.update(Client.java:516)
      	at org.jenkinsci.plugins.p4.client.ClientHelper.updateClient(ClientHelper.java:180)
      	at org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:159)
      	at org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:101)
      	at org.jenkinsci.plugins.p4.tasks.AbstractTask.tryTask(AbstractTask.java:161)
      	at org.jenkinsci.plugins.p4.groovy.P4GroovyTask.invoke(P4GroovyTask.java:42)
      	at org.jenkinsci.plugins.p4.groovy.P4GroovyTask.invoke(P4GroovyTask.java:19)
      	at hudson.FilePath.act(FilePath.java:1077)
      	at hudson.FilePath.act(FilePath.java:1060)
      	at org.jenkinsci.plugins.p4.groovy.P4Groovy.run(P4Groovy.java:62)
      	at sun.reflect.GeneratedMethodAccessor1500.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
      	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
      	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157)
      	at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:155)
      	at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155)
      	at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159)
      	at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
      	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
      	at sun.reflect.GeneratedMethodAccessor775.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$101(SandboxContinuable.java:34)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda$run0$0(SandboxContinuable.java:59)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:58)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:182)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)

       

       

       

       

        Attachments

          Activity

          Hide
          joel_brown Joel Brown added a comment - - edited

          Workaround should be to start all nodes running concurrent builds to not use "@":    start jvm with "-Dhudson.slaves.WorkspaceList=_"

          Show
          joel_brown Joel Brown added a comment - - edited Workaround should be to start all nodes running concurrent builds to not use "@":    start jvm with "-Dhudson.slaves.WorkspaceList=_"

            People

            • Assignee:
              Unassigned
              Reporter:
              p4karl Karl Wirth
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: