Sankar Ram
Sankar Ram

Reputation: 13

Snowflake - Connector issue with Python

I tried to connect Snowflake using python connector snowflake.connector.

error:

snowflake.connector.errors.OperationalError: 250003: Failed to get the response. Hanging? method: post, url: https://efa44011.snowflakecomputing.com:443/session/v1/login-request?request_id=306f23d5-8367-4f0c-a2ff-eebeaddc60d2&databaseName=SNOWFLAKE_SAMPLE_DATA&schemaName=TPCH_SF1000&warehouse=COMPUTE_WH&request_guid=1f40e88e-610b-430a-adb5-52c8baed6dbc

Complete Code :

import snowflake.connector
print("Connecting...")
con = snowflake.connector.connect(
    user='XXXXXXXX',
    password='XXXXXXX',
    account = 'efa44011',
    warehouse = 'COMPUTE_WH',
    database = 'SNOWFLAKE_SAMPLE_DATA',
    schema = 'TPCH_SF1000'
    )



con.cursor().execute("USE WAREHOUSE " +'COMPUTE_WH')
con.cursor().execute("USE DATABASE " + 'SNOWFLAKE_SAMPLE_DATA')

cs = con.cursor()
try:
    cs.execute("SELECT current_version()")
    one_row = cs.fetchone()
    print(one_row[0])
finally:
    cs.close()
con.close()

Thanks in advance

Upvotes: 1

Views: 4220

Answers (3)

cmconner156
cmconner156

Reputation: 109

I checked the account and confirmed that efa44011.snowflakecomputing.com is correct, so you are using the correct account params. What sort of host are you running python on? Your desktop, maybe an ec2 instance?

Can you try from a command prompt to see if the following works?

curl -k -v https://efa44011.snowflakecomputing.com

Upvotes: -1

Sriga
Sriga

Reputation: 1321

Could you please check the account URL appeared in the error is correct: https://efa44011.snowflakecomputing.com:443

If not you have mention the incorrect account name in connection parameters.

Hope this might help!

Upvotes: 0

demircioglu
demircioglu

Reputation: 3455

It might be the case that your account parameter is not correct.

Account information typically has the following structure depending on the region and cloud platform where your account is hosted:

account
account.region_id
account.region_id.platform

For example:

efa44011
efa44011.us-east-1
efa44011.east-us-2.azure

Upvotes: 2

Related Questions