NetTalk Central

Author Topic: troubleshoot 500 busy error?  (Read 4641 times)

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
troubleshoot 500 busy error?
« on: August 17, 2020, 05:21:23 PM »
I have a low-volume NT 11.41 web server running against an MS SQL back end on an internal network (no bots, probes, etc.).

Today in mid-afternoon it went unresponsive - just returning a 500 busy error.

This is running as a service, and I haven't built remote monitoring for the performance counters.

I stopped the service a couple of hours after it stuck but there was still an instance of the exe showing in task manager.  In my experience, typically that means a thread is still running.  I killed that manualy.

The only windows in the app other than the webserver are those from the default Active Directory login, AD getuser, and AD getinfo procedures.

I'm going to leave it running as not-a-service for a couple of days.  But wondering whether anyone has suggestions as to what might have cause this or how to troubleshoot?

TIA,

Jane

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: troubleshoot 500 busy error?
« Reply #1 on: August 17, 2020, 06:52:32 PM »
That said, it does have a status API that I've hooked to a PRTG monitor so some of the data is available.  Pic shows those sensors up until the choke at about 2:15PM.  (And then after I restarted it).

Maximum threads (p_web.RequestData.Webserver.Performance.MaximumThreads) was at 6.  Sessions at 3.  So definitely not legitimately "busy".


urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: troubleshoot 500 busy error?
« Reply #2 on: August 18, 2020, 03:42:28 AM »
Jane, i am having a similar problem, but i did not get to catch whats wrong with my web server when that happens. As you can say, is just said is busy and even in desktop mode, it does not simply recover and need to restart the service.

Looking forward to this thread and see if any ideas arise.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: troubleshoot 500 busy error?
« Reply #3 on: August 19, 2020, 10:40:08 PM »
If you look in the WebServer procedure, you'll see the conditions for an error 500.
(in the StartNewThread method.)

Usually it simply means there are more active threads than your "max threads" setting.
It can also mean the "graceful close" button has been pressed (but not all the active threads are completed)

So if you have a "stuck thread" and loc:shuttingDown is true, then you'll get this effect.

loc:ShuttingDown aside, it's usually an indicator of stuck-threads accumulating until the maxthreads is exceeded.
Stuck-threads are often caused by an errant MESSAGE window appearing, or an endless loop, or some other bug that leads to the code "never ending". It may also be cause by incorrect use of the NT Critical Section, leading to all the threads getting stuck when they attempt to complete.

Alas, because it ultimately points to "a bug in your program" it's unlikely that the solution to one user will be useful to another user.

cheers
Bruce




osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: troubleshoot 500 busy error?
« Reply #4 on: August 20, 2020, 03:30:33 AM »
hi jane and urayoan, i had a similar problem a few years ago, after installing Capesoft Message Box it can capture a message box generated by a database driver in my case SQL Server, Capesoft Message Box closes the message and sends the message to a log file is very usefull

Jane

  • Sr. Member
  • ****
  • Posts: 372
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: troubleshoot 500 busy error?
« Reply #5 on: August 20, 2020, 07:53:34 PM »
Thanks, Bruce, but afraid I don't understand.

I did look at the 500 code.  And as you say, it seems quite simple and straightforward.

But...  when my monitor polled the server 1 minute before it hung it had maximum threads of 6 and active threads at 1.
Max threads is set to 100.
And it was running as a service, so nobody pressed the graceful close button.

Are you thinking that one stuck thread would have cause that?  Or would that just be in graceful shutdown?

@osquiabro - thanks, I do have message box in the app but it is not set up to log.  Perhaps I should implement that.

Jane

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: troubleshoot 500 busy error?
« Reply #6 on: August 24, 2020, 11:09:16 PM »
Hi Jane,

>> when my monitor polled the server 1 minute before it hung

alas, a lot can happen in a minute...

>> Are you thinking that one stuck thread would have cause that?

probably not in such a short space. Although if the client repeated the request multiple times, then I guess yes?

What you might want to do is add code to the generated 500, so at that point it writes a log away saying which of the options triggered the 500. ie, knowing where the 500 message come from, you can put code in there to report "why is this happening".

cheers
Bruce