OperationalError: 250003: Failed to get the response. Hanging? method: post

OperationalError: 250003: Failed to get the response. Hanging? method: post

我正在尝试使用我的登录凭据连接到雪花。我正在使用以下代码:

snowflake.connector.connect(
    user="<my_user_name>",
    password="<my_password>",
    account="<my_account_name_with_region_and_cloud>"
    )

当我尝试 运行 上述代码时,出现以下错误:

OperationalError: 250003: 未能获得响应。绞刑?方法:post,url:https://hm53485.us-east-2.aws.snowflakecomputing.com:443/session/v1/login-request?request_id=fcfdd77a-11ff-4956-9ed8-bcc332c5989a&databaseName=S3_DB&schemaName=PUBLIC&warehouse=COMPUTE_WH&request_guid=b9fdb5c9-81cb-4ecb-8d20-abef44249bbf

我确信我所有的包都是最新的。我正在使用 python 3.6.4 和最新的 snowflake_connector_python.

我目前在 aws 中的 us-east-2 位置。

有人可以帮我解决这个问题吗????

我正在使用 sqlalchemy,您可以通过 pip 安装它:

pip install SQLAlchemy

https://docs.snowflake.net/manuals/user-guide/sqlalchemy.html

这是我笔记本开头的内容:

import snowflake.connector
import pandas as pd
from sqlalchemy import create_engine
from snowflake.sqlalchemy import URL

url = URL(
    account = 'xxxxxxxx.east-us-2.azure',
    user = 'xxxxxxxx',
    password = 'xxxxxxxx',
    database = 'xxxxxxxx',
    schema = 'xxxxxxxx',
    warehouse = 'xxxxxxxx',
    role='xxxxxxxx'
)

engine = create_engine(url)
connection = engine.connect()

query = '''
    select 1 AS VAL;
'''

df = pd.read_sql(query, connection)

df
Just Give your account name in the account .We dont need the region and full URL.
Please check below .

----------------------------------------------------------------------
import snowflake.connector


PASSWORD = '*******'
USER = '<USERNAME>'
ACCOUNT = 'SFCSUPPORT'
WAREHOUSE = '<WHNAME>'
DATABASE = '<DBNAME>'
SCHEMA = 'PUBLIC'

print("Connecting...")
# -- (> ------------------- SECTION=connect_to_snowflake --------------------
con = snowflake.connector.connect(
  user=USER,
  password=PASSWORD,
  account=ACCOUNT,
  warehouse=WAREHOUSE,
  database=DATABASE,
  schema=SCHEMA
)


con.cursor().execute("USE WAREHOUSE " + WAREHOUSE)
con.cursor().execute("USE DATABASE " + DATABASE)
#con.cursor().execute("USE SCHEMA INFORMATION_SCHEMA")


try:
    result = con.cursor().execute("Select * from <TABLE>")
    result_list = result.fetchall()
    print(result_list)

finally:
    con.cursor().close()
con.cursor().close()

我遇到了类似的错误。根据 https://docs.snowflake.com/en/user-guide/admin-account-identifier.html 尝试了一些操作,例如确保帐户名称正确。帐户名称取决于您的雪花帐户所在的区域。请注意,有些云区域最后需要一个云提供商名称,有些则需要。

但这并没有帮助解决我面临的问题。对我来说,这是一个代理问题。我试图通过代理从公司网络进行连接,但它阻止了与 Snowflake 的连接。在代理中将雪花列入白名单 URL 为我解决了这个问题。