405 Method DELETE not supported (AEM 6.3 SP2)

Avatar

Avatar

important_monke

Avatar

important_monke

important_monke

07-06-2018

I need to clean a publish instance of several large assets and have done so on author by generating a list and deleting with cURL commands like:

curl -u admin:admin -X DELETE "http://localhost:4503/content/dam/abc/def/images/shirts.png"

it works on author but on publish, the result is the following ...

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html>

    <head><title>405 Method DELETE not supported</title></head>

    <body>

        <h1>Method DELETE not supported</h1>

        <p>Cannot serve request to /content/dam/abc/def/images/shirts.png on this server</p>

        <hr>

        <address>Apache Sling</address>

    </body>

</html>

The admin account is in the administrators group on the publish instance. I've tried cURL with admin and with a different privileged user on the publish instance, each appear to have all (including delete) permissions on the nodes in question.

I've enabled crxde on this publish instance.

Is there some place I must configure to allow the DELETE method?

Once I can delete these, I know garbage collection will ultimately reclaim the space.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

aneeta45259594

Avatar

aneeta45259594

aneeta45259594

07-06-2018

I believe the issue you're facing is because the following bundle [1] is not available on your Publish instance. And this is expected if you've setup your instance with nosamplecontent runmode as per Running AEM in Production Ready Mode . If you need this for your use case, you can get the bundle from the Author server and install it on the Publish server to move forward with your use-case.

Ideally, you should not be deleting anything directly on Publish instance. Unpublish from Author first should help.

Best Regards,

Aneet

[1] Apache Sling Simple WebDAV Access to repositories (org.apache.sling.jcr.webdav)

Answers (2)

Answers (2)

Avatar

Avatar

important_monke

Avatar

important_monke

important_monke

07-06-2018

Thanks Aneet,

I was running with nosamplecontent, not because it was prod, but because I didn't want sample content. Indeed, the publish was missing "Apache Sling Simple WebDAV" bundle -- I copied it over from the author and installed it on publish, but still received the 405.

It wasn't until I reconfigured this bundle's config (to match the author's) that I was able to successfully delete the files via cURL.

Any idea why?

I changed:

- Root Path from -- /dav to /crx/repository

- Non Collection Node Types -- added dam:Asset

mirroring the author's values for Apache Sling Simple WebDAV.

Can you tell me what these fields represent and why it was required for my cURL -X DELETE commands to work?

I appreciate the advice about deactivating instead, but the goal here was simply to remove the largest binary files of various types. I did a query of the largest .zip, .exe, .jpg, .psd, .iso, etc. files, and used this to form my list of files to delete. The instances are for Dev, so consistency was not required, the more important objective was getting these instances running on the available limited disk of our Dev hardware. Additionally, I wanted to delete the largest files on both instances, not necessarily files that were active or inactive.

Thanks again!

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

07-06-2018

You may check "Apache Sling Referrer Filter" configuration

Go to the Felix Console – http://localhost:4502/system/console/configMgr

Search for “Apache Sling Referrer Filter”

What is the AEM Apache Sling Referrer Filter OSGI configuration? - Sourced Code 

Thanks

Arun