I wonder if refreshing page with runtime error will overload the web server. For example I did refreshed domain.com/default.asp?id=99999999999999999999999999999999999999999 page which generates following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Cint'
/default.asp, line 9
This caused server not respond for all sites hosted on it or my IP was blocked for some time by the firewall.
It depends on what the rest of the code around that error looks like (which you can't see). You won't overload the server in the sense of DoS too many requests (flood) since those would be handled before the request gets to IIS to process on the server side.
But if the code where the page breaks does other processing based on that value it could crash IIS or the app pool. It could also be stuck waiting on a passed DB call and has to timeout before the server responds. It will either time out or reset itself and that is when you see the site functional again.
Either way the code or the website/server should be setup better to alleviate the problem. Hopefully the admins will figure that out when they investigate why the site keeps crashing due to your web hits ;)
Issue seems to be type casting. Try below steps.
Add this line on top of the page where you get this error:
"Option Explicit"
You can get more meaning ful error message:
This link provide details for each error message.
Related
I inherited an ASP.NET (.NET 4.7.2) application. It has Elastic rigged-up (via the Javascript API) to capture APM data and errors from the front-end.
The top offending errors in Elastic for months now have been:
Uncaught Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out.
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404 (but sometimes it will say 503).
Both refer to ScriptResource.axd as being the "culprit".
On the one hand, it sure would be nice if I could find out exactly WHAT resource or URL was being requested... as well as which page in my app is doing the requesting.... when such an error occurs.
But I'm at the point now where... as an alternative, I'd just be happy to change these from being unhandled exceptions to handled ones. (I don't think our users are actually having any serious issues from these. The major page for this app is one that updates a couple of key update panels once every 8 seconds. So, occasional failures of those requests are somewhat expected. Users would have already raised hell if something major was going on.)
I'd much rather see any errors in Elastic that are coming from our own Javascript code than from the Ajax Control Toolkit.
So, does anyone know how I might capture these?
I THINK I've finally found the right information (though some of these pages are from 2008). How to basically add a custom error handler to the Script Manager:
Script Manager 4.5 handling errors
https://social.msdn.microsoft.com/Forums/en-US/59a34e36-f80b-4344-a793-8ea2ce21abe2/ajax-exception-handling?forum=aspdotnetajax
Handle Asynch error messages with ScriptManager
https://blog.digitaltools.com/post/2010/02/03/Unhide-Exceptions-Hidden-By-AJAX.aspx
Looks like I should be able to either bury the exceptions... or get more details on them and pass them on through to get thrown to Elastic.
I think my biggest hurdle right now would be to actually try to recreate these errors myself (preferably in a non-prod environment). But I guess I'll figure that out somehow.
Thanks!
I was assigned some debugging to do on an existing ASP.NET WebForms application that uses a lot of UpdatePanels.
One of the button launches some tasks that are very long to perform, and it is expected.
The problem is that we have a strange behavior : on Internet Explorer, the query stops exactly 5 minutes after it started with the following error :
On IE11 with enterprise mode enabled (simulates IE8) (the website uses Enterprise Mode):
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error
occurred while processing the request on the server. The status code
returned from the server was: 12019
On native IE11 :
XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error
occurred while processing the request on the server. The status code
returned from the server was: 0
So the update panel is not refreshed, but I see that even if the query failed, the server continues to perform the tasks (writes to the database), so it's not a server timeout.
Moreover, if I perform the same action locally, on the IIS server, the query isn't interrupted.
What baffles me is that it works without any issue with Chrome (the query we're testing lasts 6 minutes)
I read a lot of things on the Internet but nothing that helps, to my knowledge we don't have a load balancer (this error seem to appear mostly with reports behind a load balancer).
I looked for all the timeouts I can (server and client side), and increased all the values to ridiculous amounts, no effect.
I tried to apply the changes to the registry as explained here, without success.
I tried with Fiddler, but not sure how to interpret its results and both on IE and Chrome, 5 minutes after the start of the query I get an HTTP 401 error and it asks for an authentication (we're using Windows authentication). That only happens when using Fiddler, no authentication is asked usually.
Not sure what to do with that :). Again, Chrome seems to handle it without problem.
I don't have any more ideas...
I suspect that it's a company proxy issue but I don't understand why it works with Chrome, and it might be complicated to ask for configuration changes on the proxy, I need to be absolutely sure it's that, I don't know how.
Any idea/suggestion?
I have an ASP.NET application using custom errors. There is one error that occurs that I can't seem to get any information about. When the error happens, it does trigger the custom error page, but for some reason it doesn't trigger Page_Error or Application_Error. If I turn CustomErrors Off completely, I get absolutely no feedback at all. The only feedback I ever have gotten up until now is the redirect to the Custom Error Page.
Scenario: ASP.NET WebForms application. One of the pages has an UpdatePanel with a Submit button. The page works fine. But if I walk away for a while (seems to be 30-60 minutes) and then come back and click the Submit button, nothing happens; no error, no response from the page- nothing. I have not been able to get this to happen while running in the Debugger; it only happens when it is hosted in IIS (7.5). [I've seen other SO posts about this issue but none of the suggestions worked for me.]
When the error happens, with CustomErrors=On or RemoteOnly, the redirect to the custom error page works, and with RemoteOnly, from the server, I get no feedback at all, similar to a remote connection with customerrors=off. I was really hoping for the YSOD error page.
I tried trapping the error in Page_Error by logging the errors to a database, but that didn't work either. I know the Page_Error and the DB portion is working because if I change the submit code behind to do a divide by zero, the error is logged in the DB. Also, the divide by zero error will be displayed to the client with customerrors=off, and with it on it will display the custom error page. But removing the divide by zero error, and then waiting 30 mins or so and trying again, the Page_Error code is not hit, even though it does redirect to the custom error page. I then tried moving the code in the Page_Error to Application_Error, but the exact same thing happens. The forced divide by error works but this seemingly timeout related error does not.
So, are there certain errors that can still trigger the redirect to the custom error page, but will not trigger the Application_Error event?
Thank you John and Sergey! This really was a can of worms. Sergey, you were exactly right- the session timed out. John your idea made me think to look at the Windows Application Event Log rather than trying to track it down in the code. It turned out that my ViewState was expiring when the session timed out, which was set to 20 minutes by default. The exact event log error was:
"Viewstate verification failed. Reason: The viewstate supplied failed integrity check."
Now I was able to manually recycle the app pool and force the error to happen at my leisure which made solving it easier. I wasn't using Session though, at least not on the page in question, so why did this matter? This link was helpful in troubleshooting what was happening.
http://support.microsoft.com/default.aspx?scid=kb;en-us;829743
Buried deep into the article was the following sentence describing a scenario causing the worker process to recycle:
"The application pool is running under an identity other than the Local System account, the Network Service account, or an administrative-level account."
My AppPool is in fact running under a local user account which I created specifically for this purpose. When I changed the AppPool to run with ApplicationPoolIdentity, after recycling the AppPool the ViewState error went away. Then I set the AppPool back to run with the local user account again, gave that account local admin privileges, and this also fixed it. Not wanting to have this user be a local admin, I ended up going with a different solution, which was to generate a machine key for this app so the ViewState MAC is always the same, rather than using the default of auto-generating a new one every time the pool recylces or the session times out. Note this is also what you typically need to do if you have multiple web servers behind a load balancer.
I've got a problem that for a website I'm administering, users are getting a 500 error. It happens across the site in a number of random places, like performing an Ajax query, navigating from page to page, etc. In the IIS error request log, what I'm seeing is two errors, back-to-back: ASP_CLIENT_DISCONNECTED and ASP_LOG_ERROR. Users are reporting problems usually happen when they're navigating from page to page. The 500 error appears and it just sits there. If they get the error, they usually refresh and it goes away.
The chain of calls right before the error look like the following.
ISAPI_START
CALL_ISAPI_EXTENSION
ASP_START_REQUEST
ASP_NEW_SESSION_CREATED
ASP_QUEUE_REQUEST
ASP_DEQUEUE_REQUEST
ASP_CLIENT_DISCONNECTED
Error 17:46:48.254
ASP_LOG_ERROR
Error LineNumber="", ErrorCode="ASP 0147", Description="500 Server Error" 17:46:48.254
MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName="IsapiModule", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="500", HttpReason="Server Error", HttpSubStatus="0", ErrorCode="The operation completed successfully. (0x0)", ConfigExceptionInfo=""
EDIT 0: I think that the key may lie in that ASP_NEW_SESSION_CREATED line. I don't have any hard evidence to support that, just a gut feeling.
A few more details about my environment, I'm using an Application Pool that is in Classic Mode using the .NET Framework v2.0.5.2707. As part of the web site, I have two web applications that use a .NET 4.0 Application Pool in Integrated mode. The web applications aren't being used at all so I don't think they come into play.
Any suggestions about how to approach this one are greatly appreciated.
mj
We found the answer. There was an Ajax request that was timing out on the server and causing the problem. Some of the other calls were indeed due to user impatience.
We've got a web system running SQL Server 2005 for the back end, and ASP.Net for the front end (using .net 2.0).
Every now and then, the system barfs out the error in the title: 'SQLOLEDB' failed with no error message available, result code: E_FAIL(0x80004005).
The web system runs just fine 24/7, and then every now and then will toss this out on a select or some such. I've tried re-running the exact select that throws the error, but (of course) it works fine when I do it. And, to answer the obvious follow-up question, no we haven't done any code changes or upgrades to speak of lately.
Has anyone ever run into this before? Nosing around on google seems to only turn up situations where Access has some kind of file issue (permissions, missing data file, etc.)
Firstly, it's probably not SQL Server throwing out the error, and if it is, it's probably not while running the SQL statement itself, but if it is, it's almost certainly going to be peculiar to a login that doesn't have permissions, not the SQL command itself.
The 0x80004005 error is a general permissions failure, and it can occur in just about anything, but it's most likely to be in another layer.
I've seen it in authentication when the account the application is running under does not have access to the network to open a connection to the SQL Server. The SQL Server never even sees the request, but the client will say that the server cannot be found.
If it's intermittent, that could point to an intermittent domain controller issue, but that would depend on how your Windows Servers and Active Directory are set up, and how your application is connecting to SQL Server.
To solve this one, your netadmins will need to really know their Windows logging functionality and track it down for you.