Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Problems with that a 500-error hangs the session


We have problem on our test and live servers that if there is a 500 error on a EPiServer-page, the session that request this page takes a very long time to get the response. We can see that it logs the error directly but it takes forever to get the 500-response from the server.

All other request to the same site, even to pages that works will never responde until the current thread is done/killed so it is very frustrated for the visitors. The good thing is that there are nearly never an error but when it happens.... ;-)

I have never been able to reproduce it in my local development site, there I get the error response directly.

Anyone else who has seen something like this?

Dec 15, 2014 16:13

Does it help if you turn off session state? That's probably why you have to wait for the error to time out until you can request a new resource.

Why it's taking so long? Maybe you have an infinite loop, where an error keep redirecting you to the error page.

Dec 15, 2014 18:56

Thanks Johan. I will try out session state tomorrow.

It might be an infinitive loop but the strange thing is that I never have it on the dev environment.

Right now I am struggling with a even more strange thing.

I have change the type of a property from longstring to xhtmlstring and for one instance of that property on a page type I have a displaytemplate and for those pages this happens.

If I run in debug mode (F5) it all works.

If I run the same code on the same IIS Express without debug (CTRL + F5) it fails saying that it can't convert a string to xhtml.

I can catch the error if I CTRL F5 and after that attach the debugger to the IIS Express process but it not giving me mutch more to go on.

Solving this will become a struggle....

Dec 15, 2014 21:05

If you're not using Session, then it's best to turn it off We have it off by default in our templates.

Dec 15, 2014 21:23

Sadly we use sessions so we need it.

I will check out if there are a loop somewhere that I can not see

Dec 16, 2014 7:52

Henrik, did you find a solution for this issue in the end? We are experiencing the same on out EPiServer 9.8 solution.

May 11, 2016 14:52

Try setting the

<applicationSettings globalErrorHandling="Off"

and use a static 500 page...

Probably an infiinite loop that kills application pool...

Check here to catch it in event log (not shown by default...)

Edited, May 11, 2016 15:29

Thank you very much Daniel, this has fixed our error! All working as expected now, really good news! Will have to remember using a static page for 500 in the future.

May 11, 2016 16:03

Using static page showing errors might be a good idea :) reminds me an ages old question: "where to log an error when system was not able to log?" :)

May 11, 2016 22:19
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.