Support Questions

Find answers, ask questions, and share your expertise

Could not submit Oozie workflow with distcp-action

avatar
Expert Contributor

Hi,

I am trying to submit Oozie workflow with distcp-action but getting below error when I validate the workflow

oozie validate pdr-distcp-wf.xml Error: Invalid app definition, org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 20; cvc-complex-type.2.4.a: Invalid content was found starting with element 'configuration'. One of '{"uri:oozie:distcp-action:0.2":arg}' is expected.

Please find the workflow that I am using below....

<workflow-app xmlns="uri:oozie:workflow:0.2" name="pdr-distcp-wf">
 <start to="distcp-node"/>
  <action name="distcp-node">
   <distcp xmlns="uri:oozie:distcp-action:0.2">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode1}</name-node>
            <arg>${SourceDir}</arg>
            <arg>${TargetDir}</arg>
    <configuration>
     <property>
       <name>oozie.launcher.mapreduce.job.hdfs-servers</name>
       <value>${nameNode1},${nameNode2}</value>
     </property>
   </configuration>
  </distcp>
   <ok to="end"/>
   <error to="kill"/>
 </action>
  <kill name="kill">
      <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
  </kill>
  <end name="end"/>
</workflow-app>

Please help me out

1 ACCEPTED SOLUTION

avatar
Master Mentor
11 REPLIES 11

avatar
Master Mentor

you forgot to close the discp action with </distcp>

  <distcp xmlns="uri:oozie:distcp-action:0.2">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode1}</name-node>
            <arg>${nameNode1}/path/to/input.txt</arg>
            <arg>${nameNode2}/path/to/output.txt</arg>
  </distcp>
	

avatar
Expert Contributor

I closed it.

You can see it below to </configuration>

avatar
Master Mentor

@Venkata Sridhar Gangavarapu I did not say close configuration block, you did not close distcp block

<distcpxmlns="uri:oozie:distcp-action:0.2">

</distcp>

avatar
Expert Contributor

Okay...Below is my workflow where I have the distcp block closed as well

<distcp xmlns="uri:oozie:distcp-action:0.2">

<job-tracker>${jobTracker}</job-tracker>

<name-node>${nameNode1}</name-node>

<arg>${SourceDir}</arg>

<arg>${TargetDir}</arg>

<configuration>

<property>

<name>oozie.launcher.mapreduce.job.hdfs-servers</name>

<value>${nameNode1},${nameNode2}</value>

</property>

</configuration>

</distcp>

I still get the same error

Error: Invalid app definition, org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 19; cvc-complex-type.2.4.a: Invalid content was found starting with element 'configuration'. One of '{"uri:oozie:distcp-action:0.2":arg}' is expected.

avatar
Master Mentor

try to replace your workflow with this and then plugin your values

https://github.com/apache/oozie/blob/master/examples/src/main/apps/distcp/workflow.xml

avatar
Expert Contributor

I changed the workflow as you suggested

<workflow-app xmlns="uri:oozie:workflow:0.3" name="pdr-distcp-wf"> <start to="distcp-node"/> <action name="distcp-node"> <distcp xmlns="uri:oozie:distcp-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode1}</name-node> <arg>${SourceDir}</arg> <arg>${TargetDir}</arg> <configuration> <property> <name>oozie.launcher.mapreduce.job.hdfs-servers</name> <value>${nameNode1},${nameNode2}</value> </property> </configuration> <arg>${SourceDir}</arg> <arg>${TargetDir}</arg> </distcp> <ok to="end"/> <error to="kill"/> </action> <kill name="kill"> <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> </kill> <end name="end"/> </workflow-app>

But still the same error

Error: Invalid app definition, org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 19; cvc-complex-type.2.4.a: Invalid content was found starting with element 'configuration'. One of '{"uri:oozie:distcp-action:0.1":arg}' is expected

avatar
Expert Contributor

I did as you said. Below is the changed workflow.

<workflow-app xmlns="uri:oozie:workflow:0.3" name="pdr-distcp-wf"> <start to="distcp-node"/> <action name="distcp-node"> <distcp xmlns="uri:oozie:distcp-action:0.1"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode1}</name-node> <arg>${SourceDir}</arg> <arg>${TargetDir}</arg> <configuration> <property> <name>oozie.launcher.mapreduce.job.hdfs-servers</name> <value>${nameNode1},${nameNode2}</value> </property> </configuration> <arg>${SourceDir}</arg> <arg>${TargetDir}</arg> </distcp> <ok to="end"/> <error to="kill"/> </action> <kill name="kill"> <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> </kill> <end name="end"/> </workflow-app>

I still see the below error

Error: Invalid app definition, org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 19; cvc-complex-type.2.4.a: Invalid content was found starting with element 'configuration'. One of '{"uri:oozie:distcp-action:0.1":arg}' is expected.

Please advice

Thanks,

Venkat

avatar

@Venkata Sridhar Gangavarapu

In the example from the oozie github, all of the <arg> parameters are after the <configuration> section. In your latest example, you have <arg> statements on both sides of the <configuration> block. Try moving all of your <arg>s to after the <configuration> block. It seems to be expecting the <configuration> block before any <arg> statements.

avatar
Expert Contributor

Hey Emaxwell,

You are correct. The args should be after the configuration block is closed. The workflow is valid now

Artem Ervits: Thank you so much for your help on this.

The issue is resolved..!!