Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Solved Go to solution

hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Guru

Hi Team,

My hive action with oozie is failing with below error.

hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Please note that this error started after upgrade only from 2.2 to 2.3.

I have implemented below solution as well but still getting error, can anyone please help me to get it resolve.

http://stackoverflow.com/questions/32759933/hive-internal-error-java-lang-classnotfoundexceptionorg-...

1 ACCEPTED SOLUTION

Accepted Solutions

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Super Guru

@Saurabh

I have resolved this kind of error for multiple customers by following below steps:

#Command 1:

hadoop fs -put /usr/hdp/current/atlas-server/hook/hive/* hdfs://<NN>/user/oozie/share/lib/lib_<Timestamp>/hive/ 

#Command 2(Please run below command on Oozie server as 'oozie' user):

oozie admin -oozie http://<oozie-server:11000/oozie -sharelibupdate 

Re-run your Oozie workflow, It should succeed without any issue.

Hope this helps!

Note - Update Oozie sharelib part is missing in the stackoverflow's answer.

7 REPLIES 7

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

One quick fix is to remove the Atlas Hook from the hive-site.xml

Find all the hook parameters ( below is the post hook ) and remove the Atlas class from this.

hive.exec.post.hooks

Or do you want to use Atlas? In that case adding the atlas libraries to shared should help. Did you restart oozie after adding the libraries to the shared folder?

You can also check in the output of the hive action if he actually put the atlas jars into the execution directory of the action.

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Guru

@Benjamin Leonhardi: You mean remove from hive_env.sh file ?

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

No from the hive.xxx.hooks parameters in the hive-site.xml. They define hooks. If atlas is not added there he doesn't even look for the class ( because the hook is never called )

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Mentor

I can almost guarantee you need this oozie.action.sharelib.for.hive=pig,hcatalog,atlas,hive

It's a guess but knowing all oozie pain points I have a good feeling. Make sure atlas is in sharelib. That would also explain that it worked before as Atlas was added recently to our stack.

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Mentor

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Guru

@Artem Ervits: I have added oozie.action.sharelib.for.hive = hive,hcatalog,sqoop but still getting same error.

And when I removed atlas property then it is working fine. But now other user's jobs are failing which are dependent on atlas. So not understanding where is the root cause.

Re: hive.exec.post.hooks Class not found:org.apache.atlas.hive.hook.HiveHook FAILED: Hive Internal Error: java.lang.ClassNotFoundException(org.apache.atlas.hive.hook.HiveHook)

Super Guru

@Saurabh

I have resolved this kind of error for multiple customers by following below steps:

#Command 1:

hadoop fs -put /usr/hdp/current/atlas-server/hook/hive/* hdfs://<NN>/user/oozie/share/lib/lib_<Timestamp>/hive/ 

#Command 2(Please run below command on Oozie server as 'oozie' user):

oozie admin -oozie http://<oozie-server:11000/oozie -sharelibupdate 

Re-run your Oozie workflow, It should succeed without any issue.

Hope this helps!

Note - Update Oozie sharelib part is missing in the stackoverflow's answer.

Don't have an account?
Coming from Hortonworks? Activate your account here