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

"Prepare an environment for the run" executes on a master node

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The below fails, simply because /tmp/jenkins does not exist. The environment is, naturally, per configuration should be set up on EC2 slave where /tmp/jenkins is actually created.

      GitHub pull request #58 of commit 9834759834759834759834759834459843 automatically merged.
      [EnvInject] - Loading node environment variables.
      [EnvInject] - Preparing an environment for the build.
      [EnvInject] - Keeping Jenkins build variables.
      [EnvInject] - Executing and processing the following script content: 
      #!/bin/bash -eEu
      
      #Prepare an environment for the run
      exit 0
      
      [jenkins] $ /bin/bash -eEu /tmp/hudson7316054252745307440.sh
      ERROR: SEVERE ERROR occurs
      org.jenkinsci.lib.envinject.EnvInjectException: Error occurs on execution script file path
      	at org.jenkinsci.plugins.envinject.service.EnvInjectScriptExecutor.executeScriptContent(EnvInjectScriptExecutor.java:99)
      	at org.jenkinsci.plugins.envinject.service.EnvInjectScriptExecutor.executeScriptSection(EnvInjectScriptExecutor.java:49)
      	at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.executeScript(EnvInjectEnvVars.java:107)
      	at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironmentJobPropertyObject(EnvInjectListener.java:179)
      	at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:44)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:581)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:487)
      	at hudson.model.Run.execute(Run.java:1706)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:232)
      Caused by: java.io.IOException: Cannot run program "/bin/bash" (in directory "/tmp/jenkins"): error=2, No such file or directory
      	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
      	at hudson.Proc$LocalProc.<init>(Proc.java:244)
      	at hudson.Proc$LocalProc.<init>(Proc.java:216)
      	at hudson.Launcher$LocalLauncher.launch(Launcher.java:780)
      	at hudson.Launcher$ProcStarter.start(Launcher.java:360)
      	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1111)
      	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1078)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:328)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	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:186)
      	at java.lang.ProcessImpl.start(ProcessImpl.java:130)
      	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
      	... 14 more
      Finished: FAILURE
      

        Attachments

          Activity

          Hide
          arcivanov Arcadiy Ivanov added a comment - - edited

          It's not a bug, the code executes correctly.

          Show
          arcivanov Arcadiy Ivanov added a comment - - edited It's not a bug, the code executes correctly.

            People

            • Assignee:
              arcivanov Arcadiy Ivanov
              Reporter:
              arcivanov Arcadiy Ivanov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: