Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Error while validating Oozie workflow?

avatar
Expert Contributor

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.

1 ACCEPTED SOLUTION

avatar
New Member

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.

View solution in original post

1 REPLY 1

avatar
New Member

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.