[ 
https://issues.apache.org/jira/browse/HDDS-4838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17758580#comment-17758580
 ] 

Himanshi Darvekar edited comment on HDDS-4838 at 8/24/23 1:10 PM:
------------------------------------------------------------------

If we add Ozone manager jar and hdds server framework jar to the hadoop 
classpath

And execute the command along with passing the fs.trash.classname with its 
value org.apache.hadoop.ozone.om.TrashPolicyOzone in it like below:
{code:java}
hdfs dfs -Dfs.trash.classname=org.apache.hadoop.ozone.om.TrashPolicyOzone  -rm 
-r o3fs://bucket1.volume1.ozone1/ {code}
then it's not throwing the NPE error
{code:java}
$ hdfs dfs -Dfs.trash.classname=org.apache.hadoop.ozone.om.TrashPolicyOzone  
-rm -r o3fs://bucket1.volume1.ozone1/
23/08/24 12:58:28 INFO Configuration.deprecation: io.bytes.per.checksum is 
deprecated. Instead, use dfs.bytes-per-checksum
rm: Recursive rm of bucket o3fs://bucket1.volume1.ozone1/ not permitted. 
Consider using -skipTrash option
 {code}
Let me know if this works. 


was (Author: JIRAUSER301310):
If we add Ozone manager jar and hdds server framework jar to the hadoop 
classpath:
{code:java}
export 
HADOOP_CLASSPATH=/opt/cloudera/parcels/CDH-7.1.9-1.cdh7.1.9.p0.43882214/jars/ozone-manager-1.2.0.7.1.9.0-342.jar:$HADOOP_CLASSPATH
export 
HADOOP_CLASSPATH=/opt/cloudera/parcels/CDH-7.1.9-1.cdh7.1.9.p0.43882214/jars/hdds-server-framework-1.2.0.7.1.9.0-342.jar:$HADOOP_CLASSPATH{code}
And execute the command along with passing the fs.trash.classname with its 
value org.apache.hadoop.ozone.om.TrashPolicyOzone in it like below:
{code:java}
hdfs dfs -Dfs.trash.classname=org.apache.hadoop.ozone.om.TrashPolicyOzone  -rm 
-r o3fs://bucket1.volume1.ozone1/ {code}
then it's not throwing the NPE error
{code:java}
$ hdfs dfs -Dfs.trash.classname=org.apache.hadoop.ozone.om.TrashPolicyOzone  
-rm -r o3fs://bucket1.volume1.ozone1/
23/08/24 12:58:28 INFO Configuration.deprecation: io.bytes.per.checksum is 
deprecated. Instead, use dfs.bytes-per-checksum
rm: Recursive rm of bucket o3fs://bucket1.volume1.ozone1/ not permitted. 
Consider using -skipTrash option
 {code}

Let me know if this works. 

> Deleting at bucket root throws NPE
> ----------------------------------
>
>                 Key: HDDS-4838
>                 URL: https://issues.apache.org/jira/browse/HDDS-4838
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Client
>    Affects Versions: 1.0.0
>            Reporter: Wei-Chiu Chuang
>            Assignee: Himanshi Darvekar
>            Priority: Major
>
> {noformat}
> $ sudo -u hdfs hdfs dfs -rm -r o3fs://tpcds100gb.sparksqldata.ozone1/
> 21/02/18 10:29:53 INFO Configuration.deprecation: io.bytes.per.checksum is 
> deprecated. Instead, use dfs.bytes-per-checksum
> -rm: Fatal internal error
> java.lang.NullPointerException
>         at org.apache.hadoop.fs.Path.mergePaths(Path.java:273)
>         at 
> org.apache.hadoop.fs.TrashPolicyDefault.makeTrashRelativePath(TrashPolicyDefault.java:113)
>         at 
> org.apache.hadoop.fs.TrashPolicyDefault.moveToTrash(TrashPolicyDefault.java:146)
>         at org.apache.hadoop.fs.Trash.moveToTrash(Trash.java:110)
>         at org.apache.hadoop.fs.Trash.moveToAppropriateTrash(Trash.java:96)
>         at org.apache.hadoop.fs.shell.Delete$Rm.moveToTrash(Delete.java:153)
>         at org.apache.hadoop.fs.shell.Delete$Rm.processPath(Delete.java:118)
>         at 
> org.apache.hadoop.fs.shell.Command.processPathInternal(Command.java:367)
>         at org.apache.hadoop.fs.shell.Command.processPaths(Command.java:331)
>         at 
> org.apache.hadoop.fs.shell.Command.processPathArgument(Command.java:304)
>         at 
> org.apache.hadoop.fs.shell.Command.processArgument(Command.java:286)
>         at 
> org.apache.hadoop.fs.shell.Command.processArguments(Command.java:270)
>         at 
> org.apache.hadoop.fs.shell.FsCommand.processRawArguments(FsCommand.java:120)
>         at org.apache.hadoop.fs.shell.Command.run(Command.java:177)
>         at org.apache.hadoop.fs.FsShell.run(FsShell.java:328)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
>         at org.apache.hadoop.fs.FsShell.main(FsShell.java:391)
> {noformat}
> Expected: it should throw a more graceful error. If the same command with  
> -skipTrash option, it errors out with this:
> {noformat}
> $ sudo -u hdfs hdfs dfs -rm -r -skipTrash 
> o3fs://tpcds100gb.sparksqldata.ozone1/
> 21/02/18 10:31:24 WARN ozone.BasicOzoneFileSystem: Cannot delete root 
> directory.
> rm: `o3fs://tpcds100gb.sparksqldata.ozone1/': Input/output error
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to