New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server 2012 ECONNREFUSED #65
Comments
ECONNREFUSED suggests that 192.168.1.113 is not listening on port 1433. Does the SQL Server instance definitely have TCP enabled? |
I get the error: debug=> connection to undefined:1433 - failed Error: connect ECONNREFUSED |
The |
dbServer: 192.168.11.8\SQLEXPRESS2008 |
@flybluewolf please take a look at issue #68, as I think that my answer there is relevant. |
OK it seems to connect now. But when i try to do a simple select it just hangs. Here is the debug output: debugger listening on port 51981 Here is my code: var Connection = require('tedious').Connection; var config = var connection = new Connection(config); connection.on('connect', connected); function connected(err) function executeStatement()
} function infoError(info) function debug(message) function end() |
I execute 'netstat -na', but I don't find UDP 1444 port |
I don't see any call to |
Ugh, OK, that did the trick. Thank you so much :D |
I take it that @adviner and @flybluewolf are the same person, and that this issue is only dealing with one problem? |
No they are two different people. I started the post and now have it working. |
Hello, sorry for reviving this, but I'm getting an issue using the last code snippet posted by @adviner (with credentials properly changed, of course). I can never get past the SentPreLogin phase. Using the same code, all the output I get is: debug=> connected to SERVERt:1433 (server url obscured). The database is running in Azure and I can telnet to it from the machine running node. Any help would be appreciated. |
As I understand it, Azure databases require an encrypted connection. The code you're using doesn't check for an error in the Connection callback, the Encrypted tedious connections with node v0.10 (and v0.9) were broken. See #86 for a bit more info, and a commit that I believe fixes the problem. The same commit that fixes the v0.10 issue, also defaults the encryption cipher to RC4-MD5, because I've not managed to get encrypted connections working with DES-CBC3-SHA yet. This applies to node v0.8 as well. Can you try using the latest code in master, to pick up the fix, please? If that still fails, can you put all of the debug output in to a gist or pastebin please? You should get lots of detail, including hex dumps of the TDS packets. You will probably want to redact some details from the login7 packet. |
Thanks for the fast response. I'm past the previous error, but now I get the following output: debug=> connected to XXX.database.windows.net:1433 The servername is marked as XXX (I assume), and it's part of the connection string for the azure db. |
The last issue was a problem with our connection string Everything's working now. Thank you! |
Fantastic. |
Cloned the latest version from master |
Dear Experts, adding data to databse Your support is appreciated. |
@Beniy Do you have example code that we can use to reproduce this? |
Dear Arthurschreiber, Thanks |
Using latest nodejs and tedious versions and the following code:
var Connection = require('tedious').Connection;
var Request = require('tedious').Request;
var config =
{
server: '192.168.1.113',
userName: 'myUserName',
password: 'myPassword',
options:
{
database: 'MyDatabase',
port: '1433',
encrypt: true,
driver: 'SQL Server Native Client 11.0'
},
debug:
{
packet: true,
data: true,
payload: true,
token: true,
log: true
}
};
var connection = new Connection(config);
connection.on('connect', connected);
connection.on('infoMessage', infoError);
connection.on('errorMessage', infoError);
connection.on('end', end);
connection.on('debug', debug);
function connected(err)
{
console.log('connected=> ' + err);
}
function infoError(info)
{
console.log('infoError=> ' + info);
}
function debug(message)
{
console.log('debug=> ' + message);
}
function end()
{
}
I get the following error after i run it:
node test_sqlserver_tedious.js
debug=> connection to 192.168.1.113:1433 - failed Error: connect ECONNREFUSED
debug=> State change: Connecting -> Final
debug=> connection to 192.168.1.113:1433 closed
debug=> State change: Final -> Final
Any ideas? I could help you test the source if you show me how.
Thanks
The text was updated successfully, but these errors were encountered: