node.jssnowflake-schema

Node.js - Network error. Could not reach Snowflake


I'm using 'snowflake-sdk', I'm trying to connect to snowflake but keep getting

code:
401001
message:
'Network error. Could not reach Snowflake.'
name:
'NetworkError'

Here is my code:

const snowConnect = snowflake.createConnection({
  account: 'https://xxxxxxx.eu-central-1.snowflakecomputing.com',
  username: username,
  password: password,
});
snowflake.configure({ insecureConnect: true });

snowConnect.connect(function (err, conn) {
  if (err) {
    debugger;
    console.error('Unable to connect: ' + err.message);
  } else {
    console.log('Successfully connected as id: ' + snowConnect.getId());
  }
});

Solution

  • Found the solution:

    this.createConnection = snowflake.createConnection({
      accessUrl: 'https://xxxxxxx-xxxxxxx.snowflakecomputing.com',
      username: 'xxxxxxxxx',
      password: 'xxxxxxxxxxxxxxxxxx',
      account: 'XXxxxxxxx',
      database: 'TEST',
      role: 'ACCOUNTADMIN',
    });