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

p4unshelve doesn't do appropriate variable expansion (like checkout scm: perforce() does)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • Jenkins running on Ubuntu 22.04 executing on remote node via SSH. Jenkins Plugin version 1.14.2

      pipeline
      {
          agent {
              label "linux"
          }
          stages {
              stage("Checkout") {
                  steps {
                      checkout changelog: false, poll: false, scm: perforce(
                          credential: 'Perforce-Credentials',
                          populate: autoClean(delete: true, modtime: false, parallel: [enable: true, minbytes: '1024', minfiles: '1', threads: '4'], pin: null, quiet: true, replace: true, tidy: false),
                          workspace: manualSpec(
                              name: "${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}",
                              spec: clientSpec(
                                  view: '''//path/abc/src/... //${P4_CLIENT}/...
                                           //path/def/src/... //${P4_CLIENT}/def/...'''
                              )
                          )
                      )
      
                      p4unshelve (resolve: 'ay', shelf: '316076', credential: 'Perforce-Credentials', tidy: true, ignoreEmpty: true,
                          workspace: manualSpec(
                              name: "${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}",
                              spec: clientSpec(
                                  view: '''//path/abc/src/... //${P4_CLIENT}/...
                                           //path/def/src/... //${P4_CLIENT}/def/...'''
                              )
                          )
                      )
                  }
              }
          }
      }
      

       

      This will run until the p4unshelve step, then it will throw a stacktrace:

      P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
      Mapping '//P4_CLIENT/...' is not under '//jenkins-node-1-Test-0/...'.
      
      	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleErrorStr(ResultMapParser.java:146)
      	at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.parseCommandResultMapIfIsInfoMessageAsString(ResultMapParser.java:98)
      	at com.perforce.p4java.impl.mapbased.server.cmd.ClientDelegator.updateClient(ClientDelegator.java:212)
      	at com.perforce.p4java.impl.mapbased.server.Server.updateClient(Server.java:1728)
      	at com.perforce.p4java.impl.mapbased.client.Client.update(Client.java:528)
      	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.unshelve.UnshelveBuilder.updateChangeLog(UnshelveBuilder.java:141)
      	at org.jenkinsci.plugins.p4.unshelve.UnshelveBuilder.unshelve(UnshelveBuilder.java:134)
      	at org.jenkinsci.plugins.p4.unshelve.UnshelveBuilderStep.perform(UnshelveBuilderStep.java:42)
      	at org.jenkinsci.plugins.p4.workflow.P4UnshelveStep$P4UnshelveStepExecution.run(P4UnshelveStep.java:133)
      	at org.jenkinsci.plugins.p4.workflow.P4UnshelveStep$P4UnshelveStepExecution.run(P4UnshelveStep.java:119)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      

       

      This bug maybe a duplicate of JENKINS-70584

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

              Created:
              Updated: