问题
I am developing a web application, using Visual Studio 2013 and a SQL SERVER database created on Azure.
Almost every time that I took more than 30 seconds to build and re-run the application (F5) I get this error below. The connection sql connection to SQL Timed-out and this is the error raised.
[Win32Exception (0x80004005): The network path was not found]
I retry the connection and the problem goes away. The point is that I am loosing so much time on this issue.
INFO ADDED:
- I have the SAME issue on SQL Management, first attempt network not found, second attempt it works.
- I have seen other computers, running other apps (.net based) on the company with the same behavior on a different SQL Azure server, so, in my mind is something related to azure dns.
- I have two SQL connections, to the same server, one for OWIN context, and another used by Entity Framework 6. Both MARS enable.
- I don't feel to having the same issue browsing any other website.
- My computer is part of an enterprise domain (that I had myself setup, and I am not an expert on Windows Server)
- I am using a Macbook with ThunderBolt dongle for ethernet.
My connection strings
<connectionStrings>
<add name="Container" connectionString="metadata=res://*/Models.MakeItMine.csdl|res://*/Models.**********.ssdl|res://*/Models.**********.msl;provider=System.Data.SqlClient;provider connection string="data source=**********.database.windows.net;initial catalog=db**********;persist security info=True;user id=**********;password=**********;MultipleActiveResultSets=True;App=EntityFramework;Connection Timeout=3;ConnectRetryCount=3;ConnectRetryInterval=1"" providerName="System.Data.EntityClient" />
<add name="OWINConnection" connectionString="data source=**********.database.windows.net;initial catalog=db**********;persist security info=True;user id=**********;password=**********;MultipleActiveResultSets=True;App=MakeItMine;Connection Timeout=3;ConnectRetryCount=3;ConnectRetryInterval=1" providerName="System.Data.SqlClient" />
</connectionStrings>
My IP settings
What I tried
- Disabled AVG Components
- Disabled Windows Firewall for Home/Enterprise networks
- Changed my dns to Google's dns (8.8.8.8/8.8.4.4), if I open nslookup and try to resolve my database path, it works every time.
- Changed my sql connection parameters: "Connection Timeout=3;ConnectRetryCount=3;ConnectRetryInterval=1", so it takes less time to raise the error, and I can retry faster and not loose so much time.
Azure doesn't permit me "pinging" the server, since never returns. So, I am really in trouble on how to troubleshoot/monitor this issue.
Any suggestions on how to troubleshoot this are appreciated.
回答1:
I did not found the exact problem neither the perfect solution yet, but I do know its a DNS related problem. So, my fix by now is changing my windows HOSTS file and fixing my database dns to its ip. It's working for now and saving me a lot of debugging time.
来源:https://stackoverflow.com/questions/40390064/the-network-path-was-not-found-every-first-attempt-to-azure-sql-server