6
votes

I am using Oozie 4.2 that comes bundled with HDP 2.3.

while working with a few example workflow's that comes with the oozie package, I noticed that the "job error log is disabled" and this makes debugging really difficult in the event of a failure. I tried running the below commands,

# oozie job -config /home/santhosh/examples/apps/hive/job.properties -run
job: 0000063-150904123805993-oozie-oozi-W

# oozie job -errorlog 0000063-150904123805993-oozie-oozi-W

Error Log is disabled!!

Can someone please tell me how to enable the workflow error log for oozie?

2
That -errorlog is new to V4.2, undocumented, and may have been de-activated in the HDP distro for many reasons. Including compatibility issues with other Hadoop components. So you probably would have to recompile the thing to activate it, at your own risk. By the way, what is it supposed to display that is not already in the -log output? - Samson Scharfrichter
Thanks for the inputs ! The problem I am facing is when a workflow fails(I tried executing the example workflows that comes with the package) it is not giving me any information on what the error is, I couldn't find anything in the log to understand the root cause of the failure. Any leads on how this could be resolved will be of great help ! - SanthoshD
Oozie logs show details of the coordination; the details of the actual execution are in YARN logs. Search the Oozie log for "External ID" and then find the matching entry in YARN web console. - Samson Scharfrichter
Thanks Samson ! Will check that out and revert. - SanthoshD
Hi Santosh, did you find a way to enable the error logs ? - sgsi

2 Answers

1
votes

In the Oozie UI, 'Job Error Log' is a tab which was introduced in HDP v2.3 on Oozie v4.2 .
This is the most simplest way of looking for error for the specified oozie job from the oozie log file.

To enable the oozie's Job Error Log, please make the following changes in the oozie log4j property file:

  1. Add the below set of lines after log4j.appender.oozie and before log4j.appender.oozieops:
log4j.appender.oozieError=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.oozieError.RollingPolicy=org.apache.oozie.util.OozieRollingPolicy
log4j.appender.oozieError.File=${oozie.log.dir}/oozie-error.log
log4j.appender.oozieError.Append=true
log4j.appender.oozieError.layout=org.apache.log4j.PatternLayout
log4j.appender.oozieError.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n
log4j.appender.oozieError.RollingPolicy.FileNamePattern=${log4j.appender.oozieError.File}-%d{yyyy-MM-dd-HH}
log4j.appender.oozieError.RollingPolicy.MaxHistory=720
log4j.appender.oozieError.filter.1 = org.apache.log4j.varia.LevelMatchFilter
log4j.appender.oozieError.filter.1.levelToMatch = WARN
log4j.appender.oozieError.filter.2 = org.apache.log4j.varia.LevelMatchFilter
log4j.appender.oozieError.filter.2.levelToMatch = ERROR
log4j.appender.oozieError.filter.3 =`enter code here` org.apache.log4j.varia.LevelMatchFilter
log4j.appender.oozieError.filter.3.levelToMatch = FATAL
log4j.appender.oozieError.filter.4 = org.apache.log4j.varia.DenyAllFilter 
  1. Modify the following from log4j.logger.org.apache.oozie=WARN, oozie to log4j.logger.org.apache.oozie=ALL, oozie, oozieError

  2. Restart the oozie service. This would help in getting the job error log for the new jobs launched after restart of oozie service.

0
votes

As mentioned, the errorlog is new and may not be made available for good reasons. However it seems that you have the wrong expectation of the oozie error log.

The error log is meant to be a subset of the log file. Not an addition to it.

So yes, it could make things easier to debug, but if you checked the oozie log and did not find what you are looking for, the error log will not be the solution for you.

Probably you will want to look at the log of the underlying tasks, which can be found via the external ID.