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

Perforce plugin will sometimes set an incorrect workspace view

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Jenkins Master 1.454 OS Windows Server 2008 SP2
      Jenkins Slave 2.12 OS Windows Server 2008 R2
    • Similar Issues:

      Description

      Perforce plugin will sometimes set an incorrect workspace view.

      The job has perforce Client View Type set to View Map with the following details
      //depot/evolution/evo11/${BRANCH}/... //workspace-name/...
      -//depot/evolution/evo11/${BRANCH}/MS3/....mb //workspace-name/MS3/....mb
      -//depot/evolution/evo11/${BRANCH}/MS3/....pds //workspace-name/MS3/....pds
      -//depot/evolution/evo11/${BRANCH}/MS3/....ma //workspace-name/MS3/....ma
      -//depot/evolution/evo11/${BRANCH}/MS3/....ZTL //workspace-name/MS3/....ZTL
      //depot/evolution/evo11/external/3rdParty/... //workspace-name/3rdParty/...
      //depot/evolution/evo11/external/Platform/... //workspace-name/Platform/...
      //depot/evolution/evo11/external/WWS/... //workspace-name/WWS/...
      -//depot/evolution/evo11/external/WWS/ATG/1.33.0/ATGTools/UnitTests/... //workspace-name/WWS/ATG/1.33.0/ATGTools/UnitTests/...

      The ${BRANCH} is set as a job parameter but the purposes of our current use case it is always the same default value.
      The job is set to run on a small pool of slaves with label. This pool of slaved is used for building packages from diferent branches.

      We get occasional build failures due to perforce incorrectly setting the workspace view. These errors can only be fixed by a clean and sync. As a full clean and sync takes 2 hours this is a significant issue.

      ----- Jenkins build log ------

      21:02:27 Started by timer
      21:02:27 Building remotely on gbwwsrunbld08 in workspace c:\jenkins\workspace\evo11main
      21:02:27 Using remote perforce client: jenkins_gbwwsrunbld08_evo11main
      21:02:27 [evo11main] $ "c:
      program files\\perforce
      p4.exe" workspace -o jenkins_gbwwsrunbld08_evo11main
      21:02:27 [evo11main] $ "c:
      program files\\perforce
      p4.exe" login -p
      21:02:27 [evo11main] $ "c:
      program files\\perforce
      p4.exe" -P 831EC39454600F1AF16985DE3AD2AFCD workspace -o jenkins_gbwwsrunbld08_evo11main
      21:02:27 Changing P4 Client View from:
      21:02:27 //depot/evolution/evo11/branches/evo11dx11/... //jenkins_gbwwsrunbld08_evo11main/...
      21:02:27 -//depot/evolution/evo11/branches/evo11dx11/MS3/....mb //jenkins_gbwwsrunbld08_evo11main/MS3/....mb
      21:02:27 -//depot/evolution/evo11/branches/evo11dx11/MS3/....pds //jenkins_gbwwsrunbld08_evo11main/MS3/....pds
      21:02:27 -//depot/evolution/evo11/branches/evo11dx11/MS3/....ma //jenkins_gbwwsrunbld08_evo11main/MS3/....ma
      21:02:27 -//depot/evolution/evo11/branches/evo11dx11/MS3/....ZTL //jenkins_gbwwsrunbld08_evo11main/MS3/....ZTL
      21:02:27 //depot/evolution/evo11/external/3rdParty/... //jenkins_gbwwsrunbld08_evo11main/3rdParty/...
      21:02:27 //depot/evolution/evo11/external/Platform/... //jenkins_gbwwsrunbld08_evo11main/Platform/...
      21:02:27 //depot/evolution/evo11/external/WWS/... //jenkins_gbwwsrunbld08_evo11main/WWS/...
      21:02:27 -//depot/evolution/evo11/external/WWS/ATG/1.33.0/ATGTools/UnitTests/... //jenkins_gbwwsrunbld08_evo11main/WWS/ATG/1.33.0/ATGTools/UnitTests/...
      21:02:27
      21:02:27 Changing P4 Client View to:
      21:02:27 //depot/evolution/evo11/external/3rdParty/... //jenkins_gbwwsrunbld08_evo11main/3rdParty/...
      21:02:27 //depot/evolution/evo11/external/Platform/... //jenkins_gbwwsrunbld08_evo11main/Platform/...
      21:02:27 //depot/evolution/evo11/external/WWS/... //jenkins_gbwwsrunbld08_evo11main/WWS/...
      21:02:27 Saving modified client jenkins_gbwwsrunbld08_evo11main

      As you can see perforce has removed the part view which was using the ${BRANCH} parameter and has also remove the final -// line which was not parameterised.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rob Petti
          Path:
          src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/perforce-plugin/a5bb228f6a75fb3119e75d513ac20d41ef502b84
          Log:
          JENKINS-13027 add warning when stripping invalid client spec lines

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/perforce-plugin/a5bb228f6a75fb3119e75d513ac20d41ef502b84 Log: JENKINS-13027 add warning when stripping invalid client spec lines
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_perforce #199
          JENKINS-13027 add warning when stripping invalid client spec lines (Revision a5bb228f6a75fb3119e75d513ac20d41ef502b84)

          Result = SUCCESS
          Rob Petti :
          Files :

          • src/main/java/hudson/plugins/perforce/PerforceSCM.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_perforce #199 JENKINS-13027 add warning when stripping invalid client spec lines (Revision a5bb228f6a75fb3119e75d513ac20d41ef502b84) Result = SUCCESS Rob Petti : Files : src/main/java/hudson/plugins/perforce/PerforceSCM.java
          Hide
          rpetti Rob Petti added a comment -

          I wasn't able to reproduce it, but I added some additional output that may provide some insight. Snapshot build is right here:

          http://ci.jenkins-ci.org/view/Plugins/job/plugins_perforce/lastSuccessfulBuild/artifact/target/perforce.hpi

          Show
          rpetti Rob Petti added a comment - I wasn't able to reproduce it, but I added some additional output that may provide some insight. Snapshot build is right here: http://ci.jenkins-ci.org/view/Plugins/job/plugins_perforce/lastSuccessfulBuild/artifact/target/perforce.hpi
          Hide
          richardtaylor Richard Taylor added a comment -

          Amazing found the problem immediately, as you can see form the output there is a trailing space on the ${BRANCH} variable. Depending on the use case this has the potential to cause a problem as below but in other places go through fine. I've had the same issue with Ant as the java property serialisation seems very sensitive to trailing spaces. The trailing space is the result of an auto generated file and the short comings of DOS file redirection

          I think it would be good to leave these changes in the next version of your perforce plugin incause it happen again or for anyone else

          Thanks again
          Rich

          13:13:10 Warning: Client Spec line invalid, ignoring. (//depot/evolution/evo11/branches/evo11dx11 /... //workspace-name/...
          )
          13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....mb //workspace-name/MS3/....mb
          )
          13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....pds //workspace-name/MS3/....pds
          )
          13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....ma //workspace-name/MS3/....ma
          )
          13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....ZTL //workspace-name/MS3/....ZTL
          )
          13:13:10 Changing P4 Client View from:
          13:13:10 //depot/evolution/evo11/releases/release-1.12/... //jenkins_gbwwsrunbld09_evo11main/...
          13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....mb //jenkins_gbwwsrunbld09_evo11main/MS3/....mb
          13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....pds //jenkins_gbwwsrunbld09_evo11main/MS3/....pds
          13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....ma //jenkins_gbwwsrunbld09_evo11main/MS3/....ma
          13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....ZTL //jenkins_gbwwsrunbld09_evo11main/MS3/....ZTL
          13:13:10 //depot/evolution/evo11/external/3rdParty/... //jenkins_gbwwsrunbld09_evo11main/3rdParty/...
          13:13:10 //depot/evolution/evo11/external/Platform/... //jenkins_gbwwsrunbld09_evo11main/Platform/...
          13:13:10 //depot/evolution/evo11/external/WWS/... //jenkins_gbwwsrunbld09_evo11main/WWS/...
          13:13:10 -//depot/evolution/evo11/external/WWS/ATG/1.33.0/ATGTools/UnitTests/... //jenkins_gbwwsrunbld09_evo11main/WWS/ATG/1.33.0/ATGTools/UnitTests/...
          13:13:10
          13:13:10 Changing P4 Client View to:
          13:13:10 //depot/evolution/evo11/external/3rdParty/... //jenkins_gbwwsrunbld09_evo11main/3rdParty/...
          13:13:10 //depot/evolution/evo11/external/Platform/... //jenkins_gbwwsrunbld09_evo11main/Platform/...
          13:13:10 //depot/evolution/evo11/external/WWS/... //jenkins_gbwwsrunbld09_evo11main/WWS/...
          13:13:10 -//depot/evolution/evo11/external/WWS/ATG/1.33.0/ATGTools/UnitTests/... //jenkins_gbwwsrunbld09_evo11main/WWS/ATG/1.33.0/ATGTools/UnitTests/...
          13:13:10 Saving modified client jenkins_gbwwsrunbld09_evo11main

          Show
          richardtaylor Richard Taylor added a comment - Amazing found the problem immediately, as you can see form the output there is a trailing space on the ${BRANCH} variable. Depending on the use case this has the potential to cause a problem as below but in other places go through fine. I've had the same issue with Ant as the java property serialisation seems very sensitive to trailing spaces. The trailing space is the result of an auto generated file and the short comings of DOS file redirection I think it would be good to leave these changes in the next version of your perforce plugin incause it happen again or for anyone else Thanks again Rich 13:13:10 Warning: Client Spec line invalid, ignoring. (//depot/evolution/evo11/branches/evo11dx11 /... //workspace-name/... ) 13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....mb //workspace-name/MS3/....mb ) 13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....pds //workspace-name/MS3/....pds ) 13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....ma //workspace-name/MS3/....ma ) 13:13:10 Warning: Client Spec line invalid, ignoring. (-//depot/evolution/evo11/branches/evo11dx11 /MS3/....ZTL //workspace-name/MS3/....ZTL ) 13:13:10 Changing P4 Client View from: 13:13:10 //depot/evolution/evo11/releases/release-1.12/... //jenkins_gbwwsrunbld09_evo11main/... 13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....mb //jenkins_gbwwsrunbld09_evo11main/MS3/....mb 13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....pds //jenkins_gbwwsrunbld09_evo11main/MS3/....pds 13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....ma //jenkins_gbwwsrunbld09_evo11main/MS3/....ma 13:13:10 -//depot/evolution/evo11/releases/release-1.12/MS3/....ZTL //jenkins_gbwwsrunbld09_evo11main/MS3/....ZTL 13:13:10 //depot/evolution/evo11/external/3rdParty/... //jenkins_gbwwsrunbld09_evo11main/3rdParty/... 13:13:10 //depot/evolution/evo11/external/Platform/... //jenkins_gbwwsrunbld09_evo11main/Platform/... 13:13:10 //depot/evolution/evo11/external/WWS/... //jenkins_gbwwsrunbld09_evo11main/WWS/... 13:13:10 -//depot/evolution/evo11/external/WWS/ATG/1.33.0/ATGTools/UnitTests/... //jenkins_gbwwsrunbld09_evo11main/WWS/ATG/1.33.0/ATGTools/UnitTests/... 13:13:10 13:13:10 Changing P4 Client View to: 13:13:10 //depot/evolution/evo11/external/3rdParty/... //jenkins_gbwwsrunbld09_evo11main/3rdParty/... 13:13:10 //depot/evolution/evo11/external/Platform/... //jenkins_gbwwsrunbld09_evo11main/Platform/... 13:13:10 //depot/evolution/evo11/external/WWS/... //jenkins_gbwwsrunbld09_evo11main/WWS/... 13:13:10 -//depot/evolution/evo11/external/WWS/ATG/1.33.0/ATGTools/UnitTests/... //jenkins_gbwwsrunbld09_evo11main/WWS/ATG/1.33.0/ATGTools/UnitTests/... 13:13:10 Saving modified client jenkins_gbwwsrunbld09_evo11main
          Hide
          richardtaylor Richard Taylor added a comment -

          Fixed with addition debug info

          Show
          richardtaylor Richard Taylor added a comment - Fixed with addition debug info

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              richardtaylor Richard Taylor
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: