Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Solved Go to solution

WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Hi,

 

in the Cloudera Quickstart VM I am trying to submit requests using WebHDFS, but everything I put a HTTP PUT operation in the browser the following error appears (example shows operation "MKDIRS"):

 

http://XX.XX.XX.XX:50070/webhdfs/v1/mnt/cloudera/hadoop/user/hive/warehouse/mapreduce?op=MKDIRS

 

{"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"Invalid value for webhdfs parameter \"op\": No enum constant org.apache.hadoop.hdfs.web.resources.GetOpParam.Op.MKDIRS"}}

 

 

It looks like WebHDFS is searching for PUT operations in the GET library.

 

No enum constant org.apache.hadoop.hdfs.web.resources.GetOpParam.Op.MKDIRS

 

I appreciate any help on this.

 

Thanks,

Matthias

1 ACCEPTED SOLUTION

Accepted Solutions

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Super Collaborator

"I am putting the following HTTP URL in the address bar, e.g. "

the URL that you type in the address bar is translated into GET by the web browser, not a PUT method. You could use a REST client (web browser) plugin to assist your with submitting PUT/POST/DELETE methods from your browser.

9 REPLIES 9

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Super Collaborator

but everything I put a HTTP PUT operation in the browser

Can you clarify how you are submitting PUT request from the browser, so we can reproduce it in-house. 

 

Try the following from a linux terminal 

#PUT

# curl -i -X PUT "http://XX.XX.XX.XX:50070/webhdfs/v1/tmp/mapreduce?op=MKDIRS"

 

#GET

# curl -i -X GET "http://XX.XX.XX.XX:50070/webhdfs/v1/tmp?op=LISTSTATUS"

 

Reference:

https://archive.cloudera.com/cdh5/cdh/5/hadoop/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Make_a_D...

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

From the browser I am using the following request:

 

http://xx.xx.xx.xx:50070/webhdfs/v1/mnt/cloudera/hadoop/user/hive/warehouse/mapreduce?op=MKDIRS

 

 

From the linux terminal it's working (as you mentioned).

 

 

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Please let me know when you have tested in inhouse. I have also tested it on another (self-installed) system (OS Ubuntu) and I am getting the same error:

 

Request in the browser:

 

http://localhost:50070/webhdfs/v1/tmp/test1?op=MKDIRS

 

Answer in the browser:

 

{"RemoteException":{"exception":"IllegalArgumentException","javaClassName":"java.lang.IllegalArgumentException","message":"Invalid value for webhdfs parameter \"op\": No enum constant org.apache.hadoop.hdfs.web.resources.GetOpParam.Op.MKDIRS"}}

 

Thanks,

Matthias

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Super Collaborator

" I put a HTTP PUT operation in the browser "

Can you elaborate how you use HTTP PUT in your web browser? Please write down the steps you are using to do this, for example are you using a browser plugin, if so which?

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

I am using the WebHDFS REST API as described in

 

https://archive.cloudera.com/cdh5/cdh/5/hadoop/hadoop-project-dist/hadoop-hdfs/WebHDFS.html

 

I am putting the following HTTP URL in the address bar, e.g. 

 

http://localhost:50070/webhdfs/v1/tmp/test1?op=MKDIRS

 

 

 

 

 

 

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Super Collaborator

"I am putting the following HTTP URL in the address bar, e.g. "

the URL that you type in the address bar is translated into GET by the web browser, not a PUT method. You could use a REST client (web browser) plugin to assist your with submitting PUT/POST/DELETE methods from your browser.

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Thanks a lot, it' working now (maybe you could include this in the description of how to use the WebHDFS in th link above).

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

New Contributor

Sometimes my namenode stops when I try to login with browser

 

localhost:50070.

 

What could be the reson for it?.

Re: WebHDFS error with HTTP PUT operations in Cloudera Quickstart VM

Explorer

As another user said: Port 50070 has stopped working. What can people who have this problem do? I see a scaring lack of support in the questions I have browsed regarding this issue.