Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.8.0
-
None
-
None
-
HDP 2.6 + Ambari 2.6.0
Description
WebHDFS sees the wrong path when a request does not provide one.
For example, GETFILESTATUS on an empty path results in a FileNotFoundException:
$ curl -sS -L -w '%{http_code}' -X GET 'http://172.18.0.3:50070/webhdfs/v1?op=GETFILESTATUS&user.name=hdfs' {"RemoteException":{"exception":"FileNotFoundException","javaClassName":"java.io.FileNotFoundException","message":"File does not exist: /webhdfs/v1"}}404
Note the message: the RPC is seeing an incorrect path (/webhdfs/v1).
Because of AMBARI-22492, this leads to unexpected behaviors when deploying with Ambari:
- GETFILESTATUS is issued as /webhdfs/v1?op=GETFILESTATUS which results in a FileNotFoundException.
- Since Ambari was told the path doesn't exist, it tries to create it with MKDIRS (which succeeds!):
$ curl -sS -L -w '%{http_code}' -X PUT 'http://172.18.0.3:50070/webhdfs/v1?op=MKDIRS&user.name=hdfs' {"boolean":true}200
# hdfs dfs -ls -R /webhdfs
drwx------ - hive hadoop 0 2017-11-20 23:24 /webhdfs/v1
ls: Permission denied: user=root, access=READ_EXECUTE, inode="/webhdfs/v1":hive:hadoop:drwx------