Unable to run append or delete-target-dir due to permission issues

Hi,
On trying to practice append and delete-target-dir control commands as per the demos in videos, I have been getting permission issues (see error below).

19/12/06 06:07:23 ERROR tool.ImportTool: Encountered IOException running import job: org.apache.hadoop.security.AccessControlException: Permission denied: user=jshivakumaar, access=WRITE, inode="/user/training/sqoop_import/retail_db/order_items

Could you please provide the required privileges?
Please note - the commands are run with retail_user as per the demo.

Regards,
Shiva

Appears the problem is with write privileges to HDFS FS. This is blocking my practice and appreciate if you could resolve this asap please.

Thanks,
Shiva

Could you please reply with the complete command which you are trying so that we can help you in a better way.

Command executed is below.

sqoop import
–connect “jdbc:mysql://ms.itversity.com:3306/retail_db”
–username retail_user
–password itversity
–table order_items
–warehouse-dir /user/training/sqoop_import/retail_db
–delete-target-dir

Error:

19/12/07 00:18:30 ERROR tool.ImportTool: Encountered IOException running import job: org.apache.hadoop.security.AccessControlException: Permission denied: user=jshivakumaar, access=WRITE, inode="/user/training/sqoop_import/retail_db/order_items":training:hdfs:drwxr-xr-x

Also please note: \ was added to every line in the command prompt.

You are saving it in another user space that is why you are getting this permission denied error. Give your username instead of itversity.

Sorry, I am not clear. On runnning,

sqoop import
–connect “jdbc:mysql://ms.itversity.com:3306/retail_db”
–username jshivakumaar
–password shoh3sohm9quuuz8Fai3quee8noo0Cah
–table orders
–target-dir /user/training/sqoop_import/retail_db/orders

I get the same error -Error executing statement: java.sql.SQLException: Access denied for user ‘jshivakumaar’@‘149.56.27.98’ (using password: YES)
java.sql.SQLException: Access denied for user ‘jshivakumaar’@‘149.56.27.98’ (using password: YES)

Can you please give the exact user name and password ?

Please try with this below code

   sqoop import \
  --connect jdbc:mysql://ms.itversity.com:3306/retail_db \
  --username retail_user \
  --password itversity \
  --table order_items \
  --warehouse-dir /user/jshivakumaar/sqoop_import/retail_db \
  --delete-target-dir

This code worked. The only difference I see is the connect parameters are not having " ".

But, when I run the following codes, I still get the same error. Can you please help me understand the issue and fix ?

sqoop import
–connect jdbc:mysql://ms.itversity.com:3306/retail_db
–username retail_user
–password itversity
–table orders
–target-dir /user/training/sqoop_import/retail_db/orders
–delete-target-dir

sqoop import
-Dorg.apache.sqoop.splitter.allow_text_splitter=true
–connect jdbc:mysql://ms.itversity.com:3306/nyse
–username nyse_user
–password itversity
–table stock_eod
–warehouse-dir /user/training/sqoop_import/nyse
–delete-target-dir

Caused by: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.AccessControlException): Permission denied: user=jshivakumaar, access=WRITE, inode="/user/training/sqoop_import/retail_db/orders":training:hdfs:drwxr-xr-x

You must understand this is not lab issue these are coding issues. Difference between the

sqoop import
–connect “jdbc:mysql://ms.itversity.com:3306/retail_db”
–username jshivakumaar
–password shoh3sohm9quuuz8Fai3quee8noo0Cah
–table orders
–target-dir /user/training/sqoop_import/retail_db/orders

and

sqoop import \
  --connect jdbc:mysql://ms.itversity.com:3306/retail_db \
  --username retail_user \
  --password itversity \
  --table order_items \
  --warehouse-dir /user/jshivakumaar/sqoop_import/retail_db \

is not “”" . You are giving other user path for warehouse-dir /user/training/sqoop_import/nyse
for which you don’t have access. So we have changed that to your path /user/jshivakumaar/sqoop_import/retail_db.

As these are coding issues you have to take it from here.

Thanks for the clarification.