• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • p4-plugin
    • p4:1.9.4

      I upgraded to 1.9.4, there is a bug. Now I am roll-back to 1.9.3. It is OK.

       

      I have a pipeline job,

      configured like below.

      workspace name is jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER} originally.

       

      This capture is from 1.9.3

      But in case of 1.9.4,

      first build is normal, but all builds from second have a problem.

       

      log is 

      com.perforce.p4java.exception.RequestException: //jenkinsTemp-7a493879-8d2c-4b5b-a1b4-d7f4dfd86e81/Jenkinsfile - file(s) not in client view.

      at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleWarningStr(ResultMapParser.java:164)
      at com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamCmd(OneShotServerImpl.java:545)
      at com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamCmd(OneShotServerImpl.java:461)
      at com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator.execStreamCmd(BaseDelegator.java:163)
      at com.perforce.p4java.impl.mapbased.server.cmd.PrintDelegator.getFileContents(PrintDelegator.java:56)
      at com.perforce.p4java.impl.mapbased.server.Server.getFileContents(Server.java:2288)
      at org.jenkinsci.plugins.p4.scm.P4SCMFile.content(P4SCMFile.java:145)
      Caused: java.io.IOException
      at org.jenkinsci.plugins.p4.scm.P4SCMFile.content(P4SCMFile.java:147)
      at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:110)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)

       

      and configure page shows

      workspace name and view mappings is different name like

      workspace name : jenkinsTemp-ebdxxxx

      view mappings : //jenkinsTemp-abcxxxx

       

       

       

          [JENKINS-54695] every build fail except first one

          Paul Allen added a comment -

          The 1.9.4 release did include changes to the way the Jenkinsfile is mapped in the view:

          https://swarm.workshop.perforce.com/changes/24829

          Have you tried deleting and re-adding the Pipeline Job or using the original workspace name:

          jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}
          

          If you have Perforce Support, please raise a support case and include this JIRA issue in the details.

          Kind regards,
          Paul

          Paul Allen added a comment - The 1.9.4 release did include changes to the way the Jenkinsfile is mapped in the view: https://swarm.workshop.perforce.com/changes/24829 Have you tried deleting and re-adding the Pipeline Job or using the original workspace name: jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER} If you have Perforce Support, please raise a support case and include this JIRA issue in the details. Kind regards, Paul

          Karl Wirth added a comment - - edited

          Have reproduced this on Jenkins 1.138.1 and it's related to the auto generated name in the view:

          (1) Create a simple Jenkinsfile:

          pipeline {
            agent any
            stages {
              stage("Test") {
                steps {
                  script {
                      echo "In script."
                      sh 'ls'  
                  }
                }
              }
            }
          }
          
          

          (2) Create a Pipeline job with PipelineScript from SCM. Use standard Workspace name ('jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}') and a manual view mapping.

          (3) Save.

          (4) Run

          (5) Open job and check view. For example:

          //depot/pollperchange/... //jenkinsTemp-c85a2728-101e-479c-aab4-2402f13f0228/...
          

          (6) Run job again.

          (7) Error seen. Complete contents of console log:

          Console OutputStarted by user unknown or anonymous
          com.perforce.p4java.exception.RequestException: //jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/Jenkinsfile - file(s) not in client view.    at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleWarningStr(ResultMapParser.java:164)
              at com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamCmd(OneShotServerImpl.java:545)
              at com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamCmd(OneShotServerImpl.java:461)
              at com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator.execStreamCmd(BaseDelegator.java:163)
              at com.perforce.p4java.impl.mapbased.server.cmd.PrintDelegator.getFileContents(PrintDelegator.java:56)
              at com.perforce.p4java.impl.mapbased.server.Server.getFileContents(Server.java:2288)
              at org.jenkinsci.plugins.p4.scm.P4SCMFile.content(P4SCMFile.java:145)
          Caused: java.io.IOException
              at org.jenkinsci.plugins.p4.scm.P4SCMFile.content(P4SCMFile.java:147)
              at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
              at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:110)
              at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
              at hudson.model.ResourceController.execute(ResourceController.java:97)
              at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          

          (8) The custom Perforce logger I set up ('org.jenkinsci.plugins.p4') shows that we have two workspaces in play. The one in the view and another one that has been auto-generated again:

          P4: Creating manual client: jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          issuingServerCommand: (4) info
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          completedServerCommand: (4) in 0ms
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          issuingServerCommand: (5) info
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          completedServerCommand: (5) in 1ms
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          issuingServerCommand: (6) client -i
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          completedServerCommand: (6) in 8ms
          Dec 04, 2018 5:58:29 PM SEVERE org.jenkinsci.plugins.p4.client.ClientHelper clientLogin
          P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
          Mapping '//jenkinsTemp-c85a2728-101e-479c-aab4-2402f13f0228/...' is not under '//jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/...'.
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          issuingServerCommand: (7) print -q //jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/Jenkinsfile
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          completedServerCommand: (7) in 2ms
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          issuingServerCommand: (8) client -d jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595
          Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging
          completedServerCommand: (8) in 1ms
          Dec 04, 2018 5:58:29 PM INFO org.jenkinsci.plugins.p4.client.TempClientHelper close
          Unable to remove temporary client: jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595
          Dec 04, 2018 5:58:29 PM FINE org.jenkinsci.plugins.p4.client.ConnectionHelper
          P4: closed connection OK

          Note the names in:

          Mapping '//jenkinsTemp-c85a2728-101e-479c-aab4-2402f13f0228/...' is not under '//jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/...'.
          

           

           

          Karl Wirth added a comment - - edited Have reproduced this on Jenkins 1.138.1 and it's related to the auto generated name in the view: (1) Create a simple Jenkinsfile: pipeline { agent any stages { stage( "Test" ) { steps { script { echo "In script." sh 'ls' } } } } } (2) Create a Pipeline job with PipelineScript from SCM. Use standard Workspace name ('jenkins-${NODE_NAME} ${JOB_NAME} ${EXECUTOR_NUMBER}') and a manual view mapping. (3) Save. (4) Run (5) Open job and check view. For example: //depot/pollperchange/... //jenkinsTemp-c85a2728-101e-479c-aab4-2402f13f0228/... (6) Run job again. (7) Error seen. Complete contents of console log: Console OutputStarted by user unknown or anonymous com.perforce.p4java.exception.RequestException: //jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/Jenkinsfile - file(s) not in client view. at com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.handleWarningStr(ResultMapParser.java:164) at com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamCmd(OneShotServerImpl.java:545) at com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamCmd(OneShotServerImpl.java:461) at com.perforce.p4java.impl.mapbased.server.cmd.BaseDelegator.execStreamCmd(BaseDelegator.java:163) at com.perforce.p4java.impl.mapbased.server.cmd.PrintDelegator.getFileContents(PrintDelegator.java:56) at com.perforce.p4java.impl.mapbased.server.Server.getFileContents(Server.java:2288) at org.jenkinsci.plugins.p4.scm.P4SCMFile.content(P4SCMFile.java:145) Caused: java.io.IOException at org.jenkinsci.plugins.p4.scm.P4SCMFile.content(P4SCMFile.java:147) at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:110) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE (8) The custom Perforce logger I set up ('org.jenkinsci.plugins.p4') shows that we have two workspaces in play. The one in the view and another one that has been auto-generated again: P4: Creating manual client: jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595 Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging issuingServerCommand: (4) info Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging completedServerCommand: (4) in 0ms Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging issuingServerCommand: (5) info Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging completedServerCommand: (5) in 1ms Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging issuingServerCommand: (6) client -i Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging completedServerCommand: (6) in 8ms Dec 04, 2018 5:58:29 PM SEVERE org.jenkinsci.plugins.p4.client.ClientHelper clientLogin P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Mapping ' //jenkinsTemp-c85a2728-101e-479c-aab4-2402f13f0228/...' is not under '//jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/...' . Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging issuingServerCommand: (7) print -q //jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/Jenkinsfile Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging completedServerCommand: (7) in 2ms Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging issuingServerCommand: (8) client -d jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595 Dec 04, 2018 5:58:29 PM FINEST org.jenkinsci.plugins.p4.console.P4Logging completedServerCommand: (8) in 1ms Dec 04, 2018 5:58:29 PM INFO org.jenkinsci.plugins.p4.client.TempClientHelper close Unable to remove temporary client: jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595 Dec 04, 2018 5:58:29 PM FINE org.jenkinsci.plugins.p4.client.ConnectionHelper P4: closed connection OK Note the names in: Mapping ' //jenkinsTemp-c85a2728-101e-479c-aab4-2402f13f0228/...' is not under '//jenkinsTemp-41142ac8-23df-4ead-9ea0-2dcdb0fca595/...' .    

          Karl Wirth added a comment -

          Hi horangs,

          We confirm this is a bug with the replacement of the client name in the view. The workaround is to use ${P4_CLIENT} in the view. For example:

          //depot/path/... //${P4_CLIENT}/...
          

           

          Karl Wirth added a comment - Hi horangs , We confirm this is a bug with the replacement of the client name in the view. The workaround is to use ${P4_CLIENT} in the view. For example: //depot/path/... //${P4_CLIENT}/...  

          Hokwang Lee added a comment -

          Hi, p4karl

           

          Thanks for your comment, I will wait bug fix also.

          Hokwang Lee added a comment - Hi,  p4karl   Thanks for your comment, I will wait bug fix also.

          Paul Allen added a comment -

          Released in 1.9.5

          You will need to manually restore the workspace name and view mapping.

          Paul Allen added a comment - Released in 1.9.5 You will need to manually restore the workspace name and view mapping.

            p4paul Paul Allen
            horangs Hokwang Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: