Plato Manchi
Plato Manchi

Reputation: 59

Jenkins Setup: Unable to setup workspace: java.lang.NullPointerException

I'm trying to setup jenkins in my local machine where perforce is also installed. I wanted to build my UE4 project in jenkins.

I created a user called Jenkins in perforce and gave jenkins the username following this

https://patricevignola.com/post/automation-jenkins-unreal

But when i try to build I'm getting this console output and it says "Unable to setup workspace" but the build shows success.

19:31:52 Started by user Jenkins 19:31:52 Building in workspace C:\Program Files (x86)\Jenkins\workspace\Abhimanyu 19:31:52 (p4):cmd:... p4 client -o jenkins-master-Abhimanyu-1 19:31:52 p4 client -o jenkins-master-Abhimanyu-1 19:31:52
19:31:52 (p4):stop:3 19:31:52 (p4):cmd:... p4 info 19:31:52 p4 info 19:31:52
19:31:52 (p4):stop:4 19:31:52 (p4):cmd:... p4 info 19:31:52 p4 info 19:31:52
19:31:52 (p4):stop:5 19:31:52 (p4):cmd:... p4 client -i 19:31:52 p4 client -i 19:31:52
19:31:52 Client jenkins-master-Abhimanyu-1 not changed. 19:31:52
19:31:52 (p4):stop:6 19:31:52 P4: Unable to setup workspace: java.lang.NullPointerException 19:31:52 (p4):cmd:... p4 counter change 19:31:52 p4 counter change 19:31:52
19:31:52 (p4):stop:7 19:31:52 (p4):cmd:... p4 changes -m1 -ssubmitted //jenkins-master-Abhimanyu-1/... 19:31:52 p4 changes -m1 -ssubmitted //jenkins-master-Abhimanyu-1/... 19:31:52
19:31:52 (p4):stop:8 19:31:52 P4: no revisions under //jenkins-master-Abhimanyu-1/... using latest change: 21 19:31:52 (p4):cmd:... p4 repos -C 19:31:52 p4 repos -C 19:31:52
19:31:52 (p4):stop:9 19:31:52 Building on Node: master 19:31:52 (p4):cmd:... p4 client -o jenkins-master-Abhimanyu-1 19:31:52 p4 client -o jenkins-master-Abhimanyu-1 19:31:52
19:31:52 (p4):stop:3 19:31:52 (p4):cmd:... p4 info 19:31:52 p4 info 19:31:52
19:31:52 (p4):stop:4 19:31:52 (p4):cmd:... p4 info 19:31:52 p4 info 19:31:52
19:31:52 (p4):stop:5 19:31:52 (p4):cmd:... p4 client -i 19:31:52 p4 client -i 19:31:52
19:31:52 Client jenkins-master-Abhimanyu-1 not changed. 19:31:52
19:31:52 (p4):stop:6 19:31:52 P4: Unable to setup workspace: java.lang.NullPointerException 19:31:52
19:31:52 P4 Task: establishing connection. 19:31:52 ... server: localhost:1666 19:31:52 ... node: DESKTOP-DP775O3 19:31:52
19:31:52 P4 Task: reverting all pending and shelved revisions. 19:31:52 (p4):cmd:... p4 revert C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/... 19:31:52 p4 revert C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/... 19:31:52
19:31:53 C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/... - file(s) not opened on this client. 19:31:53
19:31:53 (p4):stop:7 19:31:53 ... rm [abandoned files] 19:31:53 duration: (12ms) 19:31:53
19:31:53 P4 Task: cleaning workspace to match have list. 19:31:53 (p4):cmd:... p4 reconcile -w -f C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/... 19:31:53 p4 reconcile -w -f C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/... 19:31:53
19:31:53 C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/... - no file(s) to reconcile. 19:31:53
19:31:53 (p4):stop:8 19:31:53 duration: (12ms) 19:31:53
19:31:53 P4 Task: syncing files at change: 21 19:31:53 (p4):cmd:... p4 sync -q C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/...@21 19:31:53 p4 sync -q C:\Program Files (x86)\Jenkins\workspace\Abhimanyu/...@21 19:31:53
19:31:53 (p4):stop:9 19:31:53 duration: (11ms) 19:31:53
19:31:53 P4 Task: saving built changes. 19:31:53 Found last change 21 on syncID jenkins-NODE_NAME-Abhimanyu-EXECUTOR_NUMBER 19:31:53 (p4):cmd:... p4 client -o jenkins-master-Abhimanyu-1 19:31:53 p4 client -o jenkins-master-Abhimanyu-1 19:31:53
19:31:53 (p4):stop:3 19:31:53 (p4):cmd:... p4 info 19:31:53 p4 info 19:31:53
19:31:53 (p4):stop:4 19:31:53 (p4):cmd:... p4 info 19:31:53 p4 info 19:31:53
19:31:53 (p4):stop:5 19:31:53 (p4):cmd:... p4 client -i 19:31:53 p4 client -i 19:31:53
19:31:53 Client jenkins-master-Abhimanyu-1 not changed. 19:31:53
19:31:53 (p4):stop:6 19:31:53 P4: Unable to setup workspace: java.lang.NullPointerException 19:31:53 (p4):cmd:... p4 client -o jenkins-master-Abhimanyu-1 19:31:53 p4 client -o jenkins-master-Abhimanyu-1 19:31:53
19:31:53 (p4):stop:3 19:31:53 (p4):cmd:... p4 info 19:31:53 p4 info 19:31:53
19:31:53 (p4):stop:4 19:31:53 (p4):cmd:... p4 info 19:31:53 p4 info 19:31:53
19:31:53 (p4):stop:5 19:31:53 (p4):cmd:... p4 client -i 19:31:53 p4 client -i 19:31:53
19:31:53 Client jenkins-master-Abhimanyu-1 not changed. 19:31:53
19:31:53 (p4):stop:6 19:31:53 P4: Unable to setup workspace: java.lang.NullPointerException 19:31:53 ... done 19:31:53
19:31:53 Finished: SUCCESS

Upvotes: 0

Views: 2037

Answers (1)

Dimitar Tenev
Dimitar Tenev

Reputation: 46

I got the same issue. The NPE itself seems to be fixed with this: https://swarm.workshop.perforce.com/changes/24968 -> client/ClientHelper.java#121 line: 170

NPE happens when no "View Mappings" are defined, so you need to have at least one entry for "View Mappings" - example:

  1. Go to "Configure" of your Jenkins project
  2. Go to

    Source Code Management -> Perforce Software -> Workspace behaviour -> View Mappings

  3. Enter your perforce clients' view mapping like:

    //org/my/project/... //MyPerforceWorkspaceName_123/org/my/project
    

Have fun!

Upvotes: 3

Related Questions