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

Arpit Gupta commented on HDFS-2458:
-----------------------------------

Issue a create call using rest api's for a file that exists.

Actual
1. received a 307 and on the redirected call received a 403

with the message

{"RemoteException":{"exception":"RemoteException","javaClassName":"org.apache.hadoop.ipc.RemoteException","message":"java.io.IOException:
 failed to create file /tmp/webhdfs_data/file_that_exists.txt on client 
127.0.0.1 either because the filename is invalid or the file exists\n\tat 
org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFileInternal(FSNamesystem.java:1237)\n\tat
 
org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFile(FSNamesystem.java:1166)\n\tat
 
org.apache.hadoop.hdfs.server.namenode.NameNode.create(NameNode.java:617)\n\tat 
sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)\n\tat 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n\tat
 java.lang.reflect.Method.invoke(Method.java:597)\n\tat 
org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563)\n\tat 
org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388)\n\tat 
org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384)\n\tat 
java.security.AccessController.doPrivileged(Native Method)\n\tat 
javax.security.auth.Subject.doAs(Subject.java:396)\n\tat 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)\n\tat
 org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382)\n"}}


If an error is going to be thrown in the create or append calls we should throw 
it before the redirect if possible.

                
> webhdfs create call throws an error after the redirect if the file exists, we 
> should throw a 403 before
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-2458
>                 URL: https://issues.apache.org/jira/browse/HDFS-2458
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 0.20.205.0
>            Reporter: Arpit Gupta
>            Assignee: Tsz Wo (Nicholas), SZE
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to