2

I have a .net web application that calls sql server 2008 running on a different server. From last couple of weeks, after every 4 or 5 days, web applications connectivity to sql server becomes an issue. Web application fails to connect to sql server intermittently. In the event viewer of the web app server, following message is logged:

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) at System.Data.SqlClient.SqlInternalConnection

Trying to create an ODBC connection to the sql server from the web application server also fails with similar message:

Connection failed:
SqlState:'01000'
Sql server error: 68
[Microsoft ODBC Sql server driver][DBNETLIB] ConnectionOpen(Connect())
Connection failed:
SQLState:'08001'
Sql server error: 17
[Microsoft ODBC sql Driver]{DBNETLIB] Sql server does not exist or access denied

However other machines (except web app server) are still able to call the same sql server instance and are also able to create an ODBC connection to the sql instance. I can also successfully ping to SQL server from web app server when the connectivity issue occurs.

Strangely web application doesn't looses the connectivity permanently. Every couple of minutes some request will be able to connect to sql server but then it will fail again. Recycling the web application pool or restarting the iis doesn't resolve the issue. However, after the web server is started, the problem goes away for few days only to resurface later.

Any ideas what might be causing the issue. Thanks

MichelZ
  • 11,068
  • 4
  • 32
  • 59
circuit123
  • 21
  • 2
  • Smells like a name resolution (DNS) problem to me. – joeqwerty Mar 15 '14 at 14:57
  • I am using IP address to connect to sql server. Does DNS server play any role when using IP address? Also the ping request to sql server works even though connectivity to sql port 1433 fails. – circuit123 Mar 15 '14 at 15:33
  • @circuit123: including the connection string details would be helpful. Such as if you are using an ip address and sql logon or Windows logon. Also, have you checked the logs on the sql server? – Greg Askew Mar 16 '14 at 14:30

1 Answers1

0

We had something kind of like this happen once and it turned out there was a problem in the network drivers on the server in question. The result was it would work for a while...then just drop connections. Maybe check you are up to date on both sides with firmware/drivers?

Mary
  • 1