-
Notifications
You must be signed in to change notification settings - Fork 197
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
Key pair auth not working for Snowflake #2192
Comments
more detailed stack trace:
seems like this line: https://github.com/dlt-hub/dlt/blob/devel/dlt/destinations/impl/snowflake/configuration.py#L32 |
Figured out the issue, here's what I did to get it to work:
My understanding of what's happeningWhen dlt parses the raw SQLAlchemy url you pass it, it calls make_url a SQLAlchemy function. When I breakpointed it here, it looks like SQLAlchemy actually url encodes the string you pass in but skips It decodes this url in the next line implicitly when it calls Possible solutionsOption 1: Make this Option 2: Continue advising users to base64 encode their private key (this gets rid of the plus sign issue) before passing in to the connection string and call b64 decode twice. Option 3: Fix SQLAlchemy dependency to properly handle Let me know if this makes sense or I missed something! |
@kning just to confirm before I investigate further: What is the exact line that you ran to encode your private key into base64 on the first try? You should be running |
hey i tried doing pem file but still getting the same error. here are the commands i ran
|
dlt version
1.5.0
Describe the problem
I've followed the instructions here for setting up key-pair auth for Snowflake, but can't get it to work, I always get:
I've stripped the headers of the private key and put it in one line before running
base64 -i rsa_key.p8
and then passing that value like"snowflake://loader:<password>@kgiotue-wn98412/dlt_data?private_key=<base64 encoded pem>
and it still doesn't work.I've confirmed that the key-pair I generated works fine by testing with snowsql, so my hunch is something is happening at the base64 encoding step or on dlt's side with how it parses out the private key from the connection url.
More context here:
https://dlthub-community.slack.com/archives/C04DQA7JJN6/p1730941780777469
Expected behavior
We're trying to incorporate dlt into our production elt. Key-pair auth for service accounts like this is best practice so it should work reliably and easily.
Steps to reproduce
If you have a dev snowflake for testing try creating a key pair and plugging it into this simple script to see if it works:
Operating system
macOS
Runtime environment
Other
Python version
3.11
dlt data source
local
dlt destination
Snowflake
Other deployment details
Using Modal
Additional information
No response
The text was updated successfully, but these errors were encountered: