For example if your node is WIN10, your job is mybuild and it runs on executor (Jenkins build thread) 1 the P4CLIENT (variable P4_CLIENT) would be:
If you knew the job only ever runs on one node you could hard code the client name in the job definition to be 'ci-admin-ui-4.2'. As for the error its occurring after P4Jenkins has finished and after the command "/data/jenkins_home/tools/apache-maven-3.6.3/bin/mvn -s " has executed. Also P4Jenkins doesnt use the 'p4' binary it uses P4Java that is dynamically sent to the slave as teh job executes:
ha:////4Lo+a7u/lzaTkq1HGH3U8JSMfSgah36g77z15FvpSvDYAAAAYB+LCAAAAAAAAP9b85aBtbiIQSmjNKU4P0+vJLE4u1gvPjexLDVPzxdEuhYV5Rf55ZekOlc7RKnPKH7IxMBQUcQgBdWQnJ9XnJ+TqucMoUEKGSCAEaSwAACsNFCqYAAAAA==[ERROR] Failed to execute goal com.mycom:mycom-build-info-plugin:1.0.14:create (vernum) on project admin.ui: Unable to fetch p4 head version for path/data/jenkins_home/workspace/admin-ui-4.2: P4 process `/bin/sh -c p4 -d /data/jenkins_home/workspace/admin-ui-4.2 changes -m1 ...` returned error code;rc;1;Error message;... - must create client 'ip-10-21-2-84' to access local files. -> [Help 1]
Note that it's running '/bin/sh -c p4'. So if this is not Maven then it is another script or job that is being executed by the Jenkins job. The problem is that the P4CLIENT being built on the fly is not being passed to the environment that the job is executing under which is why I think it needs to be passed or picked up explicitly. For example if it's bash try using 'export P4CLIENT=P4_CLIENT'. For example below is the output when I run a shell script from the job that displaye P4CLIENT and P4_CLIENT:  Note that P4CLIENT is not set but P4_CLIENT is. |