Expand my Community achievements bar.

Servlet Calls 204 error in AEM 6.5

Avatar

Level 4

Hi All,

After upgrading to aem 6.5.6(inplace from 6.4.8.1.to 6.5.6) i am facing with POST and DELETE calls are going to 204 instead of 302 or 200.

 

Please let me know if any came across this issue.

 

Thanks

40 Replies

Are you saying:

 

When you use a tool like Postman or CURL to hit the POST servlet via Akamai OR AEM Publish's IP, then the Servlet works.

 

When you invoke the action on your Web site that invokes the POST servlet, then you get the 204?

 

What sort of Application is this exactly? (SPA, Desktop app, mobile app?)

 

Either way, this certainly sounds like what other mentioned, likely at an issue with:


* CORS

* Referrer Filter

* CSRF Token 

 

CORS seems like the most likely suspect. Can you log the response headers from your app?

What sort of Application is this exactly? (SPA, Desktop app, mobile app?) -----Its a Desktop application

 

Either way, this certainly sounds like what other mentioned, likely at an issue with:


* CORS -- Have verified with 6.4 configuration's it looks same and in the vanila instance of 6.5 looks same there it works out.

* Referrer Filter - Allowed Hosts has been checked and added the domains which were required for the applications.

* CSRF Token - Have allowed POST and verified, but still i see the same issue and i have allowed the servlet in the excluded paths but it doesn't worked out.

 

CORS seems like the most likely suspect. Can you log the response headers from your app?----This i haven't tried but we will check this.

 

Thank you @davidjgonzalezzzz still if i miss any please let me know.

I am not seeing any errors related to the CORS in console.

I have logged the response headers from app but am not seeing any errors in the logs.

 

@davidjgonzalezzzz Please suggest.

 

 

@davidjgonzalezzzz I have did some changes and tested the servlets with POST calls with 200 in publisher but 204 in dispatcher and akamai.

 

I am expecting there is an issue with dispatcher.

 

But the same configuration has been worked for vanila upgrade.Can you suggest is there any specific that i need to check.

 

/0111 { /type "allow" /url "/bin/test/test/*" }
/0113 { /type "allow" /url "/bin/test/test/*" }

 

The above parameters have been allowed in the dispatcher.any.Please let me know if i miss anything in the dispatcher.

 

Thanks,

Santhosh

Avatar

Level 4

In edge version 44 and below i am not seeing any issue with POST calls i.e. 204 error code.

 

In chrome am seeing the issue 204 error code and with all the updated versions of the browsers.

 

@davidjgonzalezzzz @bmccurdy1 Please suggest204edge.PNG

 

Avatar

Level 2

@santhoshm687661 I am facing similar issue with AEM 6.5.6 publish. All post calls are responding with 204 error. Even unable to login since login j_security post request as well giving 204 response. Any solution?

Avatar

Level 4

@rangavinod Please do the mentioned config changes.

Go to system/configMgr

Search for CORS and edit the configurations

you will see localhost :4502 and localhost :3000 in paths

Remove all the existing path and just keep * and save ur configurations.

 

Thanks,

Santhosh

 

 

Avatar

Level 2

@santhoshm687661 Thank you. This worked. We have the value as .* . Looks like default value is updated from .* to *

Avatar

Level 1

Can you please share screenshot of the configuration?
Without updating the config I'm getting 204 status code for my request
After updating the config I'm getting 403 status code for my request

Avatar

Level 2
I think someone else may have already mentioned it, but on your publisher(s) double-check the OSGi config for Apache Sling Referrer Filter and ensure you are allowing the methods you are trying to support.

Avatar

