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

every build fail except first one

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      p4:1.9.4
    • Similar Issues:

      Description

      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

       

       

       

        Attachments

          Activity

          Hide
          p4paul 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

          Show
          p4paul 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
          Hide
          p4karl 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/...'.
          

           

           

          Show
          p4karl 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/...' .    
          Hide
          p4karl Karl Wirth added a comment -

          Hi Hokwang Lee,

          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}/...
          

           

          Show
          p4karl Karl Wirth added a comment - Hi Hokwang Lee , 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}/...  
          Hide
          horangs Hokwang Lee added a comment -

          Hi, Karl Wirth

           

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

          Show
          horangs Hokwang Lee added a comment - Hi,  Karl Wirth   Thanks for your comment, I will wait bug fix also.
          Hide
          p4paul Paul Allen added a comment -

          Released in 1.9.5

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

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

            People

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

              Dates

              Created:
              Updated:
              Resolved: