-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Non-JSON response from Snowflake connection attempt results is not handled #3350
Comments
Thanks for opening @barberscott, and for pointing to the relevant spot in the code! I bet this is an easy thing to check and handle, the question will be doing it as quickly and reliably as possible. This is hardly my area of expertise, but from reading a bit online (i.e. this SO post), it sounds like we might be able to check the result = requests.post(token_url, headers=headers, data=data)
if result.headers.get('content-type') == 'application/json':
result_json = result.json() If the response isn't JSON, we should call Any chance this is a fix you'd be interested in contributing? :) |
It is possible via the Snowflake OAuth/SSO pathway that our attempt to obtain an access_token will fail for a variety of reasons. The resultant response may or may not be in JSON but this code assumes it always will be:
https:/fishtown-analytics/dbt/blob/d8c261ffcfab0da7974310760a74d7858756c3ed/plugins/snowflake/dbt/adapters/snowflake/connections.py#L128-L132
and errors out with
Expecting value: line 1 column 1 (char 0)
when receiving a non-JSON response.The text was updated successfully, but these errors were encountered: