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

P4 plugin Unable to use parameters in "Stream Codeline" field when polling SCM

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • Jenkins v2.346.3
      P4 Plugin v1.13.0

      Error logged when schedule poll changes in the SCM and using variables in Stream Codeline field

      Steps:

      1. Create a Free Style Project
      2. Choose 'This project is parameterized'.
      3. Create a 'String' parameter with name 'STREAM' and a default value of a known stream (e.g. '//streams/main/project/version').
      4. Under 'Source Code Management' choose 'Perforce Software', enter the credentials
      5. Under Workspace behavior 'Streams'.
      6. Set 'Stream Codeline' to ${STREAM}'.
      7. Under 'Build Triggers', enable Poll SCM, Set Schedule to poll every 5 minutes 'H/5 * * * *'
      8. Save.
      9. Choose 'Build with Parameters' to build once or wait the first polling triggered successfully
      10. After 1st successful build, wait 5 minutes for the next polling, following is logged in the Perforce Software Polling Log.

       

      P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
      Error detected at line 18.
      Stream 'STREAM' must begin with '//'.
      
      	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.AbstractTask.tryTask(AbstractTask.java:171)
      	at org.jenkinsci.plugins.p4.tasks.PollTask.invoke(PollTask.java:50)
      	at org.jenkinsci.plugins.p4.tasks.PollTask.invoke(PollTask.java:33)
      	at hudson.FilePath.act(FilePath.java:1200)
      	at hudson.FilePath.act(FilePath.java:1183) 

        

      Note: 

      • Issue is similar to JENKINS-56775 but only poll SCM has this issue. Triggering build manually is successful and no such error logged.
      • Tried to set stream variables without "//" characters and find the parameters is not replaced 
        • set variable STREAM1 = streams
        • set variable STREAM2 = main/project/version
        • set the Stream Codeline to //${STREAM1}/${STREAM2}
        • following error is logged in the polling log and seems the variable is not replaced
        • P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
          Stream '//STREAM1/STREAM2' doesn't exist.
          
          	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) 

            Unassigned Unassigned
            winniechoi winnie choi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: