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

Perforce Plugin should trim whitespace before/after Path to P4 Executable

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin
    • None
    • Ubuntu Lucid

      Text entry should trim whitespace when whitespace results in a configuration error. Example:
      Setup > Path to p4 executable

      add a space to the end of the entry, e.g.,
      "/usr/bin/p4 "

      Result: java.io.IOException: Cannot run program "/usr/bin/p4 "

      Deleting the whitespace at the end of the command fixes the problem.

      The erroneous space character was the result of a copy/paste operation. It would simplify things to have the perforce plugin trim the whitespace.

      Console output:

      =====================================
      Started by user anonymous
      Using master perforce client: client.name
      [workspace] $ "/usr/bin/p4 " workspace -o client.name
      Caught exception communicating with perforce. Could not run perforce command.com.tek42.perforce.PerforceException: Could not run perforce command.
      at hudson.plugins.perforce.HudsonP4Executor.exec(HudsonP4Executor.java:83)
      at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:289)
      at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:53)
      at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:951)
      at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:499)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1054)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
      at hudson.model.Run.run(Run.java:1248)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:129)
      Caused by: java.io.IOException: Cannot run program "/usr/bin/p4 " (in directory "/var/lib/hudson/jobs/ProgressiveProxy/workspace"): java.io.IOException: error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
      at hudson.Proc$LocalProc.<init>(Proc.java:192)
      at hudson.Proc$LocalProc.<init>(Proc.java:164)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:638)
      at hudson.Launcher$ProcStarter.start(Launcher.java:273)
      at hudson.plugins.perforce.HudsonP4Executor.exec(HudsonP4Executor.java:74)
      ... 11 more
      Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
      at java.lang.ProcessImpl.start(ProcessImpl.java:81)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
      ... 16 more
      Finished: FAILURE

            rpetti Rob Petti
            pauldigioia pauldigioia
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: