Skip to content
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

KeyPair on WSL2 (probably WSL too) not working #45

Open
anujghai opened this issue Jun 3, 2021 · 2 comments
Open

KeyPair on WSL2 (probably WSL too) not working #45

anujghai opened this issue Jun 3, 2021 · 2 comments

Comments

@anujghai
Copy link

anujghai commented Jun 3, 2021

Got public / private keypair working using snowflake connector for python and snowsql both on WSL2 but having difficulty recognising the private key file via the Snowflake Connecto on SQLTool.
I've copied the key file from WSL to /mnt/c to see if that is the problem but the same message with a different directory. In both cases I pick the file from the drop down instead of typing it in directly.

Error log shows as:
[1622678960563] ERROR (ls): Connecting error: {"code":-32001,"data":{"driver":"Snowflake","driverOptions":{}},"name":"Error"}
ns: "conn-manager"
[1622678960565] ERROR (ext): ERROR: Error opening connection ENOENT: no such file or directory, open '\wsl$\Ubuntu\home\itsme\snowflake\snowflake_keys\snowflake_test.rsa_key', {"code":-32001,"data":{"driver":"Snowflake","driverOptions":{}}}
ns: "error-handler"
[1623272025619] INFO (ext): EXECUTING COMMAND => sqltools.showOutputChannel

@anujghai anujghai changed the title KeyPair not working KeyPair on WSL2 (probably WSL too) not working Jun 10, 2021
@anujghai
Copy link
Author

Hi, I got a fix: In short the key full filepath needs to be in Native Linux format as you would get to it from your WSL disstro and do not use the SELECT FILE Button as it will build the path in Windows format.

An enhancement would be if WSL is being used that the file button Select would use the filepath for the Linux distro.

I don't know how to change the status to enhancement. Sorry. Could the owner please change it.

Details:
Don't pick the private key from the SELECT FILE button if you are on WSL2.
This is because the file path is in Windows format and you need it in Linux format.
The egs below are as if I has the key in both Windows and Linux and was to pick one of them. Personally if I'm
using wsl I'd leave the key in the wsl distro especilly if you're using the same ksy for sqnowsql or the python connector.
eg: BAD
WINDOWS wrong format although it looks okay (If I pick from the SELECT file button)
A) Use KEY on Windows dir: C:\itsme\snowflake_test.rsa_key
B) Use KEY on Linux dir: \wsl$\Ubuntu\home\itsme\snowflake\snowflake_keys\snowflake_test.rsa_key
eg: GOOD
LINUX right format enter it directlyv(eg is with Ubuntu 18.04.03 distro)
A) Use KEY on Windows dir: /mnt/c/itsme/snowflake_test.rsa_key
B) Use KEY on Linux dir: /home/itsme/snowflake/snowflake_keys/snowflake_test.rsa_key

@Dremet
Copy link

Dremet commented Jan 13, 2022

Could you show how you configured this? @anujghai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants