AEM always returns 200 status code. | Community
Skip to main content
janellic4
New Participant
August 29, 2019
Solved

AEM always returns 200 status code.

  • August 29, 2019
  • 34 replies
  • 25894 views

Upon requesting non-existent pages, both aem author and publish instances return blank page with 200 status code. The default 404 error page is not showing.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by leoberliant

Do you have any custom filters that can possibly massage the response? You might want to stop your custom bundles in OSGi and use /system/console/requests to track recent requests.

34 replies

Employee
September 3, 2019

You might need to add configuration properties, as such you can define only those URLs that required a specific status.

janellic4
janellic4Author
New Participant
September 3, 2019

Hi berliant,

Thank you for your reply. I have one custom filter that sets status code to 400 if the slinghttprequest does not satisfy certain condition. After I stopped the custom bundle, the 404 not found status code shows up correctly. However, this custom bundle is also needed in the project, is there any way to solve the issue instead of stopping the custom bundle?

leoberliantAccepted solution
Employee
September 3, 2019

Do you have any custom filters that can possibly massage the response? You might want to stop your custom bundles in OSGi and use /system/console/requests to track recent requests.

janellic4
janellic4Author
New Participant
September 3, 2019

Hi himanshusinghal,

I just tried to increase the size to different sizes. No matter how many size I increased, I still got the 200 status code and the blank page.

Himanshu_Singhal
New Participant
September 3, 2019

Could you please try increasing the buffer size to lets say 10000 and try again?

janellic4
janellic4Author
New Participant
September 3, 2019

Hi himanshusinghal,

Yes, I still got the 200 status code even after I doubled the response buffer size.

Himanshu_Singhal
New Participant
September 1, 2019

Hi janellic4,

While saving the configuration, it displays the error but it saves the updated value. Try opening the value again and it should show updated "Response Buffer Size".
Even after increasing the response buffer size, do you still get the 200 status code?

Do you get any error as well in logs?

janellic4
janellic4Author
New Participant
August 30, 2019

Hello cal-netsolutions,

Thank you for your suggestion. However, we have implemented a custom error handler. It works fine in Publish instance in another computer. It does not work in some computers and the stage. They have the same problem: invalid url always got 200 status code with blank page.

janellic4
janellic4Author
New Participant
August 30, 2019

Hi himanshusinghal,

Thank you for your response. I tried to increase the Response Buffer Size, then click Save. I got a request error as following:

janellic4
janellic4Author
New Participant
August 30, 2019

Hi, Umeshsondhi

Thank you for your reply. I have read the article you mentioned.  In localhost, I do not use a dispatcher. It seems that a blank page would always be returned by Publish for invalid url request. I don't know how this blank page is created.