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

Random failure to find bash on Windows/Cygwin slave

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: cygpath-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.383
      Master: Ubuntu, glassfish
      Slave: Windows XP, Cygwin, running via JNLP
    • Similar Issues:

      Description

      It looks like either cygpath sometimes does not return the right information, or Hudson does not use the cygpath information to find /bin/bash. The log snippet below shows a few things:

      • Timing - It found bash twice within 10 seconds, and then the 3rd time it failed to find it
      • When it worked, Hudson called C:\cygwin\bin\bash. When it failed, Hudson called /bin/bash. This is what makes me think that it didn't use the cygpath value

      I found one thread in the forums which suggested just using bash instead of /bin/bash in the shell environment variable. Would that take care of something like this?

      The two success cases:

      09:56:19  $ C:\cygwin\bin\cygpath -w /bin/bash
      09:56:19  [spectrum_tap2] $ C:\cygwin\bin\bash -xe C:\DOCUME~1\OR-ENG~1\LOCALS~1\Temp\hudson3300316933213918666.sh
      ...
      09:56:19  $ C:\cygwin\bin\cygpath -w /bin/bash
      09:56:20  [spectrum_tap2] $ C:\cygwin\bin\bash -xe C:\DOCUME~1\OR-ENG~1\LOCALS~1\Temp\hudson2834466993129794225.sh
      09:56:20  + '[' '' '!=' true ']'
      09:56:20  + echo 'Build description: Build skipped'
      09:56:20  Build description: Build skipped
      

      And the failure, 3 seconds later:

      09:56:23  $ C:\cygwin\bin\cygpath -w /bin/bash
      09:56:27  [spectrum_tap2] $ /bin/bash -xe C:\DOCUME~1\OR-ENG~1\LOCALS~1\Temp\hudson5829219388252082290.sh
      09:56:29  FATAL: command execution failed
      09:56:29  java.io.IOException: Cannot run program "/bin/bash" (in directory "C:\Hudson\workspace\spectrum_tap2"): CreateProcess error=3, The system cannot find the path specified
      09:56:29  	at java.lang.ProcessBuilder.start(Unknown Source)
      09:56:29  	at hudson.Proc$LocalProc.<init>(Proc.java:192)
      09:56:29  	at hudson.Proc$LocalProc.<init>(Proc.java:164)
      09:56:29  	at hudson.Launcher$LocalLauncher.launch(Launcher.java:638)
      09:56:29  	at hudson.Launcher$ProcStarter.start(Launcher.java:273)
      09:56:29  	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:793)
      09:56:29  	at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:767)
      09:56:29  	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
      09:56:29  	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      09:56:29  	at hudson.remoting.Request$2.run(Request.java:270)
      09:56:29  	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      09:56:29  	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      09:56:29  	at java.util.concurrent.FutureTask.run(Unknown Source)
      09:56:29  	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      09:56:29  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      09:56:29  	at hudson.remoting.Engine$1$1.run(Engine.java:58)
      09:56:29  	at java.lang.Thread.run(Unknown Source)
      09:56:29  Caused by: java.io.IOException: CreateProcess error=3, The system cannot find the path specified
      09:56:29  	at java.lang.ProcessImpl.create(Native Method)
      09:56:29  	at java.lang.ProcessImpl.<init>(Unknown Source)
      09:56:29  	at java.lang.ProcessImpl.start(Unknown Source)
      09:56:29  	... 17 more
      

      I don't know what component this should be, so I set it to 'core'.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          This happens when "C:\cygwin\bin\cygpath -w /bin/bash" returns non-zero exit code. Any idea why that can happen?

          Show
          kohsuke Kohsuke Kawaguchi added a comment - This happens when "C:\cygwin\bin\cygpath -w /bin/bash" returns non-zero exit code. Any idea why that can happen?
          Hide
          aeayrs Allan Eayrs added a comment -

          I am in the same team as Saurav. We see this occur on an irregular basis, but it does happen. Our solution is to run the build again. Most times this problem with cygpath goes away. This is without any other intervention, aside from starting the project again.

          Show
          aeayrs Allan Eayrs added a comment - I am in the same team as Saurav. We see this occur on an irregular basis, but it does happen. Our solution is to run the build again. Most times this problem with cygpath goes away. This is without any other intervention, aside from starting the project again.

            People

            • Assignee:
              Unassigned
              Reporter:
              sauravsengupta sauravsengupta
            • Votes:
              5 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: