SNOW-1018408: Unhandled promise rejections on keypair auth #757
Labels
enhancement
The issue is a request for improvement or a new feature
status-fixed_awaiting_release
The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector.
status-triage_done
Initial triage done, will be further handled by the driver team
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of NodeJS driver are you using?
1.9.3
What operating system and processor architecture are you using?
M1 mac (arm64) running Sonoma 14.2.1
What version of NodeJS are you using?
(
node --version
andnpm --version
)$ node --version
v18.11.0
$ npm --version
8.19.2
What are the component versions in the environment (
npm list
)?$ npm list
[email protected] /Users/jake/tmp/snowflake-sdk-repeat-creates
└── [email protected]
5.Server version:* E.g. 1.90.1
8.3.1
I think the server shouldn't be involved here (it is, but that's because of the bug)
Attempted to connect to snowflake with an unsupported elliptic curve key. Please note that the key material in this paste is NOT sensitive in any way, though I'm sure it will set something off:
I expect to see exactly one message, something like this (+ stack trace):
Instead, I got 2 messages:
I definitely did not expect that!
I can if you actually need it, but I don't think it'll be too helpful. The issue is here where the code calls authenticate(), which is always async and can reject, and then doesn't wait for the promise to resolve or reject, but instead immediately tries to connect. The control flow here is a little tough to fix, but here's what I did locally to get my desired behavior. Obviously I haven't tested any other failure modes:
The idea is this needs to get rearranged to make sure that all the connection stuff doesn't happen if auth fails and instead calls the
callback
with the error. It seems like all the other authentication methods should be susceptible to some form of this since they're also all async.The text was updated successfully, but these errors were encountered: