snowflakedb / snowflake-connector-python

Snowflake Connector for Python
https://pypi.python.org/pypi/snowflake-connector-python/
Apache License 2.0
601 stars 473 forks source link

SNOW-1778151: ERROR:snowflake.connector.result_batch:Failed to fetch the large result set batch 01b80e2e-0000-e354-0001-2992007d2476_0%2Fmain%2Fdata_0_0_0 for the 3 th time, backing off for 4s for the reason: '000403: 403: HTTP 403: Forbidden' #2099

Open Coder-C18 opened 3 weeks ago

Coder-C18 commented 3 weeks ago

Python version

3.9

Operating system and processor architecture

windown 11

Installed packages

asn1crypto==1.5.1
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
cryptography==42.0.8
filelock==3.16.1
idna==3.10
numpy==2.0.2
packaging==24.1
pandas==2.2.3
platformdirs==4.3.6
polars==1.12.0
pyarrow==18.0.0
pycparser==2.22
PyJWT==2.9.0
pyOpenSSL==24.2.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.2
PyYAML==6.0.2
requests==2.32.3
six==1.16.0
snowflake-connector-python==3.10.0
sortedcontainers==2.4.0
tomlkit==0.13.2
typing_extensions==4.12.2
tzdata==2024.2
urllib3==1.26.2

What did you do?

conn = conn_snowflake()
cursor = conn.cursor()
cursor.execute(""" SELECT * FROM "Dim_Ops_Terminal_BASE" """)
results = cursor.fetch_arrow_all()
cursor.close()
conn.close()
for row in results:
    print(row)

What did you expect to see?

The data will be fetched, but there was an error during the fetch process. I checked the query history on snowflake and the query was successful.

Can you set logging to DEBUG and collect the logs?

snowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden
DEBUG:snowflake.connector.result_batch:started downloading result batch id: 01b80e2e-0000-e354-0001-2992007d2476_0%2Fmain%2Fdata_0_0_0
DEBUG:snowflake.connector.network:Session status for SessionPool 'None', SessionPool 1/1 active sessions
DEBUG:snowflake.connector.result_batch:downloading result batch id: 01b80e2e-0000-e354-0001-2992007d2476_0%2Fmain%2Fdata_0_0_0 with existing session <snowflake.connector.vendored.requests.sessions.Session object at 0x000001E91A96B5E0>
DEBUG:snowflake.connector.vendored.urllib3.connectionpool:https://lia4wesfcb1stg.blob.core.windows.net:443 "GET /results/01b80e2e-0000-e354-0001-2992007d2476_0%2Fmain%2Fdata_0_0_0?sv=2021-04-10&se=2024-10-31T16%3A36%3A04Z&skoid=afc88b26-037c-4a14-ba40-5211f9943a63&sktid=ca760c79-c5b6-4b41-b1c7-c0853bb622ad&skt=2024-10-30T08%3A40%3A44Z&ske=2024-11-06T08%3A39%3A44Z&sks=b&skv=2021-04-10&sr=b&sp=r&sig=liu3T7qU47utJeoCz77XmHIX5AjT5ntFKmVBfx4TUcw%3D&rsce=gzip HTTP/1.1" 403 246
DEBUG:snowflake.connector.network:Session status for SessionPool 'None', SessionPool 0/1 active sessions
ERROR:snowflake.connector.result_batch:Failed to fetch the large result set batch 01b80e2e-0000-e354-0001-2992007d2476_0%2Fmain%2Fdata_0_0_0 for the 2 th time, backing off for 1s for the reason: '000403: 403: HTTP 403: Forbidden'
Traceback (most recent call last):
sfc-gh-dszmolka commented 1 week ago

hi - would it be an option for you to please try to use any other kind of Snowflake driver (JDBC, ODBC, .NET, node.js) with the exact same settings to see if you still have the issue ? I don't think this is anyhow related to this library in which the issue is raised.

Rather a connectivity issue between the client driver and Microsoft Azure storage blob, based on the log snippet you sent above.

Also please make sure , if there's any proxy or other node between the client and the Azure storage, that it allows and bypassess the requests from the driver.