[Perforce-Plugin] Problems running p4 client "The system cannot find the file specified"

2,667 views
Skip to first unread message

Ribram

unread,
Mar 21, 2012, 12:15:41 PM3/21/12
to jenkins...@googlegroups.com
Jenkins 1.456 with Perforce Plugin 1.3.10 on both Windows and Linux.

Cannot seem to invoke the p4 client (it is in the path).  Seeing the exception:

Caught exception communicating with perforce. Could not run perforce command.com.tek42.perforce.PerforceException: Could not run perforce command.
    at hudson.plugins.perforce.HudsonP4DefaultExecutor.exec(HudsonP4DefaultExecutor.java:88)
    at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:321)
    at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:292)
    at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:61)
    at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1325)
    at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:725)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1212)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:579)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:468)
    at hudson.model.Run.run(Run.java:1410)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Caused by: java.io.IOException: Cannot run program "" (in directory "C:\Documents and Settings\dev\.jenkins\jobs\TestJob\workspace"): CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
    at hudson.Launcher$ProcStarter.start(Launcher.java:338)
    at hudson.plugins.perforce.HudsonP4DefaultExecutor.exec(HudsonP4DefaultExecutor.java:79)
    ... 12 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    ... 18 more
ERROR: Unable to communicate with perforce. Could not run perforce command.
Finished: FAILURE

Notice 'cannot run program ""'

On the wiki screenshots there appears to be a way to set the path to your p4 client which I am not seeing.  Also clicking 'Advanced' P4 Executable shows an empty read-only dropdown box.

cjo

unread,
Mar 21, 2012, 1:35:55 PM3/21/12
to jenkins...@googlegroups.com
You need to setup the perforce installations in the main configuration page,

goto http://yourserver:port/configure

and scroll to find the perforce section and then click the add perforce button
enter the name of the installation and the path to the executable, of setup the automatic installation option.

Looks like the wiki screenshots show the versions pre 1.3.9 when this change was made.

Chris,

Rob Petti

unread,
Mar 26, 2012, 12:13:27 PM3/26/12
to jenkins...@googlegroups.com
Yeah, the wiki is in dire need of an update...

I've slightly changed the behavior in 1.3.11 so that if there is no perforce installation defined, it will use 'p4' by default.
Reply all
Reply to author
Forward
0 new messages