每次首次尝试Azure SQL Server时,都找不到网络路径 [英] 'The network path was not found' every first attempt to Azure SQL Server
问题描述
我正在开发一个Web应用程序,使用Visual Studio 2013和在Azure上创建的SQL SERVER数据库。
I am developing a web application, using Visual Studio 2013 and a SQL SERVER database created on Azure.
几乎每次我花了超过30秒建立并重新运行应用程序(F5)我在下面得到这个错误。连接sql连接到SQL Timed-out,这是提出的错误。
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):没有找到网络路径]
[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:
- 我在SQL管理上遇到了同样的问题,首先尝试网络找不到,第二次尝试它的工作。
- 我看过其他电脑,运行其他应用程序(基于.net)在同一行为在不同的SQL Azure服务器上,所以,在我看来,与天蓝色dns相关的事情。
- 我有两个SQL连接,到同一个服务器,一个用于OWIN上下文,另一个用于Entity Framework 6.两个MARS启用。
- 我不觉得浏览任何其他网站有相同的问题
- 我的电脑是企业网域的一部分(我自己设置了,我不是Windows Server的专家)
- 我是使用带有ThunderBolt加密狗的Macbook作为以太网。
- 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.
我的连接字符串
<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>
我的IP设置
我尝试的
- 已禁用AVG组件
- 已禁用Home / Enterprise的Windows防火墙
网络 - 更改了我的dns到Google的dns(8.8.8.8/8.8.4.4),如果我打开
nslookup并尝试解决我的数据库路径,它每次都工作。 - 更改了我的sql连接参数:Connection Timeout = 3; ConnectRetryCount = 3; ConnectRetryInterval = 1,所以花费更少的时间来提高错误,我可以重试更快,不要太多的时间。
- 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不允许我ping服务器,因为从不返回。所以,我真的很麻烦,如何解决/监控这个问题。
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.
推荐答案
我没有发现确切的问题,而不是完美的解决方案,但我知道它的DNS相关问题。
所以,我现在修复的是更改我的Windows HOSTS文件,并将我的数据库dns修复到其ip。现在正在工作,节省了大量的调试时间。
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.
这篇关于每次首次尝试Azure SQL Server时,都找不到网络路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!