How to debug "An unhandled exception occurred and the process was terminated" error - iis-7

I am seeing error in IIS Log, Is there any way to know more info about this? We have multiple .NET apps running on IIS.
An unhandled exception occurred and the process was terminated.
Application ID: DefaultDomain
Process ID: 7284
Exception: System.AppDomainUnloadedException
Message: Attempted to access an unloaded AppDomain.
StackTrace:

http://support.microsoft.com/kb/919789
Get crash dumps first, and then use Debug Diag or WinDbg to analyze the dumps. You will see all necessary information from it if you are familiar with the tools.
Microsoft support guys can also help if you open a support case via http://support.microsoft.com

You need to start looking deeper. Perhaps with logging and perhaps running the application in isolation with probes.
Is it a problem? If not stop perhaps?
First check the windows logs and look for more information.
Next check the IIS logs to see if anything is recorded there
Next if you can duplicate the error, try and narrow down to the steps to the bare minimum.
Does it occur on one machine, many machines, on euser many users etc etc...
Try run the app in isolation.
Attach a debugger to the IIS process and see if you can catch this exception alone. If you can then perhaps rebuild the code with symbols to give more information.
Try all these and see if you can find it.

Related

An error occurred while processing your request. I get this error when trying to log in to my application

I have published my application when I go to the site and after logging in I get an error message (An error occurred while processing your request.) With below that
(Development Mode
Swapping to Development environment will display more detailed information about the error that occurred.The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.)
Does anyone have an idea how I can fix this?
Try to use logging and write the error to a file... With more details. Because this error is so global it may be related to many things, with logging it will be clear

How can a running web deployment process be cancelled?

I'm attempting to deploy my web app to a local test server using VS2010 One Click Publish and it seems I've put incorrect settings in to the web deployment dialogue. I didn't realise this until I'd pressed the publish button.
After thinking the deployment was taking an unusually long time, I looked at the Output window and say the following error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3847,5): Warning : Retrying the sync because a socket error (10054) occurred.
Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 1 of 10.
Now I think I know what I've done wrong, this question isn't about that.
Each attempt is taking about three or four minutes. How can I stop the web deployment process when it is doing something like this?
You can press CTRL-BREAK during publishing to cancel the process.

RPC_E_SERVERFAULT

In my asp.net application I am calling one com component method using Interop dll. This is working fine in normal condition but In production sometimes its throwing below exception
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
I am suspecting that this is happening when large number of users are accessing same page simultaneously.
Is somebody know solution or steps to debug this issue.
I have another question. while searching on internet I came across this aspcompact attribute and MTA vs STA thread model related to com components . Is this aspcompact attribute is applicable in case of interop dll(Runtime callable wrappers). Will adding this attribute will solve my problem?
RPC_E_SERVERFAULT means that the out-of-process COM server threw a structured (Win32)exception, which could be all sorts of things, such as an Access Violation, Divide by Zero, etc. In other words, there's a bug in the COM server's implementation and there's nothing you can do in your calling application to cure this (unless you can find out what the bug is and can design a way to call the COM component which doesn't execute the buggy code).
You need to find whichever of your colleagues is responsible for the COM server, get him/her to use the debugger to capture a crash dump when the exception occurs, then do post-mortem debugging on the dump to diagnose the problem and fix it.
Monitor your site to capture exception when it raise.
Use Debug Diagnostics Tool v1.2
With the generated dump is easier to identify the point of failure.
Also could mean the COM object crashed. Try to rerun the application represented by the COM object by itself and see if it crashes or produces some error.
I had the same problem, but I got it to work by adding a [STAThread] attribute to the Main function.
[STAThread]
static void Main(string[] args)
I'm running Powershell scripts that use the MS Office 2010 Excel COM objects and started receiving this error. The culprit was the latest MS Office patches. Sorry, I can't specify exactly which one caused the error (I uninstalled a bunch at time), but uninstalling one of them solved the issues. The updates were installed on 7/18/2016.

w3p.exe terminated due to stack overflow - how to track down the issue?

we are getting a stack overflow in production ~ 2-4 times / day
We cannot reproduce this is in dev environment, nad given this is a web app with probably ~100 concurrent users at any one time, I'm struggling to work out how best to track this down.
Is there anyway to get any more info from event viewer - happy to install some form of listener tool - even if i can just get teh thread identity (set to the current user) that'll help - although the dll + class / function woudl be great!
Or is it just a matter of digging, trying to reproduce or adding some tracing in??
There is an IISDiag tool that you can run on production IIS to analyze crashes. Some information here:
http://support.microsoft.com/kb/919790
It's not just for leaks -- it dumps something like a CORE file that you can analyze later.
Slap on Elmah for exception logging. Adding logging of unhandled exceptions using Elmah only require you to drop in the assembly into the application bin folder and to add Elmah section in the web config for a basic logging scenario.
If the logs is not enough to determine the error source you can create memory dumps of the state of the failing application using DebugDiag. There is a guide on how to use it here.
You can put a global exception handler in the global.asax file. Put an exception handler in and then write the stack trace to the event log. This article has a pretty good summary of how to do it though I'm sure there are a lot of others too. Once you know where the error is occurring you can put in some additional logging in the function that the error is occurring in and hopefully narrow it down until you find the specific problem.

Cannot Start IIS on my PC: COM+ System Application: Access is Denied

I'm trying to do some web development. I cannot start IIS (I need to run some Web Services).
As of about a month ago, the "COM+ System Application" service has started failing with this error:
The COM+ System Application service
failed to start due to the following
error: Access is denied.
DCOM also logs an error in the event log:
DCOM got error "Access is denied. "
attempting to start the service
COMSysApp with arguments "" in order
to run the server:
{ECABAFBC-7F19-11D2-978E-0000F8757E2A}
When I start IIS and the WWW service, everthing seems to work until I hit port 80 on my machine at which time the IIS/WWW services both crash unexpectedly:
The World Wide Web Publishing service
terminated unexpectedly. It has done
this 1 time(s).
The following event is placed in the application log as well:
The run-time environment has detected
an inconsistency in its internal
state. This indicates a potential
instability in the process that could
be caused by the custom components
running in the COM+ application, the
components they make use of, or other
factors. Error in
f:\xpsp3\com\com1x\src\comsvcs\package\cpackage.cpp(1184),
hr = 80070005: InitEventCollector
failed
I have searched google until my fingers are numb. I've searched this site to no avail as well.
I have tried:
running the COM+ System Application service as an administrator.
reinstalling SP3 for XP
giving the "SERVICE" account full control to %SYSTEMROOT%\Registration
removing XP Security hotfixes installed about the time it stopped working
I've removed and reinstalled COM+ (it's possible, check google)
Any insight on the COM+ subsystem, it's files and settings or just how it operates would be greatly appreciated.
I need to get this problem resolved so I can get back to work.
Have you seen this link?
http://support.microsoft.com/kb/909444
I'm having the same problem, and it appears it might have fixed it for me - though I did have to reboot afterwards which isn't explicitly in the kb instructions.
(Though it's hard to tell right now if this actually fixed it, because sometimes for me the problem would disappear on its own after a reboot (which doesn't make a lot of sense given the steps in the kb)).
Sorry all.
I forgot to update this when I found the solution... Well, it was self-inflicted. Some months ago, I removed the execute permissions from dllhost.exe. I hadn't been coding asp.net web apps at the time so I didn't notice the problem and couldn't put two and two together very quickly.
I eventually found it by turning on file system failed auditing on my Windows folder hive. I saw a mess of access denied messages related to dllhost.exe and remembered what I'd done.
Thanks for the help.

Resources