com.tek42.perforce.PerforceException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When there is an error in the global configuration that injects broken environment variables (blank name for the variable) the Perforce-plugin fails with: Started by user testuser [EnvInject] - Loading node environment variables. Building remotely on testslave in workspace E:\build_e\workspace\Test_Component Using remote perforce client: testclient-12345678 [Test_Component] $ C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 Caught exception communicating with perforce. No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 com.tek42.perforce.PerforceException: No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:384) 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:1528) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1489) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:795) at hudson.model.AbstractProject.checkout(AbstractProject.java:1195) 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:1408) at hudson.model.Build.run(Build.java:110) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) ERROR: Unable to communicate with perforce. No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 Finished: FAILURE The correct error would be something like, can't "run the command". Because the actual error is something like: Caused by: java.io.IOException: Cannot run program "cmd.exe" (in directory "E:\build_e\workspace\Test_Component"): CreateProcess error=87, The parameter is incorrect at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244)
    via by Markus Strand,
  • When there is an error in the global configuration that injects broken environment variables (blank name for the variable) the Perforce-plugin fails with: Started by user testuser [EnvInject] - Loading node environment variables. Building remotely on testslave in workspace E:\build_e\workspace\Test_Component Using remote perforce client: testclient-12345678 [Test_Component] $ C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 Caught exception communicating with perforce. No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 com.tek42.perforce.PerforceException: No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:384) 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:1528) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1489) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:795) at hudson.model.AbstractProject.checkout(AbstractProject.java:1195) 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:1408) at hudson.model.Build.run(Build.java:110) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) ERROR: Unable to communicate with perforce. No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 Finished: FAILURE The correct error would be something like, can't "run the command". Because the actual error is something like: Caused by: java.io.IOException: Cannot run program "cmd.exe" (in directory "E:\build_e\workspace\Test_Component"): CreateProcess error=87, The parameter is incorrect at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244)
    via by Markus Strand,
  • Perforce Plugin - Jenkins - Jenkins Wiki
    via by Unknown author,
  • Perforce Plugin - hudson - Hudson Wiki
    via by Unknown author,
  • Perforce Plugin - hudson - Hudson Wiki
    via by Unknown author,
  • Perforce Plugin - hudson - Hudson Wiki
    via by Unknown author,
  • Steps to Reproduce: 1. Click "Manage Jenkins" -> Global Properties 2. Create an Environment Variable as follows: name: P4USER value: p4service (or another P4 Username) 3. Select an Existing Job that uses Perforce for Source Code Management 4. Select the Username field and enter "${P4USER}" Result: {noformat} Result: build fails as follows: Started by user Administrator Building in workspace /usr/share/tomcat6/.jenkins/jobs/dpapi-int/workspace Using master perforce client: jenkins-dpapi-int [workspace] $ /usr/local/bin/p4 workspace -o jenkins-dpapi-int Caught exception communicating with perforce. Access for user 'com.tek42.perforce.PerforceException: Access for user ' at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:382) 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:1461) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1422) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:793) at hudson.model.AbstractProject.checkout(AbstractProject.java:1256) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494) at hudson.model.Run.execute(Run.java:1502) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:236) ERROR: Unable to communicate with perforce. Access for user ' Sending e-mails to: eng-n2i@netshelter.com Finished: FAILURE {noformat} As you can see by the above: "Caught exception communicating with perforce. Access for user 'com.tek42.perforce.PerforceException: Access for user '" Use Case: If a user wishes to use exactly one user for all Jobs that use Perforce for SCM, he could enter this user in the Global Properties and then change the credentials user to poll Perforce at any time across all Jobs.
    via by Colin Johnson,
  • It seems that the perforce plugin finds the p4 executable by using the system PATH variable, rather than referencing the value of "Path to p4 executable" listed on the job configuration page. This is misleading and makes errors difficult to debug. In our situation, we updated the ~/.bashrc file on our nodes and removed the path to the p4 executable from our PATH variable. Upon restarting the nodes, we got the following error for all of our builds that used perforce: Started by user vaustje Building remotely on node4 Using remote perforce client: SOME_CLIENT Caught exception communicating with perforce. No output for: p4 workspace -o SOME_CLIENT com.tek42.perforce.PerforceException: No output for: p4 workspace -o SOME_CLIENT at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:314) at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:53) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:671) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:294) at hudson.model.AbstractProject.checkout(AbstractProject.java:1003) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:428) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:376) at hudson.model.Run.run(Run.java:1174) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:303) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:123) Finished: FAILURE At first we thought that there was an error running the p4 command on the remote machine, but it turned out that p4 was not getting executed at all. The value of "Path to p4 executable" was set correctly in our job configuration. However it was not until we updated the PATH variable in our bashrc and restarted the nodes that the issue was fixed.
    via by austje,
  • All of a sudden, some builds start failing. Closer inspection showed, that the perforce plugin stopped providing the "-P" option to p4.exe. I can't explain why. Going back to 1.3.24 didn't help (but i'm unsure if the roll-back performed correctly). Updating Jenkins to 1.546 didn't help either. The log of a successful (old) build shows: {noformat} [EnvInject] - Loading node environment variables. Building on Slave WIN7 in workspace c:\jenkins\workspace\DEMO Deleting project workspace... done Using remote perforce client: Jenkins_DEMO--216826706 [DEMO] $ "c:\program files\perforce\p4" -P XXXXXXXXXXXXXXXXXXXX workspace -o Jenkins_DEMO--216826706 Note: .repository directory in workspace (if exists) is skipped during clean. Wiping workspace... Wiped workspace. Clean complete, took 5 ms [...] {noformat} A failed (new) build shows: {noformat} [EnvInject] - Loading node environment variables. Building on Slave WIN7 in workspace c:\jenkins\workspace\DEMO Deleting project workspace... done Using remote perforce client: Jenkins_DEMO--216826706 [DEMO] $ "c:\program files\perforce\p4.exe" workspace -o Jenkins_DEMO--216826706 Caught exception communicating with perforce. No output for: c:\program files\perforce\p4.exe workspace -o Jenkins_DEMO--216826706 com.tek42.perforce.PerforceException: No output for: c:\program files\perforce\p4.exe workspace -o Jenkins_DEMO--216826706 at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:408) at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:301) at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:61) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1545) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1506) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:843) at hudson.model.AbstractProject.checkout(AbstractProject.java:1415) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:561) at hudson.model.Run.execute(Run.java:1678) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) ERROR: Unable to communicate with perforce. No output for: c:\program files\perforce\p4.exe workspace -o Jenkins_DEMO--216826706 [...] {noformat}
    via by Peter Schaefer-Hutter,
    • com.tek42.perforce.PerforceException: No output for: C:\apps\perforce\p4.exe workspace -o -S //test/test_stream testclient-12345678 at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:384) 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:1528) at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1489) at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:795) at hudson.model.AbstractProject.checkout(AbstractProject.java:1195) 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:1408) at hudson.model.Build.run(Build.java:110) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,