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.

We have 4 web servers that host our asp.net (3.5) application. Randomly, we get error messages like :

1) "Login failed for user 'userid'" 2) "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

we are running sql2005 and have a principle and a mirror db (sync). When these exceptions are thrown, I look at the SQL error logs on the mirrored db and noticed the failed login messages in there. The principle db is running fine and the other web apps are working great. this will happen for maybe 10 min, then the app pool recycles and it starts hitting the principle db again.

Is there a configuration I have incorrect? my theory is that our principle db is forwarding the request to the mirror, but that should never happen.

any help??

share|improve this question
add comment

1 Answer

I'm no DBA, so this is just guessing based on my rich "experience" with mirroring problems. :)

Requests can only go to the principal, so I wonder about the phrase "it starts hitting the principle db again". When just a single application (in an app pool) stops working till "restarting" I'd assume a software problem. Could you post your connection string? It should contain the "failover partner".

SQL Server logins also often cause problems with mirroring in the failover case, as they need the same SID. Did you test the failover? Furthermore, do you use a witness with automatic failover?

Are there any error messages in the event log stating that the principal lost connection to the mirror? This may happen when a database server is overloaded and doesn't bother answering for a longer time (default ~10s). (At my setup this happens sometimes when main backups start - external USB disks spinning up...) The principal then does not serve any request without a witness.

share|improve this answer
    
Hello, here is what our connection string looks like : <add name="XXX" connectionString="server=[MY_IP_ADDRESS];database=[DATABASE_NAME];UID=[USER_ID];‌​PWD=[PASSWORD];Min Pool Size=5;Max Pool Size=250;" providerName="System.Data.SqlClient" /> We have not set up the "failover partner" in our connection string. I have looked at the principle and mirror logs and do not see anything that says it can connect to mirror, etc. We do not use at witness and I am not sure if we have ever tested failover yet. –  hp17 May 16 '10 at 19:53
add comment

Your Answer

 
discard

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