Level 4
[Mon Feb 22 12:37:17 2021] [D] [pid 18889 (tid 140177355810560)] cache-action for [/content/dam/downstream/commons/images/castrolLogo.png]: DELIVER [Mon Feb 22 12:37:17 2021] [D] [pid 18895 (tid 140177246705408)] cache-action for [/content/dam/downstream/commons/images/castrolLogo.png]: DELIVER [Mon Feb 22 12:37:17 2021] [D] [pid 18889 (tid 140177355810560)] request declined [Mon Feb 22 12:37:17 2021] [D] [pid 18895 (tid 140177246705408)] request declined [Mon Feb 22 12:37:17 2021] [D] [pid 18889 (tid 140177355810560)] response.headers[Last-Modified] = "Thu, 09 Apr 2020 12:22:05 GMT" [Mon Feb 22 12:37:17 2021] [D] [pid 18895 (tid 140177246705408)] response.headers[Last-Modified] = "Thu, 09 Apr 2020 12:22:05 GMT" [Mon Feb 22 12:37:17 2021] [I] [pid 18889 (tid 140177355810560)] "GET /content/dam/downstream/commons/images/castrolLogo.png" - - 0ms [flush-website/-] [Mon Feb 22 12:37:17 2021] [I] [pid 18895 (tid 140177246705408)] "GET /content/dam/downstream/commons/images/castrolLogo.png" - - 0ms [flush-website/-] [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Found farm fastlane for castrolfastlane-supporttest-www.castrol.com [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] checking [/bin/downstream/fastlane/cart] [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] request URL has no extension: /bin/downstream/fastlane/cart [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] cache-action for [/bin/downstream/fastlane/cart]: NONE [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Creating new socket: 10.0.101.32:4503 [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Connected to backend i-02d1642aa48fc749e (10.0.101.32:4503) [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: CSRF-Token [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: referer [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: user-agent [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: content-type [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: content-length [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: accept-encoding [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: accept-language [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: accept [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: host [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: cookie [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: X-Forwarded-SSL [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: X-Forwarded-Port [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: X-Forwarded-Proto [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: Origin [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: Via [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: X-Forwarded-For [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Adding request header: Server-Agent [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Sending request body to remote server [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] Request body sent to remote server [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] response.status = 204 [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] response.headers[Date] = "Mon, 22 Feb 2021 12:37:24 GMT" [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] response.headers[Cache-Control] = "no-cache" [Mon Feb 22 12:37:24 2021] [D] [pid 18900 (tid 140177297061632)] No socket reuse: neither GET nor HEAD [Mon Feb 22 12:37:24 2021] [I] [pid 18900 (tid 140177297061632)] "POST /bin/downstream/fastlane/cart?productCode=3366128&quantity=3" 204 - 1ms [------------------------This is what i am seeing in dispatcher log

Avatar

Level 4
Yes I have allowed POST,PUT and DELETE in the apache sling referrer filter.

Avatar

Employee
Sorry - I was talkinbg about the Request Progress Log in AEM available via the OSGi console (http://localhost:4502/system/console/requests) ... What you've posted is your Dispatcher log (which is good to know but wont give us detailed info on how AEM is processing the request)

Avatar

Level 4
This are the requests from the process request which POST is missing 7838 GET castrolLogo.png 7839 GET login.html 7840 GET coralui3.min.css 7841 GET typekit.min.js 7842 GET jquery.min.js 7843 GET utils.min.js 7844 GET granite.min.js 7845 GET moment.min.js 7846 GET token.json 7847 GET coralui3.min.js 7848 GET ruf7eed-d.css 7849 GET clientlib.min.js 7850 GET cart 7851 GET category 7852 GET product 7853 GET product 7854 GET 1024x710.jpg 7855 GET adobe-logo.png 7856 GET AdobeSpectrumIcons24.woff2 7857 GET favicon.ico

Avatar

Employee

Deleted response. See response in comment below.

Avatar

Level 4

Hi @santhoshm687661 ,

 

Basically 204 response from your servlet indicates that you are missing your api endpoint in CORS policy Allowed paths section. Just add your servlet endpoint in Allowed paths section.

 

Thanks,

Ramesh