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

p4-plugin sets client root to null with template workspaces

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      P4 Plugin 1.10.3
      Jenkins 1.276.1
    • Similar Issues:

      Description

      A poll will always set the workspace root to null when using template workspaces.

       

      Reproduction steps:

      (1) Create a freestyle job using a template workspace using the workspace naming convention 'jenkins-${JOB_NAME}'.

      (2) Set it to not run concurrent executions and pin to a specific node. This is important because the workspace name is invalid if it need to run concurrently or on more than one node.

      (3) Set it's build trigger to be polling.

      (4) Build the job. A client is created with a valid root.

      (5) Run 'Poll Now'. The workspace root is set to 'null'. For example:

      Client:	jenkins-nullRoot
      Update:	2019/09/10 14:00:40
      Access:	2019/09/10 14:00:00
      Owner:	admin
      Root:	null
      Options:	noallwrite noclobber nocompress unlocked nomodtime normdir
      SubmitOptions:	submitunchanged
      LineEnd:	local
      View:
      	//depot/00342303-nullRoot/... //jenkins-nullRoot/...
      

      Suggested Workaround:

      Include '${NODE_NAME}' in the workspace name and run on a slave that is not the master where polling occurs.

        Attachments

          Issue Links

            Activity

            Hide
            p4karl Karl Wirth added a comment -

            Customer has highlighted following additional information:

             

            I was just having a quick look at the p4-plugin source here:

             https://github.com/jenkinsci/p4-plugin/blob/81735fd4061943c8a122bfbc19e82b200094195d/src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java

             and I noticed the following (on line 420) which sets the Root to “null” explicitly: 

              // JENKINS-48434 by setting rootPath to null will leave client's root unchanged
              ws.setRootPath(null);

             So this was clearly done on purpose to fix the following issue which wiped out the JENKINS_HOME area for another customer:

             https://issues.jenkins-ci.org/browse/JENKINS-48434

             I guess keeping a valid Root setting would be better than setting It to “null” and that was suggested on JENKINS-48434.

            JENKINS-48434 appears to have broken an earlier fix for a similar issue: JENKINS-46908

            Show
            p4karl Karl Wirth added a comment - Customer has highlighted following additional information:   I was just having a quick look at the p4-plugin source here:   https://github.com/jenkinsci/p4-plugin/blob/81735fd4061943c8a122bfbc19e82b200094195d/src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java  and I noticed the following (on line 420) which sets the Root to “null” explicitly:    // JENKINS-48434 by setting rootPath to null will leave client's root unchanged   ws.setRootPath(null);  So this was clearly done on purpose to fix the following issue which wiped out the JENKINS_HOME area for another customer:   https://issues.jenkins-ci.org/browse/JENKINS-48434  I guess keeping a valid Root setting would be better than setting It to “null” and that was suggested on JENKINS-48434 . JENKINS-48434 appears to have broken an earlier fix for a similar issue: JENKINS-46908

              People

              • Assignee:
                Unassigned
                Reporter:
                p4karl Karl Wirth
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: