[
https://issues.apache.org/jira/browse/OOZIE-1142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13537455#comment-13537455
]
Robert Kanter commented on OOZIE-1142:
--------------------------------------
OOZIE-1035, which isn't in Oozie 3.2.0-cdh4.1.2, will allow you to re-use the
same action in the "error to" transition like what you want. However, you are
not allowed to have an "end" node within a fork-join, so you'd have to change
your "send-error-email" action to have the "ok to" transition go to a "kill"
node like in the following:
{code}
<action name="send-error-email">
<email xmlns="uri:oozie:email-action:0.1">
<to>${wf:user()}@mail.com</to>
<subject>Oozie Workflow Failure ${wf:name()} action
${wf:lastErrorNode()} on ${clusterName}</subject>
<body>Error Message:
${wf:errorMessage(wf:lastErrorNode())}</body>
</email>
<ok to="kill"/>
<error to="kill"/>
</action>
{code}
If you don't want the "ok to" and the "error to" transitions to go to the same
"kill" node, you can make a second "kill" node with a different message.
That said, the above won't help you until you start using a version of Oozie
with OOZIE-1035 in it. In the mean time, you can disable the extra fork-join
checking that Oozie does so that it will accept your workflow as-is. If you do
this, please be extra careful when writing your workflows. In oozie-site.xml,
set {{oozie.validate.ForkJoin}} to {{false}} and restart Oozie.
In the future, please post this sort of question to the [email protected]
mailing list, or the [email protected] mailing list (as you're using a
Cloudera distribution of Oozie) instead of opening a JIRA.
> Fork-Join Error To Transition Cannot Reuse Email Actions
> --------------------------------------------------------
>
> Key: OOZIE-1142
> URL: https://issues.apache.org/jira/browse/OOZIE-1142
> Project: Oozie
> Issue Type: Bug
> Components: workflow
> Affects Versions: 3.2.0
> Environment: Hadoop 2.0.0-cdh4.1.2
> Oozie client build version: 3.2.0-cdh4.1.2
> Reporter: Nathaniel Troutman
>
> Workflows that fork and inside the forked paths use the same error-to
> transition now fail with the following error:
> {noformat}
> Error: E0735 : E0735: There was an invalid "error to" transition to node
> [send-error-email] while using fork/join
> {noformat}
> This prevents the workflow from having a single node, used by multiple nodes
> within a fork as the error-to transition target, that is responsible for
> sending an email before exiting.
> The following is a example workflow illustrating this issue:
> {code:xml}
> <workflow-app xmlns="uri:oozie:workflow:0.2" name="simple">
> <start to="prep"/>
>
> <action name="prep">
> <fs><delete path='${rootOutpath}'/></fs>
> <ok to="fork-it"/>
> <error to="send-error-email"/>
> </action>
>
> <!-- create two directories -->
> <fork name="fork-it">
> <path start="path1"/>
> <path start="path2"/>
> </fork>
>
> <action name="path1">
> <fs><mkdir path='${rootOutpath}/path1'/></fs>
> <ok to="join-it"/>
> <error to="send-error-email"/>
> </action>
>
> <action name="path2">
> <fs><mkdir path='${rootOutpath}/path2'/></fs>
> <ok to="join-it"/>
> <error to="send-error-email"/>
> </action>
>
> <join name="join-it" to="send-done-email"/>
>
> <action name="send-done-email">
> <email xmlns="uri:oozie:email-action:0.1">
> <to>${wf:user()}@mail.com</to>
> <subject>Oozie Workflow Complete ${wf:name()} on
> ${clusterName}</subject>
> <body>Done</body>
> </email>
> <ok to="done"/>
> <error to="kill"/>
> </action>
>
>
> <action name="send-error-email">
> <email xmlns="uri:oozie:email-action:0.1">
> <to>${wf:user()}@mail.com</to>
> <subject>Oozie Workflow Failure ${wf:name()} action
> ${wf:lastErrorNode()} on ${clusterName}</subject>
> <body>Error Message:
> ${wf:errorMessage(wf:lastErrorNode())}</body>
> </email>
> <ok to="done"/>
> <error to="kill"/>
> </action>
>
> <kill name="kill">
> <message>FATAL: unable to send email on action
> failure.</message>
> </kill>
>
> <end name="done"/>
> </workflow-app>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira