Oct 16, 2009

Hadoop Streaming: java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127

So, my most recent problem was that my hadoop streaming job was failing, and the tracking url was listing this exception under "Failed/Killed
Task Attempts":

java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127
at org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:311)
at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:540)
at org.apache.hadoop.streaming.PipeMapper.close(PipeMapper.java:132)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:57)
at org.apache.hadoop.streaming.PipeMapRunner.run(PipeMapRunner.java:36)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:358)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:307)
at org.apache.hadoop.mapred.Child.main(Child.java:170)
Digging around in the logs directory I found a fuller explanation:
env: groovy: No such file or directory
java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 127
My groovy script was failing to launch - presumably because groovy wasn't visible on the path. My hacked solution was to hardcode the path to groovy in my script:
#!/usr/bin/env /Users/user/Applications/groovy-1.6-RC-2/bin/groovy
And then, voila! It worked!

1 comments:

Cliff said...

Now describe how that felt when Hadoop started working. The feeling of knowledge garnished via exception hell. For anyone who thought coffee was the fuel of development, you are dead wrong. The true motivating factor is the rush of scraping know-how out of nine hundred seventy three failed attempts at running a mis-typed method name. The "i" before "e" rule never stung so bad!