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

Process lauchner should check if working directory exists

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      When external process is started and working directory doesn't exists, it fails with exception bellow and it's easy to overlook that process runs in non-existing directory (as the same exception is thrown when external program file doesn't exists, has wrong rights and many other reasons). It would be nice if process launcher checks that working directory exists before starting the process.

      java.io.IOException: Cannot run program "/my/external/program" (in directory "/tmp/aaa"): error=2, No such file or directory
              at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
              at hudson.Proc$LocalProc.<init>(Proc.java:244)
              at hudson.Proc$LocalProc.<init>(Proc.java:216)
              at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
              at hudson.Launcher$ProcStarter.start(Launcher.java:381)
              at org.jenkinsci.plugins.radargun.NodeRunner.call(NodeRunner.java:35)
              at org.jenkinsci.plugins.radargun.NodeRunner.call(NodeRunner.java:11)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.IOException: error=2, No such file or directory
              at java.lang.UNIXProcess.forkAndExec(Native Method)
              at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
              at java.lang.ProcessImpl.start(ProcessImpl.java:134)
              at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
              ... 10 more
      

            vjuranek vjuranek
            vjuranek vjuranek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: