Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So, every time this issue occurs, I simply open the web.config for the site and save it. This instantly fixes this issue until the next server reboot. This works great, but I do not want to have to do this every time. I saw several posts about this that reference permissions, but that does not seem to be my issue (due to the way I can resolve it each time).

Anyone happen to have some insight as to why this fixes it or how I can fix it permanently?

share|improve this question
    
Permanently? That is quite a request. –  James A Mohler Dec 12 '12 at 17:44
    
Haha ya, poor wording. I just meant better than my temporary fix each time I reboot. –  PFranchise Dec 12 '12 at 17:50
add comment

1 Answer

By saving the web.config file you are telling IIS to recycle the application pool, in essence, restarting the application.

There are only three possible reasons for this error:

  1. The permissions used to connect are not right, somewhere down the line. If it's using Windows Auth it might not be able to connect, if SQL auth that doesn't make a lot of sense.
  2. The database server is not available or the database is offline or in repair mode.
  3. Your application code has issues and is trying to do some sort of fancy DB connection that is not successful on the first load of the application but ready on subsequent connections.

I personally lean towards #1 as that's the usual culprit.

share|improve this answer
    
That makes sense. Thanks for the info. If it is 1, does it make sense that restarting the app has been fixing that? –  PFranchise Dec 12 '12 at 17:21
    
Not at all. My best guess for that is the server is offline, but I would review the server logs for detailed info. You also don't post what type of application you are using and database server info. I assumed you were using IIS, ASP.NET, and MSSQL. –  Brent Pabst Dec 12 '12 at 17:23
    
That is correct. It is IIS, ASP.NET and MSSQL. –  PFranchise Dec 12 '12 at 17:28
    
Yea, this makes little to no sense. Check your code and make sure the DB is online. If using the standard .NET database provider you should be getting a different error message. –  Brent Pabst Dec 12 '12 at 17:35
    
Haha ya, that was my reaction when that fixed the issue. I recently took over this app, so perhaps it is doing odd connection stuff that I dont know about. Thanks for the help –  PFranchise Dec 12 '12 at 17:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.