Expand my Community achievements bar.

SOLVED

Assest API PUT and DELETE Methods are getting 501 Not Implemented Error

Avatar

Level 4

Hi,

I can POST, PUT, and DELETE  in the postman using Asset  API on my localhost.

http://localhost:4502/api/assets/discounts/sitemap.xml

However, I am able to POST the asset from the postman to the Author Dev server using Asset API.  PUT and DELETE methods, on the other hand, return 501 status codes and a NOT implemented error.

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @Vijayalakshmi_S,

The issue has been resolved after updating the Akamai configurations and the PUT & DELETE requests are working as expected now.

Thanks for your support. Highly appreciated. 

 

View solution in original post

12 Replies

Avatar

Community Advisor

@kbitra1998 did you configure Filter Methods in Apache Sling Referrer Filter configuration on Author Dev server where you're testing? Please compare the Filters section with your local. 

 

SivaPrasadReddyS_0-1646741233814.png

 

Hope this helps. 

Avatar

Level 4

Hi @Siva_Sogalapalli 

Thanks for the response.

Yes, it is the same configuration as the above screenshot in my local as well as the server. 

Somehow it is working locally but not on the server.

Avatar

Community Advisor

@kbitra1998 

Can you check

  • If you have these Filter methods available in Adobe Granite CSRF Filter OSGi config as well 
  • If your Author Dev Server is behind Dispatcher,
    • check if PUT and DELETE request are allowed in filter section.
    • If yes and still not working, then enable Dispatcher Debug log and trace the request till Application server.

Avatar

Level 4

Hi,

Yes, we have allowed the PUT and DELETE request in CSRF also.

To track the request, I am not able to see the PUT or DELETE request in access.log or request.log 

But I can see the POST request in access.log.

Avatar

Community Advisor

Is it behind the dispatcher ?

Check the filters section in farm file if PUT and DELETE is allowed. 

Avatar

Level 4

Hi @Vijayalakshmi_S ,

I apologize for the delay in replying.

Yes, it is behind the dispatcher.

So far, I've made the following observations.

1. When we use the POST API, we get a 201 created status in the response header.

  • Server: Apache
  • X-Dispatcher: dispatcher1useast1

  I was also able to see requests in the request log as well. I have attached the screenshot      below for your reference

 

kbitra1998_0-1646977301168.png

 

2. However, when we use the PUT/DELETE API, we get a 501 Not Implemented status in         the response header.

  • Server: AkamaiGHost
  • X-Reference-Error: 8.384b3917.1646977324.1a39ed3d

I am unable to see requests in the request log as well. I have attached the screenshot below for your reference

 

kbitra1998_1-1646977472555.png

 

As far as I am aware, We're simply utilizing Akamai for the publish instance, not the author instance.

I hope my observations are useful to you.

Avatar

Community Advisor

No worries, Thanks for the inputs. 

Can you confirm for sure Akamai is not utilized for Author and yet to see the Server as AkamaiGHost (Akamai Global Host) in Response  ?

I think it is utilized and PUT/DELETE is not allowed at Akamai level (It is disabled by default)

 

Avatar

Level 4

Hi @Vijayalakshmi_S,

 

We've opened a ticket with Akamai to see if they're restricting PUT/DELETE requests. We're waiting for a response from them. I'll let you know when I get a response.

Avatar

Correct answer by
Level 4

Hi @Vijayalakshmi_S,

The issue has been resolved after updating the Akamai configurations and the PUT & DELETE requests are working as expected now.

Thanks for your support. Highly appreciated. 

 

Avatar

Level 3

Hi @kbitra1998 ,

In general if the Author is connected with Dispatcher and project uses CDN,  sitemap.xml also get behind it. 
Can you confirm with any other url also if that the same behavior you are seeing. 

Avatar

Level 4

Hi @tb1687196 ,

My use case is that I want to create an asset in the dam folder using asset API, and sitemap.xml is merely name conservation. I can create the asset with a POST request, but I can't use PUT/DELETE requests to update or delete assets in the dam, even though they operate properly in my local host.