Created 05-27-2016 11:08 AM
I am getting the error while validating a workflow.
Error: E0701: XML schema error, /d/app/workflow.xml, org.xml.sax.SAXParseException; lineNumber: 49; columnNumber: 11; cvc-complex-type.2.3: Element 'shell' cannot have character [children], because the type's content type is element-only.
Here is the workflow.xml
<workflow-app name="FILLED_WF" xmlns="uri:oozie:workflow:0.4"> <start to="read_cutoff"/> <action name="read_cutoff"> <shell xmlns="uri:oozie:shell-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <exec>${cutoff_script}</exec> <argument>${trigger_location}/${trigger_file}</argument> <env-var>HADOOP_USER_NAME=${wf:user()}</env-var> <file>${path}/${cutoff_script}#${cutoff_script}</file> <capture-output/> </shell> <ok to="remove_trigger_flag_file_processing"/> <error to="sendFailureEmail"/> </action> <action name="remove_trigger_flag_file_processing"> <fs> <name-node>${nameNode}</name-node> <delete path='${trigger_location}/${trigger_file}'/> </fs> <ok to="cutoff_values_table" /> <error to="sendFailureEmail" /> </action> <action name="cutoff_values_table"> <shell xmlns="uri:oozie:shell-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <exec>${scriptName}</exec> <argument>-t</argument>z <argument>${hive_table}</argument> <argument>-v</argument> <argument>${prime_version}</argument> <argument>-n</argument> <argument>${hive_namespace}</argument> <argument>-r</argument> <argument>${report_flag}</argument> <argument>-m</argument> <argument>${memory}</argument> <argument>-c</argument> <argument>${wf:actionData('read_cutoff')['cutoff']}</argument> <argument>-S</argument> <argument>${deploymentPath}/data-warehouse</argument> <argument>-f</argument> <argument>FALSE</argument> <argument>-l</argument> <argument>${full_cutoff_list}</argument> <env-var>HADOOP_USER_NAME=${wf:user()}</env-var> <file>${scriptPath}/generateCutoffValues.sh#${scriptName}</file> </shell> <ok to="generateReports" /> <error to="sendFailureEmail" /> </action> <fork name="generateReports"> <path start="generateCutoffReports"/> <path start="generateCutoffCountryReports"/> </fork> <action name="generateCutoffReports"> <shell xmlns="uri:oozie:shell-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <exec>${cutoffScript}</exec> <argument>${hive_namespace}</argument> <argument>TRUE</argument> <argument>${wf:actionData('read_cutoff')['cutoff']}</argument> <argument>${prime_version}</argument> <argument>${hive_table}</argument> <argument>${deploymentPath}/data-warehouse</argument> <env-var>HADOOP_USER_NAME=${wf:user()}</env-var> <file>${scriptPath}/${cutoffScript}#${cutoffScript}</file> </shell> <ok to="joining" /> <error to="sendFailureEmail" /> </action> <action name="generateCutoffCountryReports"> <shell xmlns="uri:oozie:shell-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <exec>${cutoffCountryScript}</exec> <argument>${hive_namespace}</argument> <argument>TRUE</argument> <argument>${wf:actionData('read_cutoff')['cutoff']}</argument> <argument>${prime_version}</argument> <argument>${hive_table}</argument> <argument>${deploymentPath}/data-warehouse</argument> <env-var>HADOOP_USER_NAME=${wf:user()}</env-var> <file>${scriptPath}/${cutoffCountryScript}#${cutoffCountryScript}</file> </shell> <ok to="joining" /> <error to="sendFailureEmail" /> </action> <join name="joining" to="sendSuccessEmail"/> <action name="sendSuccessEmail"> <email xmlns="uri:oozie:email-action:0.1"> <to>${failureEmailToAddress}</to> <subject>Successfully created Filled reports :${wf:actionData('filled_elements_cutoff_report')['${wf:actionData('read_cutoff')['cutoff']}']}</subject> <body> Filled Element Cutoff reports created at /data/93-reporting/aspect. </body> </email> <ok to="end"/> <error to="fail"/> </action> <action name="sendFailureEmail"> <email xmlns="uri:oozie:email-action:0.1"> <to>${failureEmailToAddress}</to> <subject>Unable to Run reports :${wf:actionData('filled_report')['cutoff_value']}</subject> <body> The workflow ${wf:name()} with id ${wf:id()} failed [${wf:errorMessage(wf:lastErrorNode())}]. </body> </email> <ok to="fail"/> <error to="fail"/> </action> <kill name="fail"> <message>Script failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> </kill> <end name='end' /> </workflow-app>
Any help is much appreciated.
Created 05-27-2016 02:13 PM
The error is in your first shell action "cutoff_values_table". You've got the letter "z" at the end of the line.
<argument>-t</argument>z
Remove it and the XML validates.
As an aside, if you want, you can make your workflow a bit smaller by reducing the number of <argument> tags. The contents of <argument> tags are space-delimited in the order that they are declared, so you could turn
<argument>-c</argument> <argument>${value}</argument>
into
<argument>-c ${value}</argument>
for example.
Created 05-27-2016 02:13 PM
The error is in your first shell action "cutoff_values_table". You've got the letter "z" at the end of the line.
<argument>-t</argument>z
Remove it and the XML validates.
As an aside, if you want, you can make your workflow a bit smaller by reducing the number of <argument> tags. The contents of <argument> tags are space-delimited in the order that they are declared, so you could turn
<argument>-c</argument> <argument>${value}</argument>
into
<argument>-c ${value}</argument>
for example.