It's all about the answers!

Ask a question

HTTP delete method to remove a RM Folder but it seems etag mismatched


JM Seo (2622) | asked Mar 13 '13, 2:11 a.m.
Hi,

I tried to remove a RM folder with or without any resource inside but both cases throw the same 412 precondition failure error. Strange thing is when I checked the etag on a folder and use it for HTTP Delete method, RM error log says it's not identical. Here is the error message.
Response:    HTTP/1.1 412     Server: Apache-Coyote/1.1    Cache-Control: private    Expires: Thu, 01 Jan 1970 10:00:00 EST    Content-Type: text/html;charset=utf-8    Content-Length: 1424    Date: Wed, 13 Mar 2013 05:47:29 GMT    Content-Length: 1424    ---Start entity---    <html><head><title>Apache Tomcat/7.0.25 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 412 - CRJZS5053E If-Match ([&quot;_yHOhwYuXEeKzS-evXllyFA&quot;]) did not match the resource ETag (&quot;_yH0-sYuXEeKzS-evXllyFA&quot;) and was not a wildcard.</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>CRJZS5053E If-Match ([&quot;_yHOhwYuXEeKzS-evXllyFA&quot;]) did not match the resource ETag (&quot;_yH0-sYuXEeKzS-evXllyFA&quot;) and was not a wildcard.</u></p><p><b>description</b> <u>A specified precondition has failed for this request (CRJZS5053E If-Match ([&quot;_yHOhwYuXEeKzS-evXllyFA&quot;]) did not match the resource ETag (&quot;_yH0-sYuXEeKzS-evXllyFA&quot;) and was not a wildcard.).</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.25</h3></body></html>

I checked the etag using REST Client on FF but I can only see the one I used not one from the RM log. Also even with 412 error, it still deletes a RM folder.

Can you please advise me if delete method for RM Folder requires further action or not supported?

Thank you,










2 answers



permanent link
Jerrod Lankford (16) | answered Mar 15 '13, 1:11 p.m.
Hey Charlie,

What version of RM are you on specifically? Also what is the exact reasoning behind deleting folders with an http request. I haven't looked into it exactly but the issue is likely due to the fact that folders are a bit more complicated than one resource. What maybe be happening is when you are deleting the folder resource its trying to delete the other parts of the resource with the same etag (this would explain why the folder does indeed disappear). Long story short you should use the following http request to delete folders:

Make a post to:

folderUri?deleteRecursive

The same way you made the delete, with private headers and the if-match.

If you have any more questions don't hesitate to ask. Thanks

permanent link
Jerrod Lankford (16) | answered Mar 15 '13, 2:21 p.m.
I also forgot to mention, depending on the version of RM you will either receive a 200 OK response if the delete was successful, or a 202 Accepted (which means the action has been queued up). In the latter case there will be a tracker uri in the location response header that you can do a get on to see the progress of the folder delete.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.