Error connecting to MS SQL from one server but not the other

5

We got a MS SQL server and two web site servers. I'm in the process of moving all the sites from one of the web site servers to the new one.

My asp.net sites are not able to connect to the external ms sql server after I've moved them to the new server. I'm able to both ping the MS SQL server and access it by telnet using the port 1433 from the web site server.

It works perfect from the old web site server so my guess is that there's something to do with the new server. I've tried to disable the firewall without it helping either.

Help would be much appreciated!

I get the following errors on two different sites (one running .net 2 and other .net 4):

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)

Exception Details: System.Data.SqlClient.SqlException: 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)

[SqlException (0x80131904): 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)]
DataAccessManager.ExecuteNonQuery(DbCommand command) in C:\Websites*\App_Code\DataAccessManager.vb:31
InsiteError.Save() in C:\Websites*\App_Code\System\InsiteError.vb:89

And

The network path was not found

Exception Details: System.ComponentModel.Win32Exception: The network path was not found

[Win32Exception (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]

[SqlException (0x80131904): 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: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)]
DataAccessManager.ExecuteSelectCommand(DbCommand command) in C:\Websites*\App_Code\DataAccessManager.vb:18
InsitePage..ctor(String file_name, PageResult& Result) in C:\Websites*\App_Code\InsitePage\InsitePage.vb:68
_Default.Page_PreInit(Object sender, EventArgs e) in C:\Websites*\default.aspx.vb:298
BasePage.OnPreInit(EventArgs e) in C:\Websites*\App_Code\System\BasePages\BasePage.vb:249 System.Web.UI.Page.PerformPreInit() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1844

-- Update -- Trying to connect with ms sql management studio from the new server do I get the following error:

TITLE: Connect to Server

Cannot connect to *.

------------------------------ ADDITIONAL INFORMATION:

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) (Microsoft SQL Server, Error: 53)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476


The network path was not found

sql-server
iis
web-server
windows-server-2012
asked on Server Fault Mar 28, 2014 by Arne H. Bitubekk • edited Mar 28, 2014 by Arne H. Bitubekk

1 Answer

0

Our hosting company had restricted the connection to SQL server to only be from IP addresses from the local network. The old website server was within this local network but the new website was in a different network. Our hosting company ended up fixing the issue after going several rounds them.

What threw me off was that when I remotely logged in on the new web server, then I could both ping and access the server by telnet using the port that MS SQL uses. I installed Management Studio on the web server and I was not able to connect to the MS SQL server using it. Somehow the restriction managed to differ what kind of connection it was and restricted it only to not allow SQL connections.

This was quite specific case but hope what people can take from it is how to debug and determine where the issue lays.

answered on Server Fault Oct 10, 2016 by Arne H. Bitubekk

User contributions licensed under CC BY-SA 3.0