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

Pipline job using P4 throws exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin

      A Pipeline job attempting to use the Perforce/Jenkins variables throws an exception when executed. Note in Freestyle and Matrix jobs this syntax works as expected.

      Code Sample
      #!groovy
      
      pipeline {
      
          agent { 
              node
              { 
                  label 'VS2022' 
              }
          }
          stages {
              stage ('Perforce Fetch') {
                  steps {
      		p4sync charset: 'none', credential: 'x1234567-1xxx-1234-xx12-1a23bc45d678', populate: autoClean(delete: true, modtime: true, parallel: [enable: true, minbytes: '4096', minfiles: '4', threads: '4'], pin: '', quiet: true, replace: true, tidy: false), source: depotSource(''' //depot/GroupID/ProductID/branches/7_60/project/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/ProductID/trunk/project/...''')
                  }
              }             
          }
      }
      
      Resulting error message
      Started by user <removed for Jira ticket>
      [Pipeline] Start of Pipeline
      [Pipeline] node
      Running on <removed for Jira ticket> in <removed for Jira ticket>
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Perforce Fetch)
      [Pipeline] p4sync
      Executor number at runtime: 0
      ... p4 login
       +
      ... p4 login -s
       +
      ... p4 client -o <removed for Jira ticket>_PpLn-0
       +
      ... p4 info
       +
      ... p4 info
       +
      ... p4 client -o <removed for Jira ticket>_7-60_PpLn-0
       +
      ... p4 client -i
       +
      P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
      Error detected at line 16.
      Null directory (//) not allowed in '//depot/GroupID/ProductID/branches/7_60/project/... //jenkins-<removed for Jira ticket>_PpLn-0/ProductID/trunk/project/...'.
      
      	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleErrorStr(ResultMapParser.java:151)
      	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.parseCommandResultMapIfIsInfoMessageAsString(ResultMapParser.java:102)
      	at com.perforce.p4java.impl.mapbased.server.cmd.ClientDelegator.updateClient(ClientDelegator.java:212)
      	at com.perforce.p4java.impl.mapbased.server.Server.updateClient(Server.java:1784)
      	at com.perforce.p4java.impl.mapbased.client.Client.update(Client.java:524)
      	at org.jenkinsci.plugins.p4.client.ClientHelper.updateClient(ClientHelper.java:191)
      	at org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:170)
      	at org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:104)
      	at org.jenkinsci.plugins.p4.tasks.CheckoutTask.initialise(CheckoutTask.java:64)
      	at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:578)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source)
      
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: P4: Unable to initialise CheckoutTask: hudson.AbortException: Error in client specification.
      Error detected at line 16.
      Null directory (//) not allowed in '//depot/GroupID/ProductID/branches/7_60/project/... //jenkins-<removed for Jira ticket>_PpLn-0//ProductID/trunk/project/...'.
      
      Finished: FAILURE
      

            Unassigned Unassigned
            jgorden_sie John
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: