Intermittent 'Cannot open database requested by login' error - asp.net

I have a Windows Server 2008 R2 box serving a couple .NET websites from IIS 7.5 using SQL Server Express 2008 R2.
The sites have been running for a number of years without issue. In the last couple of weeks they have become unreliable and will randomly fail with the error "Cannot open database 'foo' requested by the login. The login failed". They both fail at the same time and once in the broken state they stay broken for all requests. It's failing roughly once a day.
The credentials and permissions are absolutely correct and have worked for years, work in the management studio and work again when I bounce the server.
I have found that stopping/starting each website in IIS does not resolve the issue, but stopping/starting IIS does. The leads me to think that something is getting corrupt or badly cached in memory.
Debugging is a pain as the websites need to be fixed ASAP but it's impossible to trace the issue once it's been fixed.
Anybody seen this before or got any idea where I could look for clues next time it goes down?

Related

IIS serving an old version of files

I am developing an ASP.NET application and deploying to an IIS 7 server via WebDeploy. This is a single server (no web farm or anything like this). I've been using the same setup for two years with no problems. Since last night, the server seems to be "stuck" on the last version of the web that I deployed before dinner. I deployed a couple of new versions today, but the server keeps serving the old pages.
I have triple checked this. When I log into the server via RDP and I open a specific ASPX file, I can see that it's the new version I've just deployed, so the server is actually storing the new versions. However, when I visit the web site over HTTP from my computer, I get the old version of the file.
I have restarted the server (the whole machine, not just IIS). I have disabled the IIS cache. I have disabled the compression cache. I have tried from multiple client computers, including one from which I had never ever visited this site (so no client cache may exist). But nothing worked.
I am aware that similar issues have been reported, and I have read some posts about it. But I seem to have exhausted all possible checks. Any ideas on how to proceed? Thanks.
After much struggling, I managed to solve this issue. I deleted the whole web site from the server, and I deployed it from a computer other than my usual development machine. This fixed the issue.
However, I am still baffled at why this happened. It must have been a glitch with WebDeploy and/or IIS.

IIS 7.5 Error 500.19 but sporadically

I have Windows 2008 Sever R2, SQL Server 2008 with SSRS (not R2). I have the reportserver working, but sporadically it will give me this error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
I have another asp.net application with the same issue, so I assume the issue is similar. It works probably 60% of the time, then just won't. After awhile it just starts working again :( Both SSRS and the application fail and work at the same time... so if one fails, both do. One works, both do.
It is very frustrating!
The worker process identity (Your application Pool User) and/or the IIS_IUSRS group needs at least Read access to the directory as well as the web.config file.
Use Process Monitor tool to trace the Access Denied

VS2010 Debug web app causes "cannot start application" and "access denied" errors

When I try to debug my VS2010 web app (F5), the IE web browser windows pops up but then freezes, and my VS2010 IDE window pops up an error message:
Unable to start program 'http://localhost:nnnn/Login.aspx'.
Access is denied.
I'm running VS2010 (10.0.30319.1), targeted to ASP.NET 4.0 (4.0.30319), in non-administrator mode, with ASP.NET debugging enabled, on 64-bit Windows 7 Enterprise SP1, with IE 9 (9.0.8112.16421 with update 9.0.29).
This web app and others I work with have been working just fine for several months, but they all started to misbehave in this manner a few weeks ago. At first, the first time I tried to debug (F5) I'd get the error, but after clearing it and closing the IE window and trying F5 again a second time, the browser would come up just fine. I assumed it was just some glitch, so I tolerated it.
Lately, though it has gotten worse, to the point that 90% of my attempts and re-attempts to debug the web app cause a hung browser and the error. It sometimes works, but most times it doesn't. I have to kill the handing iexplorer.exe processes to clean up my user space, otherwise I eventually get a message about not having enough files to start the browser. I try rebuilding, stopping the ASP.NET Development Server process, even exiting VS2010 and restarting it, but I can't seem to find the magic sequence of events to get it to work.
If I start without debug (Shift-F5), it works, but two IE web browser windows are opened, and both attach to the web app. I don't know if this is related to the first problem. And needless to say, this does not really allow me to debug my code. I tried attaching to either of the IE processes, but I still could not get the debugger to actually debug the executing app. (There is a message about no symbols being loaded for the attached process.)
Most of the solutions for this problem I've found say something about running with administrator access. I cannot do this, however; I work at a large financial company, and developers are not allowed to have local admin rights on our PCs. I don't control system patches, but I can request Help Desk ticket to resolve the problem; but I'd like to resolve this problem myself if it is a fairly simple configuration problem on my part.
Addendum
I should also add that I am not using IIS (because I don't have it installed on my system, and I can't use it anyway because I don't have local admin rights), but instead I am using the built-in Visual Studio Development Server. I've also selected a specific HTTP port number for it to use. Also, all of the directories I'm been using were created by me (as part of my project workspace), so there should be no access permission problems.
Like I said, I can sometimes get a debugging web session started, but most of the time I can't. So whatever is causing this problem, it is probably something intermittent.
This tend to occur when you try to run the full version of IIS rather than the Visual Studio Web Server or IIS Express. Have you tried running IIS Express instead? I think there's support for IIS Express that came with one of the later updates to VS 2010?
IIS proper definitely requires full admin rights in order to attach a debugger because full IIS runs under a system account rather than your own account. IIS Express (as well as the Visual Studio Web Server) however should run under your own user account and so debugging should work on the local machine even with a non-admin account.
One issue that might cause problems is directory permissions. Make sure that the folder where your Web files live are read/execute accessible through the file system for your user account.
Finally make sure you don't have some other instance of a Web service running on the same HTTP port.
I am having the same issue, it works when i don't choose to debug but CTRL+F5 to start it. F5 Debugger al

Possible Reasons aspx Crystal Report Viewer would hang indefinately on IIS 7.5, under certain reports?

this is a bit of a shot in the dark but I am truly stuck here.
I have an asp.net MVC app that spits out some PDF reports.
This works great on production Windows Server 2003 / IIS6, Local Dev Server, and Win 7 / IIS7
When I go to production IIS 7.5 / Server 2008, some reports hang indefinately without an error or a trace written. They just continue to spin seemingly forever, there is never a failed request back from the server.
Some reports do this, some do not, we've had multiple folks look at the reports and can find no discernable differences.
Does anyone have any tips on:
Why I never get an error/timeout?
Why some crystal reports would fail, and others are fine?
This works 100% fine in all other environments. I did some SQL tracing and the database commands are being run and terminating pretty much instantly, there is no hang there.
I have the 64 and 32 bit crystal runtime installed on the server. (Allow 32-bit is set to true for the app pool).
I have the same setup elsewhere and it works with no issues on Win 7 / IIS 7.
I've temporarily added the app user to Local Admins, and given him full access to both databases
As per dotjoe's suggestion, a default printer that is not present on the system caused this issue. Make sure you a) have the printer installed on the server, or b) have "no printer" for default.
Thanks, Stackoverflow!
Selected the printer 'Microsoft XPS Document Writer'.
To do this go to the report in the designer->Design->Page-Setup and select.

How to diagnose IIS fatal communication error problem

I've a a customer using IIS and an application, developed by us, in ASP.NET 1.1.
Monday, for 4 times in a row the following error has appeared:
A process serving application pool 'xxxx' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was 'yyyy'. The data field contains the error number.
Any idea about how to diagnose this? The only link I've found talks about installing low level debug tools but before proceeding in this kind of low level analysis I would know if someone has a better idea or a suitable alternative.
The problem (from what I can see) is something in the customer environment, because the same application it's installed at other customer sites on at least 20 or 30 different servers and the problem do not happen.
Had the same issue on IIS 7, had few reports all worked except one report that was very long and it never worked on IIS7 (it was fine on low spec server).
on IIS7 in application pool's Advance Setting I set "Enable 32-Bit Application" to true and all worked nicely
I'm getting the same error, here are some more details:
running: Windows Server 2003, IIS 6.0 / ASP 3.0,
2.13 GHz, 1 GB ram
My web site is in Beta, so I hardly have any visitors to the site.
According to the event viewer I'm getting this warning 3 times every 3 minutes,
then it stops for a few hours.
Then sometimes I get the error:
A process serving application pool 'DefaultAppPool' terminated unexpectedly. The process id was '3900'. The process exit code was '0x800703e9'.
which follow by:
Application pool 'DefaultAppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
Which then causes a 'Service Unavailable' message when browsing to the website.
after reading too many post about this issue, I did the following steps:
I read that it might be registry access right, so I installed a monitor and trace all the W3SVC Access Denied errors and grant permition
I read that the 0x800703e9 error means stack over flow which causes a w3wp.exe crash and I should install a Debug tool and try to get a memory dump.
I did that but I didn't get any dump, so I installed a new debugging tool, but didn't got a crash yet.
My web site is doing some data mining which keeps the server busy.
Conclusion:
I don't know what is going on there... but I do know that my server machine is way to slow on resource, so I'm going to upgrade and reinstall it, I'm certain that it will solve the problem...
The problem happens all the time, even when my .net code is idle, therefore it is a problem in the server, and not in my code.
I think that the first warnning “A process serving application pool ..." happens every some time, and every now and then it causes the Application Pool to restart, therefore a attaching a debugger doesn't help - the process keeps restarting and the debugger is not effective any longer...
I think that the 0x800703e9 error (which causes the Service Unavailable) maybe happens when the app pool restart, I guess that it needs a lot of resource and since my machine is too slow it gets the 0x800703e9 ... as said before this is a stack over flow, but I think that it is caused by low resource and not by an endless recursion.
I think that the 'registry access right' which is claimed by Microsoft to be the issue, is nonsense, but I didn't got 'Service Unavailable' since so it might helped (thought I still get the warnning “A process serving application pool ..." ).
Hope this help someone...
I'm sure you already know this, but the App Pool contains 1.1 applications only right? I don't remember the error you get when the pool dies by trying to mix frameworks (something like Server Unavailable), but it's more common then I thought in the wild so I would double check.
While not likely the case, it's somewhere to start.
Edit: This KB article also had the error message you described relating to registry permissions, what version of IIS is the client running?
I had this same problem when a website was deployed to a client's web server. This Microsoft support article says:
"This issue may occur if the NT AUTHORITY\NETWORK SERVICE account does not have the permissions to the required registry keys."
And the resolution is: "set the permissions to the required registry keys, and then restart IIS 6.0."
The linked article has the steps for doing this.
One more popular reason (as in my case) - one of windows logs is full.

Resources