Where can i see that the Application Pool is down - iis

I'm using IIS 8 and got 404 error. after investigation, i found that the corresponded application pool was stopped (it was never started). at the moment i started it everything works good.
i couldn't find any information about that on the event log (IIS log about it only when the application pool crash and not if it never started in the first place) and couldn't see any information about it as part of the site log or as part of the "FailedReqLogFiles".
I'm wondering, how could i noticed that the problem is the application pool state without checking it specifically.

It should be logged in Eventviewer under
Application & Service
Logs->Microsoft->Windows->IIS-Configuration->Operational
Click on Operational and In the right pane select
"Enable log"
.
Then I can see events when shutting down an AppPool.

Related

Running Signalr in IIS on .Net Core - hub being hit but client sees 500 error

I have a .net core application deployed to IIS. There is a signalr hub in the application.
My problem is that when my client hits the hub it receives a 500 error back.
I have put logging in the hub and can see that it is being hit correctly and no exceptions are being thrown.
The setup works perfectly when run from Visual Studio.
I am thinking something might not be set up in IIS correctly.
Does anyone have any ideas that this might be?
I enabled the generic error page in the api and looking at the network tab in the browser I was able to see the call that signalr was making.
I looked at the content of this request and found that an error with the following message was being returned by the server...
The data protection operation was unsuccessful
After some searching I found that this was being caused due to a setting on the IIS application pool.
The steps to change the setting were...
Open IIS Manager
Select Applications Pools, and go ahead and select the App Pool used by your app
Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and set it to True
These steps were taken from http://puresourcecode.com/dotnet/post/ASPNET-The-data-protection-operation-was-unsuccessful

Azure Emulator appears to hang on Web Role startup

I am trying to use the Azure emulator to debug a .net solution for VS2013, I am using IIS Express and Emulator Express. The project contains several worker roles, which start just fine, and one web roles that seems to hang intermittently. The weird thing is that if I reboot the computer and restart the debugger, it seems to work.
I see the following lines if I click on the "Show Compute Emulator UI" option, Web Role:
[fabric] Role Instance: deployment28(2907).MyApp.Cloud.MyApp.Web.0
[fabric] Role state Unhealthy
When it hangs, I can go to make an initial API call while the dialog is still displaying and see the Unhealthy error message displaying, I receive a response from the API call which would indicate the web role is running even though it is saying the role state is unhealthy and the dialog is still displaying. As a side note, before it returns I see a lot of Loading symbol messages on the lower left of the screen that usually displays a Ready message.
Here is the dialog that is displaying:
1) Why is it hanging if it is able to receive requests?
2) What is a way to troubleshoot a problem like this when you are using the IIS Express and emulator express?
3) What could be the cause of this problem and what are possible solutions?

The service cannot accept control messages at this time

I just stopped an Application Pool in IIS. When trying to start it, IIS complains that,
The service cannot accept control messages at this time. (Exception from HRESULT: 0x80080425).
What gives? Whence did this error come?
Looking at the Event Viewer > System shows these warnings:
A worker process '1456' serving application pool 'MyAppPool' failed to stop a listener channel for protocol 'http' in the allotted time. The data field contains the error number.
A process serving application pool 'MyAppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '10592'. The data field contains the error number.
A process serving application pool 'MyAppPool' exceeded time limits during shut down. The process id was '10516'.
This resolved itself after about 5-minutes, at which point we tried to restart the website, and received:
The World Wide Web Publish Service (W3SVC) is stopped. Web sites cannot be started unless the World Wide Web Publishing Service (W3SVC) is running.
So, we started the W3SVC service, and then we could start our website.
This helped me: just wait about a minute or two.
Wait a few minutes, then retry your operation.
Ref: https://msdn.microsoft.com/en-us/library/ms833805.aspx
The error message could result due to the following reason:
The service associated with Credential Manager does not start.
Some files associated with the application have gone corrupt.
Please follow the steps mentioned below to resolve the issue:
Method 1:
Click on the “Start”
In the text box that reads “Search Program and Files” type “Services”
Right click on “Services” and select “Run as Administrator”
In the Services Window, look for Credential Manager Service and “Stop” it.
Restart the computer and “Start” the Credential Manager Service and set it to “Automatic”.
Restart the computer and it should work fine.
Method 2:
1. Run System File Checker. Refer to the link mentioned below for additional information:
http://support.microsoft.com/kb/929833
In my case, the VS debugger was attached to the w3wp process. After detaching the debugger, I was able to restart the Application Pool
I stopped the IIS Worker Process (in task manager), and then started the IIS again.
It worked.
I killed related w3wp.exe (on a friends' advise) at task manager and it worked.
Note: Use at your own risk. Be careful picking which one to kill.
Restarting the machine worked for me but not every time.
If you are really stuck on this then follow below steps
Open Task Manager
A window will open. Click on Details tab.
Search for the process name you wanted to restart/stop.
Select process, right click on it, select End task option.
A confirmation dialog box will appear. Click on End process button.
Now try to restart your service from Services.msc window.
I forgot I had mine attached to Visual Studio debugger. Be sure to disconnect from there, and then wait a moment. Otherwise killing the process viewing the PID from the Worker Processes functionality of IIS manager will work too.
Restarting the IIS windows service (World Wide Web Publishing Service) and then starting the application pool has worked for me. However, as the top answer suggests it may have just been the waiting that caused it to subsequently work.
I had this issue recently,
Problem statement:
Mine was a windows service that I run locally by attaching VS debugger. When I stop debugging and try to restart/stop the service (under services.msc) I used to get the mentioned error.
Solution:
Open up Task manager.
Search for the service (based on the exe name and not service name, for those that are different).
Kill the service.
On doing the above the service is stopped.
Being impatient, I created a new App Pool with the same settings and used that.
I kept having this problem whenever I tried to start an app pool more than once. Rather than rebooting, I simply run the Application Information Service. (Note: This service is set to run manually on my system, which may be the reason for the problem.) From its description, it seems obvious that it is somehow involved:
Facilitates the running of interactive applications with additional administrative privileges. If this service is stopped, users will be unable to launch applications with the additional administrative privileges they may require to perform desired user tasks.
Presumably, IIS manager (as well as most other processes running as an administrator) does not maintain admin privileges throughout the life of the process, but instead request admin rights from the Application Information service on a case-by-case basis.
Source: social.technech.microsoft.com

How to debug iis "Service Unavailable" and (possibly) related w3wp.exe error in event viewer

suddently my website (asp.net-mvc iis) is down with error "Service unavailable". when i go to check the event viewer i see this error:
Source: VsJitDebugger
Error: An unhandled exception ('') occurred in w3wp.exe [5208]. Just-In-Time debugging this exception failed with the following error: Debugger could not be started because no user is logged on.
i tried starting and stopping the service but didn't seem to fix anything.
Is this an application bug or an enviroment issue? Can someone point me in the right direction on how to debug this. Site works fine locally (of course)
You've already discovered that restarting your box will fix the issue, I thought you might like to know that actually you only needed to restart IIS.
Open your command line in admin mode
enter iisreset
and you won't have to restart.
Check your site's web.config file to see if system.web/compilation#debug="true". If your site is in debug mode, try setting that attribute to false and see if the problem is remedied.
I would first check the application code.
The symptoms you describe can result from an application issue.
If you have an app that has an endless loop, IIS will restart the app and resubmit the request, resulting in another endless loop. IIS will eventually shutdown w3wp.exe because of that, and you will get 503 service unavailable.
found stackoverflow exception in my app which caused this issue. had to push out a new version and reboot the box and issue fixed.

IIS app pool recycling randomly every few seconds

I need to determine WHY the application pool is recycling. (its for no obvious reason)
Is there any way to determine this inside of the application_end sub in the global.asax file?
I have put some basic logging in there, so I know WHEN its shutting down, but I cannot tell why.
(and its nothing obvious... it just seems like every couple of requests certain operations cause the application to end. I have turned off every normal reason for recycling such as time outs, memory checks, etc, etc, etc. Same code is working fine on a different server, so I am sure its something wrong with this setup, but what?...)
You don't have to incur overhead to add custom logging, ASP.NET 2.0 health monitoring does the job for you. You can add the following configuration which will log events in the eventlogs with information why Application pool is restarted.
To turn ASP.NET health monitoring ON, you can edit the "master" web.config file, normally found in %systemroot%\microsoft.net\framework\v2.0.50727\config.
First, look for <healthMonitoring> in the master web.config
Inside the healthMonitoring node, find the <rules> node
Inside rules, add the following:
<add name="Application Lifetime Events Default"
eventName="Application Lifetime Events"
provider="EventLogProvider"
profile="Default"
minInstances="1"
maxLimit="Infinite"
minInterval="00:01:00"
custom="" />
Reproduce the issue and look in the Application event log fpr a source of ASP.NET 2.0. This should log why application pool is recycled.
Try looking in the EventLog. When the app pool recycles, there is an entry written to the log along with the reason.
The following link describes the errors codes you'll see in the eventlog for IIS 7.5
http://technet.microsoft.com/en-us/library/dd349270(WS.10).aspx
If there are not already log entries in your troubled machine's event viewer, you can modify IIS to log all app pool recycles.
Article from Microsoft on how to do it is found below
http://support.microsoft.com/kb/332088

Resources