-
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-974846: Connection fails with error:0308010C with node 20 & v.1.9.1 #703
Comments
hi and thank you for raising this with us, we're going to take a look |
I have noticed that this also occurs in node 18 - it seems to be related to this webpack/webpack#14532 (comment). However I have not yet really figured out, whether the problem is on your side or on our side. I do not have a problem in other projects using node 18 though. Maybe it is also worth noting that we use the SNOWFLAKE_JWT authenticator in the createConnection method, like below:
|
using the following simplistic repro program on a Debian 12 (bookworm) container: root@2b91bc5b9fdc:/node# cat node702.js
var snowflake = require('snowflake-sdk');
console.log(`\nNode.js process version is: ${process.version}\n`);
//snowflake.configure({ logLevel: "TRACE" });
var connection = snowflake.createConnection({
account: process.env.SFACCOUNT,
username: process.env.SFUSER,
authenticator: 'SNOWFLAKE_JWT',
privateKeyPath: '/node/rsa_key.p8',
application: __filename.slice(__dirname.length + 1)
});
connection.connect(function(err, conn) {
if (err) {
console.error('Unable to connect: ' + err.message);
} else {
console.log('Successfully connected as id: ' + connection.getId());
var statement = connection.execute({
sqlText: 'select \'Query run successfully on Snowflake with keypair auth\' as result;',
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);
}
}
});
}
}); could not reproduce the issue yet:
started putting this repro together before reading your update which indicates you use encrypted private key, so I'll also test with that. i used unencrypted PK above. |
so using the encrypted private key resulted the same successful result; so can confirm that using the since your comment points to using
seems to be related to
which suggests this issue has more like something to do with openssl and how they private key was generated; rather than the with that said; here's how I generated the key per the Snowflake documenation: $ openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8 edit: since Snowflake allows two keys for the same user, as a test could you please try
then retry authenticating with the new private key. |
Thanks, I will give it a shot as soon as possible. I am currently in the process of getting the correct grants to add the public key to the user, since it was not me who originally created it. |
for the time being, I'm going to close this issue out as it looks like the behaviour is tied to |
Dear @sfc-gh-dszmolka, thank you for your effort. The problem was indeed resolved with a new key generated with OpenSSL >3.0. Unfortunately, it took a while to get the grants on the user. Sorry for opening this here then in the end. Greetings from Switzerland! |
Dear @smallTrogdor thank you so much for taking the time to give feedback on the solution offered, it's great to hear it indeed helped you ! |
…20+ crash) (#8713) This upgrade is required to fix a compatibility issue for Snowflake SDK and Node.js 20+. References: - snowflakedb/snowflake-connector-nodejs#588 - snowflakedb/snowflake-connector-nodejs#703
latest version (v.1.9.1) of snowflake-connector-nodejs
linux amd64 (docker engine)
(
node --version
andnpm --version
)Node.js v20.9.0
npm v10.1.0
npm list
)?5.Server version:
7.41.0
What did you do?
In your release notes you state that with v1.9.1 you support nodeJs v20. However, when trying to connect, I receive the error:
I use the Key Pair Authentication & Key Pair Rotation auth flow.
What did you expect to see?
I expected to sucessfully connect to the snowflake db through my connector.
Can you set logging to DEBUG and collect the logs?
report-exporter-67-8g452-repair-and-clean-report-exporter.log
SBB.EAP
The text was updated successfully, but these errors were encountered: