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

Lightweight checkout fails on Build Replica

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin
    • Jenkins 2.89.3
      P4-Plugin

      (1) Define a credential for a Perforce Build-server.

      (2) Create a pipeline job

      (3) Choose to get Jenkinsfile from build farm

      (4) Enable 'Lightweight checkout'.

      (5) When it runs you see the following error:

      Started by user anonymous
      com.perforce.p4java.exception.RequestException: //jenkinsTemp-90239265-0873-426e-b711-32e89457b19b/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:106)
      	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:64)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:271)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:421)
      Finished: FAILURE
      

      (6) If you untick 'Lightweight checkout' and run the job again it works.

       

      From the Perforce log the Jenkins server just does a p4 client -o and p4 client -i but there is something strange with the 'db.view'. On a build server the 'db.view.rp' should be used for a client view. For example this is a good journal extract:

      @pv@ 1 @db.view.rp@ @bf2@ 0 0 @//bf2/test/...@ @//test/...@
      @pv@ 7 @db.domain@ @bf2@ 99 @test@ @/ws_buildserver/depot@ @@ @@ @super@ 1527071673 1527071673 0 @Created by super.
      @rv@ 7 @db.domain@ @bf2@ 99 @test@ @/ws_buildserver/depot@ @@ @@ @super@ 1527071673 1527071673 0 @Created by super.
      

      but when Jenkins tries to create a client for lightweight checkout it uses 'db.view':

      @pv@ 7 @db.domain@ @jenkinsTemp-3698d9aa-1fd9-46bf-a212-a60cf68490ef@ 99 @@ @null@ @@ @@ @jenkins@ 1527072186 1527072186 0 @@ @@ @buildfarm@ 0
      @pv@ 1 @db.view@ @jenkinsTemp-3698d9aa-1fd9-46bf-a212-a60cf68490ef@ 0 0 @//jenkinsTemp-3698d9aa-1fd9-46bf-a212-a60cf68490ef/...@ @//depot/lightweight_buildfarm/...@
      @rv@ 7 @db.domain@ @jenkinsTemp-3698d9aa-1fd9-46bf-a212-a60cf68490ef@ 99 @@ @/var/lib/jenkins/workspace/LightweightPipeline_Buildfarm%40script@ @@ @@ @jenkins@ 1527072245 1527072245 2 @@ @@ @buildfarm@ 1
      

      I suspect this is a P4Java bug.

       

       

       

            p4paul Paul Allen
            p4karl Karl Wirth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: