HDFS Forum

WebHDFS error when deleting file

  • #27826
    Meri Torres
    Member

    Hi,

    I’m getting an error when I try to delete a file using WebHDFS. The URL I’m using is http://IP:50075/webhdfs/v1/FILE?op=delete.
    Invoking other operations like OPEN, GETFILECHECKSUM works well.

    The response received is:
    Internal Server Error: {“RemoteException”:{“exception”:”WebApplicationException”,”javaClassName”:”javax.ws.rs.WebApplicationException”,”message”:null}}

    The error log in hadoop-hdfs-datanode-sandbox.log is:
    2013-06-19 12:17:42,734 WARN org.apache.hadoop.hdfs.web.resources.ExceptionHandler: INTERNAL_SERVER_ERROR
    javax.ws.rs.WebApplicationException
    at com.sun.jersey.server.impl.uri.rules.TerminatingRule.accept(TerminatingRule.java:66)
    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
    at org.apache.hadoop.http.HttpServer$QuotingInputFilter.doFilter(HttpServer.java:881)
    ….

to create new topics or reply. | New User Registration

  • Author
    Replies
  • #27871
    tedr
    Moderator

    Hi Meri,

    We are looking into this and will get back to you when we have an answer.

    Thanks,
    Ted.

    #42394
    Robert Molina
    Moderator

    Hi Meri,
    In regards to this error, can you execute the delete via hadoop fs commands?

    Regards,
    Robert

    #42414
    Meri Torres
    Member

    Hi Robert,

    Yes, I can delete the file via hadoop fs -rm and through the API (FileSystem.delete(Path, boolean).

    Thanks,
    Meri

    #43452
    Robert Molina
    Moderator

    Hi Meri,
    Are you getting any errors in the namenode logs? If so, can you post it?

    Regards,
    Robert

    #43468
    Meri Torres
    Member

    Hi Robert,

    Nope, no errors in the namenode logs. Only the one I have posted of hadoop-hdfs-datanode-sandbox.log.

    Thanks,
    Meri

    #43662
    Robert Molina
    Moderator

    Hi Meri,
    What version of hdp are you using? Is this sandbox? Also when making the call what client are you using? Are you able to to use curl? Also please provide the full uri.

    Regards,
    Robert

    #44166
    Meri Torres
    Member

    Hi Robert,

    I use Sandbox 1.3 RC6. For making the call I use both the browser and a Java program with apache httpclient 4.2.1, With both methods I am able to open the file with this URL http://192.168.17.135:50075/webhdfs/v1/user/wordcount_output?op=OPEN but it fails when I am trying to delete the file using http://192.168.17.135:50075/webhdfs/v1/user/wordcount_output?op=DELETE.

    The result of curl command is:
    curl -i -X DELETE http://192.168.17.135:50075/webhdfs/v1/user/wordcount_output?op=delete
    HTTP/1.1 500 Internal Server Error
    Content-Type: application/json
    Transfer-Encoding: chunked
    Server: Jetty(6.1.26)

    {“RemoteException”:{“exception”:”WebApplicationException”,”javaClassName”:”javax
    .ws.rs.WebApplicationException”,”message”:null}}

    Thanks,
    Meri

    #44784
    Koelli Mungee
    Moderator

    Hi Meri,

    I see you are using port 50075, which is typically the port for the datanode. The webhdfs URL uses the default port of 50070, for example,

    webhdfs_url=http://10.11.2.180:50070/webhdfs/v1/

    Can you check with this port (same port for namenode UI),

    Regards
    Koelli

You must be to reply to this topic. | Create Account

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.