Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10684

WebHDFS DataNode calls fail without parameter createparent

    XMLWordPrintableJSON

Details

    Description

      Optional boolean parameters that are not provided in the URL cause the WebHDFS create file command to fail.

      curl -i -X PUT "http://hadoop-primarynamenode:50070/webhdfs/v1/tmp/test1234?op=CREATE&overwrite=false"

      Response:

      HTTP/1.1 307 TEMPORARY_REDIRECT
      Cache-Control: no-cache
      Expires: Fri, 15 Jul 2016 04:10:13 GMT
      Date: Fri, 15 Jul 2016 04:10:13 GMT
      Pragma: no-cache
      Expires: Fri, 15 Jul 2016 04:10:13 GMT
      Date: Fri, 15 Jul 2016 04:10:13 GMT
      Pragma: no-cache
      Content-Type: application/octet-stream
      Location: http://hadoop-datanode1:50075/webhdfs/v1/tmp/test1234?op=CREATE&namenoderpcaddress=hadoop-primarynamenode:8020&overwrite=false
      Content-Length: 0
      Server: Jetty(6.1.26)

      Following the redirect:

      curl -i -X PUT -T MYFILE "http://hadoop-datanode1:50075/webhdfs/v1/tmp/test1234?op=CREATE&namenoderpcaddress=hadoop-primarynamenode:8020&overwrite=false"

      Response:

      HTTP/1.1 100 Continue

      HTTP/1.1 400 Bad Request
      Content-Type: application/json; charset=utf-8
      Content-Length: 162
      Connection: close

      {"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"Failed to parse \"null\" to Boolean."}}

      The problem can be circumvented by providing both "createparent" and "overwrite" parameters.

      However, this is not possible when I have no control over the WebHDFS calls, e.g. Ambari and Hue have errors due to this.

      Attachments

        1. HDFS-10684.004.patch
          5 kB
          John Zhuge
        2. HDFS-10684.003.patch
          4 kB
          John Zhuge
        3. HDFS-10684.002-branch-2.patch
          5 kB
          John Zhuge
        4. HDFS-10684.001-branch-2.patch
          3 kB
          John Zhuge

        Issue Links

          Activity

            People

              jzhuge John Zhuge
              loungerdork Samuel Low
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: