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

Jenkins2, P4 Plugin: Error must create client <name>' to access local files

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Environment:
      OS: Ubuntu 18.04
      JDK 1.8.0_181
      P4 Plugin v
      Jenkins v2.222.1
      P4 Plugin v1.10.12
      Jenkins master in container (image: jenkins/jenkins:2.222.1)
      Jenkin slaves in container (image: jenkins/jnlp-slave:3.27-1)
    • Similar Issues:

      Description

      Getting error message "must create client 'ip-10-21-2-84' to access local files".

      It appears when the job is executed on the jenkins slave the P4 client is not being created.  Does the p4 plugin create the workspace and manages the workspace view.  Or does the p4 plugin require an additional setup that I might be missing.

      • Job Configuration:    Reference attached job config.xml
      • Build log attached.

      Note that I also tested the job on a jenkins slave that was not in a container.  Got the same error.   When I ran 'p4 client' and set-up the root and mapping, the jenkins job worked.

       

       

        Attachments

        1. build.log
          13 kB
        2. image-2020-04-20-13-40-22-145.png
          image-2020-04-20-13-40-22-145.png
          12 kB
        3. image-2020-04-23-08-55-54-786.png
          image-2020-04-23-08-55-54-786.png
          8 kB
        4. image-2020-04-23-08-57-39-950.png
          image-2020-04-23-08-57-39-950.png
          10 kB
        5. image-2020-04-23-08-59-08-936.png
          image-2020-04-23-08-59-08-936.png
          6 kB
        6. jenkins-1.651.2-job-config.xml
          7 kB
        7. jenkins-1.651.2-job-config.xml
          7 kB
        8. jenkins1-job-config.xml
          6 kB
        9. jenkins1-job-console.log
          2 kB
        10. jenkins2-job-config.xml
          3 kB
        11. jenkins2-job-console.log
          5 kB
        12. jenkins2-job-console.log
          5 kB
        13. job-config.xml
          5 kB

          Issue Links

            Activity

            Hide
            p4karl Karl Wirth added a comment -

            Hi David Rodriguez - Thanks for those kind words.

            The developers have confirmed that 1.3.35 was the old community plugin. That did set the variables. The new plugin developed by Perforce has never set the variables because we were worried about stamping on environment variables that had been preconfigured already on build slaves.

            I have therefore raised the following enhancement request:

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

            The workaround would still be the same that you need to manually set P4CLIENT in the build script based on P4_CLIENT.

            Show
            p4karl Karl Wirth added a comment - Hi David Rodriguez - Thanks for those kind words. The developers have confirmed that 1.3.35 was the old community plugin. That did set the variables. The new plugin developed by Perforce has never set the variables because we were worried about stamping on environment variables that had been preconfigured already on build slaves. I have therefore raised the following enhancement request:     https://issues.jenkins-ci.org/browse/JENKINS-62008 The workaround would still be the same that you need to manually set P4CLIENT in the build script based on P4_CLIENT.
            Hide
            drodspike David Rodriguez added a comment -

            Karl, 

            I did the workaround as suggested on the  jenkin master 'Configure System'  by adding P4CLIENT  to the "Global properties" as follows.  It worked.

            Name:   P4CLIENT
            Value:   $P4_CLIENT

            I'm wondering if the Jenkins Guild below should also mention this issue for "Freestyle jobs configured for P4"

            Helix Plugin for Jenkins Guide (1.10.x), Freestyle job - Manual Workspace setup
            https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/workspace-manual.html

            Thanks again.

            David

            Show
            drodspike David Rodriguez added a comment - Karl,  I did the workaround as suggested on the  jenkin master 'Configure System'  by adding P4CLIENT  to the "Global properties" as follows.  It worked. Name:   P4CLIENT Value:   $P4_CLIENT I'm wondering if the Jenkins Guild below should also mention this issue for "Freestyle jobs configured for P4" Helix Plugin for Jenkins Guide (1.10.x), Freestyle job - Manual Workspace setup https://www.perforce.com/manuals/jenkins/Content/P4Jenkins/workspace-manual.html Thanks again. David
            Hide
            p4karl Karl Wirth added a comment -

            Hi David Rodriguez - Aha. Another Jenkins feature I never knew about. Thanks. Great that it's now working and thanks for correcting the typos in the other job.

            Yes I  agree this should be documented so passed this job to our doc team. I'm going to suggest the following wording, but they will tweak it as needed to match the documentation standards and correct grammar:

            Note that when using build steps such as 'Execute Shell' the standard Perforce variables P4PORT, P4USER and P4CLIENT are not set in the environment. This is to ensure the plugin does not overwrite variables on preconfigured build environments. If a build step needs access to these values the variables P4_PORT, P4_USER and P4_CLIENT can be used. For example in a shell script:
            
               export P4CLIENT=$P4_CLIENT
            
            To make the standard variables accessible by default they can be set in the 'Global properties' section on the Jenkins 'Configure System' page. For example:
            

             

            Show
            p4karl Karl Wirth added a comment - Hi David Rodriguez - Aha. Another Jenkins feature I never knew about. Thanks. Great that it's now working and thanks for correcting the typos in the other job. Yes I  agree this should be documented so passed this job to our doc team. I'm going to suggest the following wording, but they will tweak it as needed to match the documentation standards and correct grammar: Note that when using build steps such as 'Execute Shell' the standard Perforce variables P4PORT, P4USER and P4CLIENT are not set in the environment. This is to ensure the plugin does not overwrite variables on preconfigured build environments. If a build step needs access to these values the variables P4_PORT, P4_USER and P4_CLIENT can be used. For example in a shell script: export P4CLIENT=$P4_CLIENT To make the standard variables accessible by default they can be set in the 'Global properties' section on the Jenkins 'Configure System ' page. For example:  
            Hide
            p4kevin Kevin Williamson added a comment -

            Ready for release

            Show
            p4kevin Kevin Williamson added a comment - Ready for release
            Hide
            p4kevin Kevin Williamson added a comment -

            Released

            Show
            p4kevin Kevin Williamson added a comment - Released

              People

              • Assignee:
                p4kevin Kevin Williamson
                Reporter:
                drodspike David Rodriguez
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: