<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question FAILED: SemanticException [Error 10072]: Database does not exist: testnamespace -- Oozie in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/FAILED-SemanticException-Error-10072-Database-does-not-exist/m-p/142390#M56389</link>
    <description>&lt;P&gt;I get an error while running an Oozie workflow with Hive queries. &lt;/P&gt;&lt;P&gt;Here is the workflow&lt;/P&gt;&lt;PRE&gt;&amp;lt;workflow-app xmlns='uri:oozie:workflow:0.5' name='reporting_W_errorAuditHiveQueryExe'&amp;gt;
	&amp;lt;start to="hive_report_fork"/&amp;gt;
	&amp;lt;fork name="hive_report_fork"&amp;gt;
		&amp;lt;path start="hiveGSRLfile"/&amp;gt;
		&amp;lt;path start="hiveNGSRLfile"/&amp;gt;
		&amp;lt;path start="hiveNGsrlRAfile"/&amp;gt;
	&amp;lt;/fork&amp;gt;
	&amp;lt;action name="hiveGSRLfile"&amp;gt;
		&amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
			&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
			&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
			&amp;lt;script&amp;gt;${dir}/gsrlQery.hql&amp;lt;/script&amp;gt;
			&amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
		&amp;lt;/hive&amp;gt;
		&amp;lt;ok to="joining"/&amp;gt;
		&amp;lt;error to="joining"/&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;action name="hiveNGSRLfile"&amp;gt;
		&amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
			&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
			&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
			&amp;lt;script&amp;gt;${dir}/nongsrlQuery.hql&amp;lt;/script&amp;gt;
			&amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
		&amp;lt;/hive&amp;gt;
		&amp;lt;ok to="joining"/&amp;gt;
		&amp;lt;error to="joining"/&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;action name="hiveNGsrlRAfile"&amp;gt;
		&amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
			&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
			&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
			&amp;lt;script&amp;gt;${dir}/nongsrlRAQuery.hql&amp;lt;/script&amp;gt;
			&amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
		&amp;lt;/hive&amp;gt;
		&amp;lt;ok to="joining"/&amp;gt;
		&amp;lt;error to="joining"/&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;join name= "joining" to="Success"/&amp;gt;
	&amp;lt;action name="Success"&amp;gt;
		&amp;lt;email xmlns="uri:oozie:email-action:0.1"&amp;gt;
			&amp;lt;to&amp;gt;${failureEmailToAddress}&amp;lt;/to&amp;gt;
			&amp;lt;subject&amp;gt;Success&amp;lt;/subject&amp;gt;
			&amp;lt;body&amp;gt;
				The workflow ${wf:name()} with id ${wf:id()} failed
				[${wf:errorMessage(wf:lastErrorNode())}].
			&amp;lt;/body&amp;gt;
		&amp;lt;/email&amp;gt;
		&amp;lt;ok to="end" /&amp;gt;
		&amp;lt;error to="fail" /&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;action name="failure"&amp;gt;
		&amp;lt;email xmlns="uri:oozie:email-action:0.1"&amp;gt;
			&amp;lt;to&amp;gt;${failureEmailToAddress}&amp;lt;/to&amp;gt;
			&amp;lt;subject&amp;gt;Failure&amp;lt;/subject&amp;gt;
			&amp;lt;body&amp;gt;
				The workflow ${wf:name()} with id ${wf:id()} failed
				[${wf:errorMessage(wf:lastErrorNode())}].
			&amp;lt;/body&amp;gt;
		&amp;lt;/email&amp;gt;
		&amp;lt;ok to="end" /&amp;gt;
		&amp;lt;error to="fail" /&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;kill name="fail"&amp;gt;
		&amp;lt;message&amp;gt;Workflow failed&amp;lt;/message&amp;gt;
	&amp;lt;/kill&amp;gt;
	&amp;lt;end name="end"/&amp;gt;
&amp;lt;/workflow-app&amp;gt;
&lt;/PRE&gt;&lt;P&gt;And here is the oozie properties file&lt;/P&gt;&lt;PRE&gt;oozie.wf.application.path=${deploymentPath}/workflows/errorAuditHiveQueryExe.xml
deploymentPath=/user/amin/deploy_178
jobTracker=localhost:8032
nameNode=hdfs://nameservice1
dir=${deploymentPath}/data-warehouse/temp
failureEmailToAddress=amin@dnb.com
jobOutput=${dir}
oozie.use.system.libpath=true&lt;/PRE&gt;&lt;P&gt;Here is the error I get:&lt;/P&gt;&lt;PRE&gt;FAILED: SemanticException [Error 10072]: Database does not exist: testnamespace 
Intercepting System.exit(10072)
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [10072]&lt;/PRE&gt;&lt;P&gt;However the namespace exist and I can query the tables inside it.&lt;/P&gt;&lt;P&gt;What could be wrong here? Please help.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 16:33:22 GMT</pubDate>
    <dc:creator>Alexraj84</dc:creator>
    <dc:date>2017-03-07T16:33:22Z</dc:date>
    <item>
      <title>FAILED: SemanticException [Error 10072]: Database does not exist: testnamespace -- Oozie</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/FAILED-SemanticException-Error-10072-Database-does-not-exist/m-p/142390#M56389</link>
      <description>&lt;P&gt;I get an error while running an Oozie workflow with Hive queries. &lt;/P&gt;&lt;P&gt;Here is the workflow&lt;/P&gt;&lt;PRE&gt;&amp;lt;workflow-app xmlns='uri:oozie:workflow:0.5' name='reporting_W_errorAuditHiveQueryExe'&amp;gt;
	&amp;lt;start to="hive_report_fork"/&amp;gt;
	&amp;lt;fork name="hive_report_fork"&amp;gt;
		&amp;lt;path start="hiveGSRLfile"/&amp;gt;
		&amp;lt;path start="hiveNGSRLfile"/&amp;gt;
		&amp;lt;path start="hiveNGsrlRAfile"/&amp;gt;
	&amp;lt;/fork&amp;gt;
	&amp;lt;action name="hiveGSRLfile"&amp;gt;
		&amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
			&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
			&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
			&amp;lt;script&amp;gt;${dir}/gsrlQery.hql&amp;lt;/script&amp;gt;
			&amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
		&amp;lt;/hive&amp;gt;
		&amp;lt;ok to="joining"/&amp;gt;
		&amp;lt;error to="joining"/&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;action name="hiveNGSRLfile"&amp;gt;
		&amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
			&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
			&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
			&amp;lt;script&amp;gt;${dir}/nongsrlQuery.hql&amp;lt;/script&amp;gt;
			&amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
		&amp;lt;/hive&amp;gt;
		&amp;lt;ok to="joining"/&amp;gt;
		&amp;lt;error to="joining"/&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;action name="hiveNGsrlRAfile"&amp;gt;
		&amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
			&amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
			&amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
			&amp;lt;script&amp;gt;${dir}/nongsrlRAQuery.hql&amp;lt;/script&amp;gt;
			&amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
		&amp;lt;/hive&amp;gt;
		&amp;lt;ok to="joining"/&amp;gt;
		&amp;lt;error to="joining"/&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;join name= "joining" to="Success"/&amp;gt;
	&amp;lt;action name="Success"&amp;gt;
		&amp;lt;email xmlns="uri:oozie:email-action:0.1"&amp;gt;
			&amp;lt;to&amp;gt;${failureEmailToAddress}&amp;lt;/to&amp;gt;
			&amp;lt;subject&amp;gt;Success&amp;lt;/subject&amp;gt;
			&amp;lt;body&amp;gt;
				The workflow ${wf:name()} with id ${wf:id()} failed
				[${wf:errorMessage(wf:lastErrorNode())}].
			&amp;lt;/body&amp;gt;
		&amp;lt;/email&amp;gt;
		&amp;lt;ok to="end" /&amp;gt;
		&amp;lt;error to="fail" /&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;action name="failure"&amp;gt;
		&amp;lt;email xmlns="uri:oozie:email-action:0.1"&amp;gt;
			&amp;lt;to&amp;gt;${failureEmailToAddress}&amp;lt;/to&amp;gt;
			&amp;lt;subject&amp;gt;Failure&amp;lt;/subject&amp;gt;
			&amp;lt;body&amp;gt;
				The workflow ${wf:name()} with id ${wf:id()} failed
				[${wf:errorMessage(wf:lastErrorNode())}].
			&amp;lt;/body&amp;gt;
		&amp;lt;/email&amp;gt;
		&amp;lt;ok to="end" /&amp;gt;
		&amp;lt;error to="fail" /&amp;gt;
	&amp;lt;/action&amp;gt;
	&amp;lt;kill name="fail"&amp;gt;
		&amp;lt;message&amp;gt;Workflow failed&amp;lt;/message&amp;gt;
	&amp;lt;/kill&amp;gt;
	&amp;lt;end name="end"/&amp;gt;
&amp;lt;/workflow-app&amp;gt;
&lt;/PRE&gt;&lt;P&gt;And here is the oozie properties file&lt;/P&gt;&lt;PRE&gt;oozie.wf.application.path=${deploymentPath}/workflows/errorAuditHiveQueryExe.xml
deploymentPath=/user/amin/deploy_178
jobTracker=localhost:8032
nameNode=hdfs://nameservice1
dir=${deploymentPath}/data-warehouse/temp
failureEmailToAddress=amin@dnb.com
jobOutput=${dir}
oozie.use.system.libpath=true&lt;/PRE&gt;&lt;P&gt;Here is the error I get:&lt;/P&gt;&lt;PRE&gt;FAILED: SemanticException [Error 10072]: Database does not exist: testnamespace 
Intercepting System.exit(10072)
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [10072]&lt;/PRE&gt;&lt;P&gt;However the namespace exist and I can query the tables inside it.&lt;/P&gt;&lt;P&gt;What could be wrong here? Please help.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 16:33:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/FAILED-SemanticException-Error-10072-Database-does-not-exist/m-p/142390#M56389</guid>
      <dc:creator>Alexraj84</dc:creator>
      <dc:date>2017-03-07T16:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: FAILED: SemanticException [Error 10072]: Database does not exist: testnamespace -- Oozie</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/FAILED-SemanticException-Error-10072-Database-does-not-exist/m-p/142391#M56390</link>
      <description>&lt;P&gt;After a tireless research on the internet I was able to crack the solution for the issue.
I have added a configuration to use the metastore server for the Hive job and it worked.
Here is what I did to the Hive action. &lt;/P&gt;&lt;PRE&gt;....
    &amp;lt;hive xmlns='uri:oozie:hive-action:0.2'&amp;gt;
    &amp;lt;job-tracker&amp;gt;${jobTracker}&amp;lt;/job-tracker&amp;gt;
    &amp;lt;name-node&amp;gt;${nameNode}&amp;lt;/name-node&amp;gt;
    &amp;lt;configuration&amp;gt;
                    &amp;lt;property&amp;gt;
                     &amp;lt;name&amp;gt;hive.metastore.uris&amp;lt;/name&amp;gt;
     &amp;lt;value&amp;gt;thrift://10.155.1.63:9083&amp;lt;/value&amp;gt;
                    &amp;lt;/property&amp;gt;
                &amp;lt;/configuration&amp;gt;
    &amp;lt;script&amp;gt;${dir}/gsrlQery.hql&amp;lt;/script&amp;gt;
    &amp;lt;param&amp;gt;OutputDir=${jobOutput}&amp;lt;/param&amp;gt;
    &amp;lt;/hive&amp;gt;
    .... &lt;/PRE&gt;&lt;P&gt;Note: replace the hive metatore ip accordingly if you are trying to fix a similar problem. To get the metastore details check the hive-site.xml file located in /etc/hive/conf dir. &lt;/P&gt;&lt;P&gt;Credit: &lt;A target="_blank" href="http://doc.mapr.com/display/MapR/Run+Hive+Jobs+with+Oozie"&gt;MapR&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:58:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/FAILED-SemanticException-Error-10072-Database-does-not-exist/m-p/142391#M56390</guid>
      <dc:creator>Alexraj84</dc:creator>
      <dc:date>2017-03-07T17:58:11Z</dc:date>
    </item>
  </channel>
</rss>

