Support Questions
Find answers, ask questions, and share your expertise

oozie sqoop action gets exit code [1] yet its corresponding mapreduce job SUCCEED

New Contributor

I am using HDP 2.3.2, with sqoop 1.4.6, oozie 4.2.0, hive 1.2.1, hadoop 2.7.1.

hive warehouse dir: /apps/hive/warehouse

I run the following sqoop commands and submit oozie job with user hdfs:hdfs

Manually run sqoop import is OK, and it did succeeded imported mysql table to hive table.

sqoop import --connect jdbc:mysql:// --driver com.mysql.jdbc.Driver --username root --password root --table clb_usertoken --warehouse-dir /user/hive/warehouse --hive-import --hive-overwrite

Use oozie workflow to do the sqoop import failed.

One of the action always get this error "Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]"

And its corresponding mapreduce job is actually SUCCEEDED.


I can also find the successfully processed files under /user/hive/warehouse

[hdfs@data006 import_from_mysql]$ hdfs dfs -ls -R /user/hive/warehouse
drwxr-xr-x - hdfs hdfs 0 2016-01-13 14:05 /user/hive/warehouse/clb_usertoken
-rw-r--r-- 3 hdfs hdfs 0 2016-01-13 14:05 /user/hive/warehouse/clb_usertoken/_SUCCESS
-rw-r--r-- 3 hdfs hdfs 375228 2016-01-13 14:05 /user/hive/warehouse/clb_usertoken/part-m-00000
-rw-r--r-- 3 hdfs hdfs 372955 2016-01-13 14:05 /user/hive/warehouse/clb_usertoken/part-m-00001
-rw-r--r-- 3 hdfs hdfs 380625 2016-01-13 14:05 /user/hive/warehouse/clb_usertoken/part-m-00002
-rw-r--r-- 3 hdfs hdfs 387143 2016-01-13 14:05 /user/hive/warehouse/clb_usertoken/part-m-00003

So it seems that the final step to import the processed result directory to hive warehouse failed.

But I can't find any useful log from oozie.log.

Please, can anyone point out what's wrong here?


Attached workflow.xml (2nd action, I've deleted the unnecessary lines after.) &


nameNode=hdfs:// hive2JdbcUrl=jdbc:hive2://




I remember similar problems, the log error was hidden somewhere either in the launcher log or in the oozie job log. ( if you have hue it is a bit clicking it could either be in the action log or the main job log ). My problem was that the hive import of sqoop requires the hive client to be installed on every datanode since sqoop simply uses the hive command under the cover. I ended up splitting up the job into two actions one for sqoop to load and a second hive2 action for the import.

New Contributor

thanks this can be another working workaround solution.


@Hao Ji it means the user has permission problems moving the final results to hive. Here's a working example I built, replace my sqoop command in with yours.

New Contributor


Currently I am using ssh action to call sqoop import as workaround.

Rising Star

I'm using HDP 2.3.2 sandbox. To make sqoop from oozie run, I needed:

- set port forwarding for 10020 in sandbox to avoid connection refuse issue

- copy oracle jdbc drive to HDFS /user/oozie/share/lib/lib_20151027124452/sqoop directory

Now, I can run sqoop list-tables or list-databases command; however, sqoop import fails with both HDFS and Hive. Since it just return error code like in this article, I don't know what's wrong exactly. Would you have any suggestion kindly?

Hello All. I am facing similar problem .

A little background , Cluster is running with HDP 2.3.2 kerberos enabled . Now when running sqoop import command alone it works fine . Also Oozie is working well with sqoop list table, However when Oozie has below workflow -

<workflow-app name="sample-wf" xmlns="uri:oozie:workflow:0.1">
  <start to="source2landingZone"/>
  <action name="source2landingZone">
  <sqoop xmlns="uri:oozie:sqoop-action:0.2">
  <command>sqoop import --connect jdbc:oracle:thin:@ --username HADOOP_I --password xxxxx --as-textfile --target-dir /org/itpgi/abagels/sqoop/BPRF_2 --fields-terminated-by ',' --query "select * from BPRF where \$CONDITIONS" -m 1</command>
  <ok to="end"/>
  <error to="kill"/>
  <kill name="kill">
  <message>Action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
  <end name="end"/>

it fails -

with error -

Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]

Job is successful though. with succeeded status and no bad logs in RM.

Any help is highly appreciated.


Rohit Sureka

@Artem Ervits @Adam Whitter

I tried also with Shell Action however it fails with same error code -

Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]

Could you please help me ?

Thank you,

Rohit Sureka


Thank you very much.