Support Questions
Find answers, ask questions, and share your expertise

How to get rid of this Error Response: HTTP/1.1 404 Not Found, Am trying to update policies using REST APIS from command line.

New Contributor

Below is the command used :

[it1@sandbox root]$ curl -i --header "Accept:application/json" -H "Content-Type:application/j
son" --user admin:admin -X POST http://127.0.0.1:6080/service/public/api/policy -d '{ "policy
Name":"hadoopdev-testing-policy2","resourceName":"/demo/data/test","description":"Testing pol
icy for /demo/data/test","repositoryName":"sandbox_hdfs","repositoryType":"HDFS","permList":[
{"userList":["mkgt1"],"permList":["Read"]},{"groupList":["IT"],"permList":["Read"]}],"isEnabl
ed":true,"isRecursive":true,"isAuditEnabled":true,"version":"0.1.0","replacePerm":false}' 
4 REPLIES 4

@Micheal Kubbo

Is /demo/data/test a correct path? Have you tried "./demo/data/test" or "demo/data/test" or the absolute path?

New Contributor

Thanks Stanca, but tried changing the path but still get the same error. "Like....."

HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=14DC40BFED4EC4D2010A87FFA6DAEBDE; Path=/; HttpOnly
X-Frame-Options: DENY
Content-Length: 0
Date: Tue, 07 Jun 2016 00:27:40 GMT
[it1@sandbox root]$

@Micheal Kubbo

What HDP sandbox version do you use? I am intrigued on whether your sandbox supports HTTP 1.0 or 1.1. True, 1.0 is very old and it is unlikely the case, but you should still check. I run the following command on HDP 2.4 sandbox:

curl --head 127.0.0.1

and the result is:

HTTP/1.1 200 OK

Date: Thu, 09 June 2016 03:26:25 GMT

Server: gunicorn/19.1.1
...

New Contributor

Thanks @Constantin Stanca

Command works well.. However error still remains.

HTTP/1.1 200 OK                                                                                                                                   
Date: Thu, 09 Jun 2016 03:35:48 GMT                                                                                                                  
Server: gunicorn/19.1.1                                                                                                                              
Transfer-Encoding: chunked                                                                                                                           
Content-Type: text/html; charset=UTF-8                                                                                                               
Connection: close