-
Notifications
You must be signed in to change notification settings - Fork 133
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
SNOW-1708396: error: this.determineConnectionDomain
is not a function when connecting (since version 1.14.0)
#929
Comments
this.determineConnectionDomain
is not a function when connecting (since version 1.14.0)this.determineConnectionDomain
is not a function when connecting (since version 1.14.0)
hi - thank you for reporting this issue. can you please provide a runnable code example, which exhibits the issue you're seeing? our tests did not seem to catch it, I also now used const snowflake = require('snowflake-sdk');
snowflake.configure({ logLevel: 'trace' });
const connection = snowflake.createConnection({
account: process.env.SFACCOUNT,
username: process.env.SFUSER,
password: process.env.SFPASS
});
connection.connect(function(err, conn) {
if (err) {
console.error('Unable to connect: ' + err.message);
} else {
console.log('Successfully connected as id: ' + connection.getId());
const statement = connection.execute({
sqlText: "SELECT CURRENT_USER() as whoami;",
complete: function(err, stmt, rows) {
if (err) {
console.error('Failed to execute statement due to the following error: ' + err.message);
} else {
console.log('[queryID ' + statement.getStatementId() + ', requestId ' + statement.getRequestId() + '] Number of rows produced: ' + rows.length);
for (row of rows) {
console.log(row);
}
}
}
});
}}); to connect manually and it worked. So it would be great to get some details about how the issue happens. |
hi @sfc-gh-dszmolka Thanks for responding promptly 🙌 here's the code: I believe this happens either because of destructuring when importing the module or because we use promisify. I was experimenting with the snowflake-sdk in Node modules directly, and it's definitely a binding issue. in here https://github.com/snowflakedb/snowflake-connector-nodejs/blob/master/lib/connection/connection.js#L196-L197 when I change similarly here https://github.com/snowflakedb/snowflake-connector-nodejs/blob/master/lib/connection/connection.js#L270-L271 I can either provide a small example of this, or I can also make a quick PR to fix this later today. Let me know if this is helpful |
thank you for the details - an example would definitely help. Why? Because Connection and the functions inside this looks like was always (6 years) defined like this. If there's now suddenly a binding issue after including #908 in the driver, and not before, we'll need to look into that. So a runnable repro would help in introducing a solution which solves your particular problem, and still keeps the driver operational for everyone else. |
thanks @sfc-gh-dszmolka I will follow up with the example and possibly open a PR later today or early next week for now I was able to fix it on our end. see the diff here: https://github.com/lightdash/lightdash/pull/11779/files#diff-749d13d2e4158294b62b12b5c584291f9d81ce75138402d5bcb13b331692c2afR197 |
thank you. I would also like to see if the change coming with #908 affect anyone else and causing problems for them. So it would be great to see the scope of this this issue doesn't affect anyone else and is now fixed for you by explicitly adding `.bind, and make sure it doesn't affect anyone else, before we potentially introduce a breaking change for others. |
Confirming we are seeing this same error on some snowflake scripts.
I could reproduce it on both v1.14.0 as well as v1.13.0, so I wouldn't limit your scope to just the changes in the latest release. We resolved it by pinning our version to v1.11.0 for now until it's fixed. |
hi @btryder thanks for this comment ! It is very interesting, that this regression which is only seen with 1.14.0 so far, is seen in older driver versions. Please, don't use v1.13.0 as it's a little bit broken unfortunately. Can you please provide some more information on this problem you're experiencing?
|
just fyi, if you are using
|
hi folks - we unfortunately have evidence (#936) that #908 introduced an unexpected regression. We're going to fix that, which fix will likely involve restoring the original functionality for the heartbeat. However, there must be a reason you raised the PR in the first place; AFAIK there was a user for whom the heartbeats did not work correctly. We were able to reproduce the error this time (with calling a I'll add the relevant PR too, but to avoid an unplanned issue after we fix the regression introduced by #908 ; could you maybe test it with either with which you already using, or even to make sure your use-case doesn't break after we fix the regression? Here's a simple test app which we used in an environment locally, where #908 was already reverted; and could successfully connect to Snowflake even in the var connection = snowflake.createConnection({
account: '..',
..
clientConfigFile: 'sf_client_config.json' // Easy Logging
});
const connectPromise = util.promisify(connection.connect).bind(connection);
try {
await connectPromise();
console.log('Connected to Snowflake.');
const connection_ID = connection.getId();
} catch (err) {
console.error('Unable to connect: ' + err.message);
return;
} This worked with both the vanilla v1.10.1 against which the issue was originally reported, and the master branch as well where locally 908 was reverted. |
linking #939 |
PR is merged and will be part of the next release |
released with Snowflake Node.js driver v1.15.0 in the October 2024 release cycle |
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
1.14.0
MacOS/ARM
v20.12.1 / 10.5.0
npm list
)?from yarn lock
snowflake-sdk@~1.14.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/snowflake-sdk/-/snowflake-sdk-1.14.0.tgz#2db7496592b5a6680ec30d7bf1b35880a5838a2b"
dependencies:
"@aws-sdk/client-s3" "^3.388.0"
"@aws-sdk/node-http-handler" "^3.374.0"
"@azure/storage-blob" "12.18.x"
"@google-cloud/storage" "^7.7.0"
"@techteamer/ocsp" "1.0.1"
asn1.js-rfc2560 "^5.0.0"
asn1.js-rfc5280 "^3.0.0"
axios "^1.6.8"
big-integer "^1.6.43"
bignumber.js "^9.1.2"
binascii "0.0.2"
bn.js "^5.2.1"
browser-request "^0.3.3"
expand-tilde "^2.0.2"
fast-xml-parser "^4.2.5"
fastest-levenshtein "^1.0.16"
generic-pool "^3.8.2"
glob "^10.0.0"
https-proxy-agent "^7.0.2"
jsonwebtoken "^9.0.0"
mime-types "^2.1.29"
mkdirp "^1.0.3"
moment "^2.29.4"
moment-timezone "^0.5.15"
open "^7.3.1"
python-struct "^1.1.3"
simple-lru-cache "^0.0.2"
toml "^3.0.0"
uuid "^8.3.2"
winston "^3.1.0"
6.Server version:* E.g. 1.90.1
8.37.1
We (from @lightdash) recently contributed to this SDK: #908, and yesterday, it was published on NPM as version 1.14.0. However, we've noticed our tests failing after the version bump.
We've looked into the logs and realized that there's an issue with opening a connection, and it throws this error:
error: this.determineConnectionDomain is not a function
Connection should have succeeded.
Can you set logging to DEBUG and collect the logs?
X
What is your Snowflake account identifier, if any? (Optional)
X
The text was updated successfully, but these errors were encountered: