-
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
Invalid Snowflake account produces invalid URL, unhandledPromiseRejection, and swallows error #537
Comments
hi and thank you for raising this issue! it is surely not a bug - it's the responsibility of the user to provide the account as per the documented format. (either regionless: but, i agree there's also room for improvement or at least handle these user errors more gracefully, so we'll take a look. appreciate your inputs for the possible ways forward ! |
@sfc-gh-dszmolka thank you for your response. In our application, we receive the account from the end user and pass it along to snowflake-sdk. It is untrusted input, so is there a function in snowflake-sdk that can validate the account string? |
at this moment of writing, I'm not aware of such validation for |
should be resolved with #692 , review in progress |
#692 merged into |
node.js driver version 1.9.1 released with the fix and is available on npm. thank you all for bearing with us ! |
Reproduction
You can put this test.js file in the root of the repo to reproduce:
Solutions
1. Improve URL parsing
snowflake-sdk should probably ensure the URLs it constructs are valid, and fail early (perhaps with a synchronous exception) if not. I don't know all the places in the snowflake-sdk that construct URLs, but my particular error arises (in part) here:
Notice that the URLs aren't validated, they're just formatted strings, so the resulting
accessUrl
is2.
try
/catch
aroundrequire('urllib').request
We could also put a
try
/catch
here inlib/http/base.js
like this:But this will lead to retries, which we do not want in the case of INVALID_URL. Instead, we'd like to error early.
The text was updated successfully, but these errors were encountered: