1
votes

I am getting below error while trying to execute shell scripts. Please let me know If I have done any error here.

I have copied all files into Hdfs. The Oozie folder contains scripts folder and I have the sample.sh in that folder.

Cannot run program "sample.sh" (in directory "/var/lib/hadoop-yarn/cache/yarn/nm-local-dir/usercache/cloudera/appcache/application_1468541187565_0011/container_1468541187565_0011_01_000002"): error=2, No such file or directory

Please find my job and workflow files.

<workflow-app name="WF_PRC_L2_LOAD" xmlns="uri:oozie:workflow:0.5">
  <credentials>
    <credential name="hive2" type="hive2">
      <property>
        <name>hive2.jdbc.url</name>
        <value>${hive2_jdbc_url}</value>
      </property>
    </credential>
  </credentials>
    <start to="shell-001"/>
    <kill name="Kill">
        <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>

    <action name="shell-001">
      <shell xmlns="uri:oozie:shell-action:0.1">
        <job-tracker>${jobTracker}</job-tracker>
                                <name-node>${nameNode}</name-node>
                                <exec>sample.sh</exec>
                                <file>${basepath}/scripts/sample.sh#sample.sh</file>
                                <capture-output />
                </shell>
  <ok to="End" />
  <error to="Kill" />
  </action>

    <end name="End"/>
</workflow-app>

My Job.properties file looks like:

oozie.use.system.libpath=True
src_tmvw_schema=AMLMKTE_TM
l1_schema=amlmkte_l1
tm_stg_schema=L4_AMLMKT_STGE
basepath=/user/sp57529/oozie
queueName=default
oozie.wf.application.path=/user/sp57529/oozie/application/app_amlmkt_dq/wf_prc_l1_dq/
env=home
hive2_jdbc_url=jdbc:hive2://localhost:10000/default
nameNode=hdfs://localhost:8020
jobTracker=localhost:8032
1

1 Answers

0
votes

1) Have you tried placing the sample.sh in the "oozie.wf.application.path" path and changing file property to

 <file>sample.sh</file>

2) I faced same "No such file or directory" error, when the shell script file got corrupted when copying it from windows to linux. Validate the file