Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-3670

WebHDFS have a "not-enabled" return code instead of using file not found

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 1.0.0, 2.0.0-alpha
    • Fix Version/s: None
    • Component/s: webhdfs
    • Labels:
      None
    • Target Version/s:

      Description

      WebHDFS (and HttpFs if it doesn't already) should have a return code indicating they are not enabled. Currently you get eg a file not found if webhdfs is not enabled which isn't intuitive.

      hadoop-3.0.0-SNAPSHOT $ ./bin/hadoop fs -get webhdfs://localhost:50070/user/eli/temp.json
      get: Unexpected HTTP response: code=404 != 200, op=GETFILESTATUS, message=Not Found
      

        Activity

        Hide
        Suresh Srinivas added a comment -

        Adding 1.0 to affects versions.

        Show
        Suresh Srinivas added a comment - Adding 1.0 to affects versions.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        > ... Currently you get eg a file not found if webhdfs is not enabled which isn't intuitive.

        More precisely, it is "resource not found" but not "file not found". The reason is that when WebHDFS is disabled, the servlets are not added and the web server returns "resource not found" by default. Note that when WebHDFS is enabled, "HDFS file not found" is a JSON FileNotFoundException response.

        BTW, I think there is no standard HTTP response for "not-enabled".

        Show
        Tsz Wo Nicholas Sze added a comment - > ... Currently you get eg a file not found if webhdfs is not enabled which isn't intuitive. More precisely, it is "resource not found" but not "file not found". The reason is that when WebHDFS is disabled, the servlets are not added and the web server returns "resource not found" by default. Note that when WebHDFS is enabled, "HDFS file not found" is a JSON FileNotFoundException response. BTW, I think there is no standard HTTP response for "not-enabled".
        Hide
        Alejandro Abdelnur added a comment -

        this does not apply to HttpFS, if HttpFS is up then it is enabled.

        Show
        Alejandro Abdelnur added a comment - this does not apply to HttpFS, if HttpFS is up then it is enabled.
        Hide
        Eli Collins added a comment -

        After seeing Nicholas' comment (that we do distinguish between resource not found and file not found) perhaps we don't need this.

        Show
        Eli Collins added a comment - After seeing Nicholas' comment (that we do distinguish between resource not found and file not found) perhaps we don't need this.
        Hide
        Tsz Wo Nicholas Sze added a comment -

        Let's close this as not-a-problem.

        Show
        Tsz Wo Nicholas Sze added a comment - Let's close this as not-a-problem.

          People

          • Assignee:
            Tsz Wo Nicholas Sze
            Reporter:
            Eli Collins
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development