Support Questions

Find answers, ask questions, and share your expertise

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

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.

View solution in original post

9 REPLIES 9

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...

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).

 

 

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

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?

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

 

 

 

 

 

 

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.

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

New Contributor

Sometimes my namenode stops when I try to login with browser

 

localhost:50070.

 

What could be the reson for it?.

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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.