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

`dir` command without anything else causes detect to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins 2.346.3
      blackduck detect 7.0.0

      Issue:

      After using the pipeline `dir` on a directory which does not already exist and then immediately running the blackduck detect pipeline step it fails with a directory does not exist error:
      10:07:44 java.io.IOException: Process working directory '/var/lib/jenkins/workspace/Blah/blackduck/test' doesn't exist!
      10:07:44 at hudson.Proc$LocalProc.<init>(Proc.java:252)
      10:07:44 at hudson.Proc$LocalProc.<init>(Proc.java:223)
      10:07:44 at hudson.Launcher$LocalLauncher.launch(Launcher.java:997)
      10:07:44 at hudson.Launcher$ProcStarter.start(Launcher.java:509)
      10:07:44 at hudson.Launcher$ProcStarter.join(Launcher.java:520)
      10:07:44 at com.synopsys.integration.jenkins.service.JenkinsRemotingService.launch(JenkinsRemotingService.java:62)
      10:07:44 at com.synopsys.integration.jenkins.detect.DetectRunner.runDetect(DetectRunner.java:45)
      10:07:44 at com.synopsys.integration.jenkins.detect.DetectPipelineCommands.runDetect(DetectPipelineCommands.java:27)
      10:07:44 at com.synopsys.integration.jenkins.detect.extensions.pipeline.DetectPipelineStep$Execution.run(DetectPipelineStep.java:129)
      10:07:44 at com.synopsys.integration.jenkins.detect.extensions.pipeline.DetectPipelineStep$Execution.run(DetectPipelineStep.java:109)
      10:07:44 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      10:07:44 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      10:07:44 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      10:07:44 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      10:07:44 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      10:07:44 at java.base/java.lang.Thread.run(Thread.java:829)
      10:07:44 Finished: FAILURE
       

      It appears that a remote process tries to start from the detect plugin but the directory does not exist yet or something like that.

       

      Workaround:

      Run a `sh "ls -la"` command right before the synopsis detect runs and it will fully create the directory

       

      Fix:

      I cant see the launcher code but it seems like to me that you should create a directory if it does not exist before trying to launch something there

            gkillough Inactive Account
            alexanderrtaylor Alex Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: