Ad
Snowflake DW Conncetion With Node.js Driver
I am using the sample code provided by Snowflake for connecting with Node.js driver, but keep getting following errors:
"Unable to connect: Incorrect username or password was specified."
"Cannot read propertygetPeerCertificate
of null"
I've also tried the old way where region is provided as a separate parameter and account is xyz12345 instead of xyz.region.azure
Node.js, not working
var snowflake = require('snowflake-sdk');
var connection = snowflake.createConnection({
account: 'xyz12345.region.azure',
username: 'username',
password: 'password'
});
connection.connect(function(err, conn) {
if (err) {
console.error('Unable to connect: ' + err.message);
} else {
console.log('Successfully connected as id: ' + connection.getId());
}
});
Python, working
import os
import sys
import json
import snowflake.connector
ctx = snowflake.connector.connect(
user='username',
password='password',
account='xyz12345.region.azure'
)
cs = ctx.cursor()
cs.execute("SQL statement")
I have the exact same parameters in equivalent python script, which works perfectly. And yes, I've triple checked that the username and password are correct, and I've tried different accounts, none of which work.
Is anyone experiencing with similar problems?
Ad
Answer
Try this:
var connection = snowflake.createConnection({
account: 'xyz12345',
username: 'username',
password: 'password',
region: 'region.azure'
});
There is a known issue in NodeJS driver. account
cannot include region
yet.
Ad
source: stackoverflow.com
Related Questions
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error
Ad