Support Questions

Find answers, ask questions, and share your expertise

Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [12]

avatar
Expert Contributor

When I try to run a hive action I get error number E0729 Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [12] with nothing more in log file. How fix this?

log:

2016-06-30 18:33:37,930  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@:start:] Start action [0000011-160630143249353-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2016-06-30 18:33:37,934  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@:start:] [***0000011-160630143249353-oozie-oozi-W@:start:***]Action status=DONE
2016-06-30 18:33:37,934  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@:start:] [***0000011-160630143249353-oozie-oozi-W@:start:***]Action updated in DB!
2016-06-30 18:33:38,013  INFO WorkflowNotificationXCommand:520 - SERVER[sandbox.hortonworks.com] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[] No Notification URL is defined. Therefore nothing to notify for job 0000011-160630143249353-oozie-oozi-W
2016-06-30 18:33:38,014  INFO WorkflowNotificationXCommand:520 - SERVER[sandbox.hortonworks.com] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@:start:] No Notification URL is defined. Therefore nothing to notify for job 0000011-160630143249353-oozie-oozi-W@:start:
2016-06-30 18:33:38,042  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] Start action [0000011-160630143249353-oozie-oozi-W@hive-node] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2016-06-30 18:33:49,999  INFO HiveActionExecutor:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] checking action, hadoop job ID [job_1467297249897_0020] status [RUNNING]
2016-06-30 18:33:50,002  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] [***0000011-160630143249353-oozie-oozi-W@hive-node***]Action status=RUNNING
2016-06-30 18:33:50,002  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] [***0000011-160630143249353-oozie-oozi-W@hive-node***]Action updated in DB!
2016-06-30 18:33:50,017  INFO WorkflowNotificationXCommand:520 - SERVER[sandbox.hortonworks.com] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] No Notification URL is defined. Therefore nothing to notify for job 0000011-160630143249353-oozie-oozi-W@hive-node
2016-06-30 18:38:09,496  INFO HiveActionExecutor:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] action completed, external ID [job_1467297249897_0020]
2016-06-30 18:38:09,783  WARN HiveActionExecutor:523 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [12]
2016-06-30 18:38:10,580  INFO ActionEndXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] ERROR is considered as FAILED for SLA
2016-06-30 18:38:10,984  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@fail] Start action [0000011-160630143249353-oozie-oozi-W@fail] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2016-06-30 18:38:11,002  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@fail] [***0000011-160630143249353-oozie-oozi-W@fail***]Action status=DONE
2016-06-30 18:38:11,003  INFO ActionStartXCommand:520 - SERVER[sandbox.hortonworks.com] USER[ambari-qa] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@fail] [***0000011-160630143249353-oozie-oozi-W@fail***]Action updated in DB!
2016-06-30 18:38:11,506  INFO WorkflowNotificationXCommand:520 - SERVER[sandbox.hortonworks.com] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@fail] No Notification URL is defined. Therefore nothing to notify for job 0000011-160630143249353-oozie-oozi-W@fail
2016-06-30 18:38:11,506  INFO WorkflowNotificationXCommand:520 - SERVER[sandbox.hortonworks.com] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[] No Notification URL is defined. Therefore nothing to notify for job 0000011-160630143249353-oozie-oozi-W
2016-06-30 18:38:11,506  INFO WorkflowNotificationXCommand:520 - SERVER[sandbox.hortonworks.com] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000011-160630143249353-oozie-oozi-W] ACTION[0000011-160630143249353-oozie-oozi-W@hive-node] No Notification URL is defined. Therefore nothing to notify for job 0000011-160630143249353-oozie-oozi-W@hive-node

job.properties

nameNode=hdfs://sandbox.hortonworks.com:8020
jobTracker=sandbox.hortonworks.com:8050
queueName=default
examplesRoot=examples
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/hive

my Workflow is

<workflow-app xmlns="uri:oozie:workflow:0.2" name="hive-wf">
    <start to="hive-node"/>
	 <action name="hive-node">
        <hive xmlns="uri:oozie:hive-action:0.2">   
	 <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
           <prepare>
                <delete path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data/hive"/>
                <mkdir path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data"/>
            </prepare>
 	    <job-xml>hive-site.xml</job-xml>
            <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>${queueName}</value>
                </property>
            </configuration>
            <script>script.q</script>
            <param>INPUT=/user/${wf:user()}/${examplesRoot}/input-data/table</param>
            <param>OUTPUT=/user/${wf:user()}/${examplesRoot}/output-data/hive</param>
        </hive>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Hive failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>
1 ACCEPTED SOLUTION

avatar
Expert Contributor

I figure it out. I post the answer for others with same issue. The problem was missing atlas jar files.Try to copy all the jar file in /usr/hdp/2.3.2.0-2950/atlas/hook/hive/* directory into lib folder at job.properties level.

View solution in original post

9 REPLIES 9

avatar
Super Collaborator

Can you give the complete output of the execution. You can find log in Oozie UI for this job.

avatar
Expert Contributor

@Manish GuptaThe weird thing is it creates the table in hive then show this error. I add the complete log in the question.

avatar
Super Guru
@hoda moradi

You will have to do some research but you might be missing a jar file. Are you sure you have jdbc jar files in classpath?

See the following two links.

https://community.hortonworks.com/questions/19396/oozie-hive-action-errors-out-with-exit-code-12.htm...

https://community.hortonworks.com/articles/9148/troubleshooting-an-oozie-flow.html

avatar
Expert Contributor

I do not have jdbc. jar file in the /user/oozie/share/lib/lib_20151027144433 where can I download the right jar file?

avatar
Super Guru

Hive jdbc jar should be at the following location. You can copy it from here. /usr/hdp/current/hive-client/lib/hive-jdbc.jar

avatar
Expert Contributor

@mqureshi I add the jar file but I still get the same error. Do you have any other suggestion?

avatar
Contributor

Hi @hoda, how are you?

Have you found some solution?

I'm facing same issue.

avatar
Expert Contributor

@Thiago I did! It took me one week but finally I figure it out! I will post it as an answer.

avatar
Expert Contributor

I figure it out. I post the answer for others with same issue. The problem was missing atlas jar files.Try to copy all the jar file in /usr/hdp/2.3.2.0-2950/atlas/hook/hive/* directory into lib folder at job.properties level.