I've run into an issue managing our dev IIS instance and an MVC 3 web application. The issue is that when I try to connect to the database from the IIS machine via one of our website I get the error: Login failed for user . Where is the name and domain of the server IIS is running on. The IIS server and SQL Server are on two different machines. I have read multiple questions on SO and other sites and it said to run under application pool identity, which we are doing. We have a user for the database that is tied to the application pool identity.
The site was operating as expected yesterday but after a server reboot it seems to have caused this issue. I have checked everywhere and there is not an area that would cause this to run under NETWORK SERVICE or LOCAL SERVICE. I've been banging my head on this problem all day and was hoping that there was some solution that I have missed.
I have a .net 4.0 website that was running on physical Windows server 2003 boxes on IIS6 32bit just fine. We have migrated to new virtual servers running Windows Server 2008 32 bit with IIS7. The application pool is running in classic mode.
Since the move, I at random get a situation where the application hangs. The request queue rockets and then I get 503 errors. If the application pool is recycled, then the error goes away till the next time it occurs.
There are no entries in the event logs relating to it except that it notes when the application pool took to long to shut down during the recycle process. I have reporting in my .net application that logs to a DB and sends me errors but it sends me nothing when this application is hanging.
What tools can I use to diagnose the problem and figure out what is causing it?
In opinion, whatever the structure of application is, if you're pretty sure that there is no bug, changing sort of properties on the application pool might solve the problem.
First on the 'Advanced Settings...' menu of the application pool change the 'Enable 32-Bit Applications' to the relevant value. If the platform used for building application is x86 then the value should be 'True'.
Second if your application demands to access disk resources, also you should the relevant security context for running the application pool in the 'Identity' property. The identity should access all the directories that your application wants to change or list.
After doing all the things, in case the problem existed, you should let me know about the platform of your application. Is it .NET or ISAPI?
Cheers
I am trying to restart a windows service (part of the application) from my ASP.NET (.Net 4) application but it fails with the error:
Cannot open <ServiceName> service on computer '.'.
Inner Exception: Access is denied
StackTrace: at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess)
at System.ServiceProcess.ServiceController.Start(String[] args)
at NetClient.AvailabilityConfiguration.StartAvailabilityService(ServiceController serviceName, TimeSpan timeout)
The code is working fine on my development machine (Windoes 7) and test server (Windows 2008 R2) but fails on the production server. The only (and BIG) difference is that UAC is turned ON the production serevr where as it is OFF on the dev and test servers.
I have tried adding an app.manifest file to the web application to get elevated privileges but it does not seem to work. I've configured the app.manifest "requestedExecutionLevel" attribute to "requireAdministrator" but does not seem to have an effect.
Any help will be greatly appreciated.
Thanks
Aju
I think that is clear that the account that runs the pool of your web have not rights to manage the services (especial the Start, Stop, Pause commands).
See under what account your pool is running, and give him the permission to manage the services of your server. You can do that using the group policy, or open the security template.
Read the official detailed steps for How to grant users rights to manage services in Windows Server
I am running IIS 7.0 on Windows server 2008 R2 and created 1 Application Pool per site and I have 1 site which is causing the application pool to stop. These are the following errors in the Event Viewer:
This shows several times:
A process serving application pool 'Pilot.Mobile.SyncV2' terminated unexpectedly. The process id was '3620'. The process exit code was '0x80131506'.
Then I get this:
Application pool 'Pilot.Mobile.SyncV2' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
Two Things- How can I findout why this is crashing e.g. tools or scritps, also has anyone get any scripts I can run on a schedule task that will check the application pools and if 1 is down it will restart it and email me.
Here's a list of "Useful tools and add-ons for IIS troubleshooting and IIS7".
Tess Ferrandez (ASP.NET Escalation Engineer at Microsoft) has a good blog on debugging.
I don't have any scripts to give you. We use Nagios/OpsView to monitor websites/servers and notify us.
Before I start, I know using iisreset is considered bad practice, but this shouldn't happen anyway..
What we have:
Several machines with IIS6 on Windows Server 2003 R2 (both 64 and 32 bits)
Several WCF webservices (.NET runtime 2.0) deployed in several applications, each with it's own application pool, each application pool running under an other windows account.
What happens:
All appPools are started, all services operational
IISReset is executed (or the machine is rebooted)
IIS comes back up, but not all application pools start properly. Sometimes they all come back up, sometimes one or more pools won't start. They can be started manually however.
Is this "normal" iis behavior and should I just avoid using iisreset, or are we doing something wrong in our .NET code?
The application pools should restart on an iisreset, but they do run outside of iis (in COM+) for reliability. This mean they may may not come back if the application is misbehaving, but IIS and the other apps will(should) come back. So yes, This is "normal".
P.S.
I would also like to "OUT" myself as a proud user of iisreset. Bad practice? Bah! ;D
IIS does not immediately start ASP.NET worker processes (w3wp.exe) until the first request comes in. When you say "not started", does it mean you attempt to access some WCF web services (after iisreset), and you get a Service Unavailable error because the appPool cannot be started? Do you see any IIS W3SVC related entries in the Event logs?
If there are, they may be able to clue you in why they cannot start; post them up here.
Reason:
IIS does not immediately start ASP.NET worker processes (w3wp.exe) until the first request comes in. When it says "not started" it mean you attempt to access some WCF web services (after iisreset) failed due to object was holding some space in memory, and you get a Service Unavailable error because the appPool cannot be started.
Workaround:
Create Batch file with following commands & schedule it.
net stop 23svc
net stop msftpsvc
net stop smtpsvc
net stop PleskControlPanel
net stop HTTPFilter
iisreset /restart
net start w3svc
net start msftpsvc
net start smtpsvc
net start PleskControlPanel
net Start HTTPFilter
Had similiar issue - after IIS has been restarted, DefaultAppPool was stopped.
In application event logs found an error:
Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, or that your network is functioning correctly. If this problem persists, contact your network administrator.
DETAIL - Access is denied.
Fixed by setting in DefaultAppPool Advanced Settings option Load User Profile to False.
Hope it could be usefull.
In a prior support role, I managed several IIS servers running all kinds of .NET mess. When an AppPool failed to start, it was usually a bad login credential.
Re-setting the identity (auth credentials) via advanced settings of the Application pool worked for me.
Earlier I changed my active directory password and as the app pool was already running, it worked fine until I performed IISRESET.