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

connection error #29

Open
fishstoryyy opened this issue Mar 18, 2021 · 6 comments
Open

connection error #29

fishstoryyy opened this issue Mar 18, 2021 · 6 comments
Labels
question Further information is requested

Comments

@fishstoryyy
Copy link

Hi everyone, I am getting the following network error when testing a connection.

1616032517283] ERROR (ls): Connecting error: {"code":401001,"data":{"driver":"Snowflake","driverOptions":{}},"name":"NetworkError"}
    ns: "conn-manager"
[1616032517284] ERROR (ext): ERROR: Error opening connection Network error. Could not reach Snowflake., {"code":401001,"data":{"driver":"Snowflake","driverOptions":{}}}
    ns: "error-handler"
[1616032522861] INFO  (ext): EXECUTING COMMAND => sqltools.showOutputChannel

Not sure if it is caused by my account name. My account name (the part left to .snowflakecomputing.com) follows a format like this: letters_only.us-east-1.companyname

If the account name is not the cause, could it be a proxy issue?

Can someone please help? Really looking forward to making use of this extension.

@koszti
Copy link
Collaborator

koszti commented Mar 21, 2021

👋 the companyname is probably not required in the account. The account

The regular pattern of the account is: <account_name>[.<region_id>][.<cloud>]. (e.g. 'xy12345.east-us-2.azure') , and it needs to be one of the supported account locators listed at https://docs.snowflake.com/en/user-guide/connecting.html#your-snowflake-account-name . Can you please check the link above and try with the supported snowflake account locators?

If you're connecting to snowflake not via the listed account locators but through an internally managed proxy then it's currently not supported by this sql client.

btw, a new version (0.4.2) of the sql client is published to VSCode Marketplace with some more information on the connection form. Can you please upgrade, try again and let me know how is it going?

@koszti koszti added the question Further information is requested label Mar 21, 2021
@fishstoryyy
Copy link
Author

Thank you for your response. My apology for a late reply.

With regards to the example xy12345.east-us-2.azure you gave and other account locators listed here, what I should use to replace xy12345? My url looks like this: https://prod.us-east-1.companyname.snowflakecomputing.com.

Thanks you very much in advance.

@anujghai
Copy link

anujghai commented Jun 4, 2021

I'm presuming yo fixed it. If not I suggest installing snowsql https://docs.snowflake.com/en/user-guide/snowsql-start.html and then on linux/mac login via snowsql -a <account>> -u <<user> That way you can confirm all is okay before using this connector.

@fishstoryyy
Copy link
Author

fishstoryyy commented Jun 5, 2021

Hi anujghai,

I haven't found a fix yet. I was able to get it work on Python through the snowflake-connector-python but once I copy and paste the same credentials (account name and password) to this connector, the connection didn't go through.

@anujghai
Copy link

anujghai commented Jun 6, 2021

Okay, I tested with the python connector using a script like below (Replace with yours). Once tested I used the Snowflake Driver with the same user account,user, password as my test and included the database warehouse and schema and warehouse with OOSCP Fail-Open ticked and get a connection.
Personally I have never seen the company name embedded in the account name.
`
#!/usr/bin/env python
import snowflake.connector
import getpass

uname = input('Enter Username: ')
pword = getpass.getpass(prompt='Enter password: ', stream=None)
#Gets the version
ctx = snowflake.connector.connect(
user=uname,
password=pword,
account=''
)
cs = ctx.cursor()
try:
cs.execute("SELECT current_version()")
one_row = cs.fetchone()
print(one_row[0])
finally:
cs.close()
ctx.close()
`

@freddietattersall
Copy link

@fishstoryyy - did you ever find a solution here? My account name is companyname.eu-west-1 and I receive the same error. Again, it works just fine with the python connector.

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

No branches or pull requests

4 participants