无法连接到数据库 - EADDRNOTAVAIL [英] can't connect to DB - EADDRNOTAVAIL

查看:227
本文介绍了无法连接到数据库 - EADDRNOTAVAIL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Node.js应用程序,无法连接到SQL数据库。

I have a simple node.js app that can't connect to a SQL Db.

Web服务器是Azure的Web应用程序,运行的Node.js和使用繁琐了解SQL。
DB是Azure的SQL数据库。

Web server is Azure Web App, running node.js and using Tedious for SQL. DB is Azure SQL Database.

这是详细的错误:

{
    消息:无法连接到xxx.database.windows.net:1433 - 未定义,
    code:ESOCKET'}

{ message: 'Failed to connect to xxx.database.windows.net:1433 - undefined', code: 'ESOCKET' }

周四2016年1月14日8时05分05秒GMT + 0000(协调世界时):Unaught异常:ConnectionError:失去连接 - 连接 EADDRNOTAVAIL
      在连接。 (D:\\家\\网站\\ API \\ node_modules \\繁琐\\ lib目录\\ connection.js:797:26)
      在插座。 (D:\\家\\网站\\ API \\ node_modules \\繁琐\\ lib目录\\ connection.js:33:15)
      在Socket.emit(events.js:88:20)
      在Array.1(net.js:301:14)
      在EventEmitter._tickCallback(node.js的:190:38)

Thu Jan 14 2016 08:05:05 GMT+0000 (Coordinated Universal Time): Unaught exception: ConnectionError: Connection lost - connect EADDRNOTAVAIL at Connection. (D:\home\site\api\node_modules\tedious\lib\connection.js:797:26) at Socket. (D:\home\site\api\node_modules\tedious\lib\connection.js:33:15) at Socket.emit (events.js:88:20) at Array.1 (net.js:301:14) at EventEmitter._tickCallback (node.js:190:38)

它工作在我的机器上,而有趣的是,也适用于其他Azure的Web应用程序!我试图重新启动这个Web应用程序并没有什么......这是什么错误意味着什么?

It works on my machine, and the funny thing is that is also works on another Azure Web App! I tried restarting this web app and what not... What's this error means?

推荐答案

我试图重现该问题,但没有成功。所以,我搜索了一些图片关键词如 EADDRNOTAVAIL 为&的NodeJS放大器;单调乏味,后来我发现了网页。 https://github.com/nodejs/节点v0.x存档/问题/ 6833

I tried to reproduce the issue, but failed. So I searched some keyworks like EADDRNOTAVAIL for NodeJS & Tedious, then I found the page https://github.com/nodejs/node-v0.x-archive/issues/6833.

这启发了我,这个问题也许某个特定版本的节点上引起的。您可以在网址中找到坏Web应用程序的节点版本 https://开头< the_bad_webapp_name> .scm.azurewebsites.net / env的,并与精1个比较。

It inspired me that the issue might be caused on some specified version node. You can find the node version of the bad WebApp at the url https://<the_bad_webapp_name>.scm.azurewebsites.net/Env, and compare with the fine one.

您可以看到Azure的支持alll节点版本的网址 https://开头&LT;节点的webapp名称&gt; .scm.azurewebsites.net / API /诊断/运行节点Web应用程序。

You can see alll node version supported by Azure at the url https://<node webapp name>.scm.azurewebsites.net/api/diagnostics/runtime of Node WebApp.

如果它们的节点版本是不同的,你可以尝试指定乏味的节点版本工作正常,坏的webapp,请参考文档<一个href=\"https://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/\" rel=\"nofollow\">https://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/要知道如何做到这一点。

If their node version are different, you can try to specify the node version of Tedious works fine for the bad webapp, please refer to the doc https://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/ to know how to do it.

希望它帮助。

这篇关于无法连接到数据库 - EADDRNOTAVAIL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