snowflake-connector-python icon indicating copy to clipboard operation
snowflake-connector-python copied to clipboard

SNOW-670921: Login did not fails instantly on 403 response

Open kotofos opened this issue 3 years ago • 1 comments

  1. What version of Python are you using?

Python 3.9.8 (main, Nov 10 2021, 11:10:16) [GCC 7.5.0]

  1. What operating system and processor architecture are you using?

Linux-5.14.21-150400.24.11-default-x86_64-with-glibc2.31

  1. What are the component versions in the environment (pip freeze)?
asn1crypto==1.5.1
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
cryptography==36.0.2
filelock==3.8.0
idna==3.4
oscrypto==1.3.0
pycparser==2.21
pycryptodomex==3.15.0
PyJWT==2.5.0
pyOpenSSL==22.0.0
pytz==2022.2.1
requests==2.28.1
snowflake-connector-python==2.8.0
typing_extensions==4.3.0
urllib3==1.26.12
  1. What did you do?

Used wrong account ID without dot in it. Like XXXX

The user provides the account ID field, thus all possible values must be handled properly.

Code:

import snowflake.connector
con = snowflake.connector.connect(
    user='XXXX',
    password='XXXX',
    account='XXXX',
)
  1. What did you expect to see?

Instant fail, same as when account ID is X.X

  1. Can you set logging to DEBUG and collect the logs?
python /home/kotofos/.config/JetBrains/PyCharm2021.2/scratches/scratch_5.py
2022-09-30 14:23:15,349 - MainThread ssl_wrap_socket.py:43 - inject_into_urllib3() - DEBUG - Injecting ssl_wrap_socket_with_ocsp
2022-09-30 14:23:15,349 - MainThread auth.py:90 - <module>() - DEBUG - cache directory: /home/kotofos/.cache/snowflake
2022-09-30 14:23:15,454 - MainThread cursor.py:79 - <module>() - DEBUG - Failed to import pyarrow. Cannot use pandas fetch API
2022-09-30 14:23:15,471 - MainThread connection.py:274 - __init__() - INFO - Snowflake Connector for Python Version: 2.8.0, Python Version: 3.9.8, Platform: Linux-5.14.21-150400.24.11-default-x86_64-with-glibc2.31
2022-09-30 14:23:15,472 - MainThread connection.py:519 - connect() - DEBUG - connect
2022-09-30 14:23:15,472 - MainThread connection.py:809 - __config() - DEBUG - __config
2022-09-30 14:23:15,472 - MainThread connection.py:933 - __config() - INFO - This connection is in OCSP Fail Open Mode. TLS Certificates would be checked for validity and revocation status. Any other Certificate Revocation related exceptions or OCSP Responder failures would be disregarded in favor of connectivity.
2022-09-30 14:23:15,472 - MainThread connection.py:951 - __config() - INFO - Setting use_openssl_only mode to False
2022-09-30 14:23:15,472 - MainThread converter.py:145 - __init__() - DEBUG - use_numpy: False
2022-09-30 14:23:15,473 - MainThread connection.py:712 - __open_connection() - DEBUG - REST API object was created: XXXX.snowflakecomputing.com:443
2022-09-30 14:23:15,473 - MainThread auth.py:170 - authenticate() - DEBUG - authenticate
2022-09-30 14:23:15,473 - MainThread auth.py:200 - authenticate() - DEBUG - assertion content: *********
2022-09-30 14:23:15,473 - MainThread auth.py:203 - authenticate() - DEBUG - account=XXXX, user=XXXX, database=None, schema=None, warehouse=None, role=None, request_id=c0d80547-2814-440e-9202-4729ea80af81
2022-09-30 14:23:15,473 - MainThread auth.py:236 - authenticate() - DEBUG - body['data']: {'CLIENT_APP_ID': 'PythonConnector', 'CLIENT_APP_VERSION': '2.8.0', 'SVN_REVISION': None, 'ACCOUNT_NAME': 'XXXX', 'LOGIN_NAME': 'XXXX', 'CLIENT_ENVIRONMENT': {'APPLICATION': 'PythonConnector', 'OS': 'Linux', 'OS_VERSION': 'Linux-5.14.21-150400.24.11-default-x86_64-with-glibc2.31', 'PYTHON_VERSION': '3.9.8', 'PYTHON_RUNTIME': 'CPython', 'PYTHON_COMPILER': 'GCC 7.5.0', 'OCSP_MODE': 'FAIL_OPEN', 'TRACING': 10, 'LOGIN_TIMEOUT': 20, 'NETWORK_TIMEOUT': None}, 'SESSION_PARAMETERS': {'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}}
2022-09-30 14:23:15,473 - MainThread auth.py:254 - authenticate() - DEBUG - Timeout set to 20
2022-09-30 14:23:15,474 - MainThread retry.py:351 - from_int() - DEBUG - Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2022-09-30 14:23:15,474 - MainThread retry.py:351 - from_int() - DEBUG - Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2022-09-30 14:23:15,474 - MainThread network.py:1147 - _use_requests_session() - DEBUG - Session status for SessionPool 'xxxx.snowflakecomputing.com', SessionPool 1/1 active sessions
2022-09-30 14:23:15,474 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: 20, retry cnt: 1
2022-09-30 14:23:15,474 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: 3fef5255-c33e-4121-a79b-658a7f2fa6f2
2022-09-30 14:23:15,474 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:15,476 - MainThread connectionpool.py:1003 - _new_conn() - DEBUG - Starting new HTTPS connection (1): xxxx.snowflakecomputing.com:443
2022-09-30 14:23:16,209 - MainThread cache.py:490 - _save() - DEBUG - acquiring /home/kotofos/.cache/snowflake/ocsp_cache.lock timed out, skipping saving...
2022-09-30 14:23:16,210 - MainThread ocsp_snowflake.py:515 - reset_cache_dir() - DEBUG - cache directory: /home/kotofos/.cache/snowflake
2022-09-30 14:23:16,260 - MainThread ssl_wrap_socket.py:80 - ssl_wrap_socket_with_ocsp() - DEBUG - OCSP Mode: FAIL_OPEN, OCSP response cache file name: None
2022-09-30 14:23:16,261 - MainThread ocsp_snowflake.py:557 - reset_ocsp_response_cache_uri() - DEBUG - ocsp_response_cache_uri: file:///home/kotofos/.cache/snowflake/ocsp_response_cache.json
2022-09-30 14:23:16,261 - MainThread ocsp_snowflake.py:558 - reset_ocsp_response_cache_uri() - DEBUG - OCSP_VALIDATION_CACHE size: 0
2022-09-30 14:23:16,261 - MainThread ocsp_snowflake.py:340 - reset_ocsp_dynamic_cache_server_url() - DEBUG - OCSP response cache server is enabled: http://ocsp.snowflakecomputing.com/ocsp_response_cache.json
2022-09-30 14:23:16,261 - MainThread ocsp_snowflake.py:376 - reset_ocsp_dynamic_cache_server_url() - DEBUG - OCSP dynamic cache server RETRY URL: None
2022-09-30 14:23:16,265 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-09-15 19:41:06+00:00
2022-09-30 14:23:16,266 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-09-15 19:45:34+00:00
2022-09-30 14:23:16,268 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-05-12 23:58:59+00:00
2022-09-30 14:23:16,269 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-05-12 23:58:59+00:00
2022-09-30 14:23:16,302 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-10-15 00:00:00+00:00
2022-09-30 14:23:16,303 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,305 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,306 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,307 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,308 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,309 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,310 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,312 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,313 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,314 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,315 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,316 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,317 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,319 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,320 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,321 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,324 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,325 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,326 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,328 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,329 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,330 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,331 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,332 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,333 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,335 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,336 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 15:48:31+00:00
2022-09-30 14:23:16,338 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-07-15 16:47:06+00:00
2022-09-30 14:23:16,340 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-06-22 07:00:00+00:00
2022-09-30 14:23:16,341 - MainThread ocsp_snowflake.py:593 - read_ocsp_response_cache_file() - DEBUG - Read OCSP response cache file: /home/kotofos/.cache/snowflake/ocsp_response_cache.json, count=192
2022-09-30 14:23:16,341 - MainThread ocsp_snowflake.py:1126 - validate() - DEBUG - validating certificate: xxxx.snowflakecomputing.com
2022-09-30 14:23:16,341 - MainThread ocsp_asn1crypto.py:439 - extract_certificate_chain() - DEBUG - # of certificates: 4
2022-09-30 14:23:16,342 - MainThread ocsp_asn1crypto.py:444 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('common_name', '*.prod3.us-west-2.snowflakecomputing.com')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')])
2022-09-30 14:23:16,342 - MainThread ocsp_asn1crypto.py:444 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('common_name', 'Amazon Root CA 1')])
2022-09-30 14:23:16,342 - MainThread ocsp_asn1crypto.py:444 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('common_name', 'Amazon Root CA 1')]), issuer: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'Arizona'), ('locality_name', 'Scottsdale'), ('organization_name', 'Starfield Technologies, Inc.'), ('common_name', 'Starfield Services Root Certificate Authority - G2')])
2022-09-30 14:23:16,343 - MainThread ocsp_asn1crypto.py:444 - extract_certificate_chain() - DEBUG - subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'Arizona'), ('locality_name', 'Scottsdale'), ('organization_name', 'Starfield Technologies, Inc.'), ('common_name', 'Starfield Services Root Certificate Authority - G2')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'Starfield Technologies, Inc.'), ('organizational_unit_name', 'Starfield Class 2 Certification Authority')])
2022-09-30 14:23:16,346 - MainThread ocsp_asn1crypto.py:123 - read_cert_bundle() - DEBUG - reading certificate bundle: /home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/certifi/cacert.pem
2022-09-30 14:23:16,361 - MainThread ocsp_asn1crypto.py:465 - create_pair_issuer_subject() - DEBUG - not found issuer_der: OrderedDict([('country_name', 'US'), ('organization_name', 'Starfield Technologies, Inc.'), ('organizational_unit_name', 'Starfield Class 2 Certification Authority')])
2022-09-30 14:23:16,363 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('common_name', '*.prod3.us-west-2.snowflakecomputing.com')])
2022-09-30 14:23:16,364 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-09-15 19:41:06+00:00
2022-09-30 14:23:16,364 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')])
2022-09-30 14:23:16,366 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-09-15 19:45:34+00:00
2022-09-30 14:23:16,366 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('common_name', 'Amazon Root CA 1')])
2022-09-30 14:23:16,368 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-06-22 07:00:00+00:00
2022-09-30 14:23:16,368 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'Arizona'), ('locality_name', 'Scottsdale'), ('organization_name', 'Starfield Technologies, Inc.'), ('common_name', 'Starfield Services Root Certificate Authority - G2')])
2022-09-30 14:23:16,370 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('common_name', '*.prod3.us-west-2.snowflakecomputing.com')])
2022-09-30 14:23:16,371 - MainThread ocsp_snowflake.py:1310 - validate_by_direct_connection() - DEBUG - using OCSP response cache
2022-09-30 14:23:16,371 - MainThread ocsp_asn1crypto.py:333 - process_ocsp_response() - DEBUG - Certificate is NOT attached in Basic OCSP Response. Using issuer's certificate
2022-09-30 14:23:16,371 - MainThread ocsp_asn1crypto.py:341 - process_ocsp_response() - DEBUG - Verifying the OCSP response is signed by the issuer.
2022-09-30 14:23:16,386 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-09-15 19:41:06+00:00
2022-09-30 14:23:16,387 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')])
2022-09-30 14:23:16,388 - MainThread ocsp_snowflake.py:1310 - validate_by_direct_connection() - DEBUG - using OCSP response cache
2022-09-30 14:23:16,389 - MainThread ocsp_asn1crypto.py:298 - process_ocsp_response() - DEBUG - Certificate is attached in Basic OCSP Response
2022-09-30 14:23:16,389 - MainThread ocsp_asn1crypto.py:300 - process_ocsp_response() - DEBUG - Verifying the attached certificate is signed by the issuer
2022-09-30 14:23:16,389 - MainThread ocsp_asn1crypto.py:303 - process_ocsp_response() - DEBUG - Valid Not After: 2025-09-15 19:41:06+00:00
2022-09-30 14:23:16,391 - MainThread ocsp_asn1crypto.py:341 - process_ocsp_response() - DEBUG - Verifying the OCSP response is signed by the issuer.
2022-09-30 14:23:16,396 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-09-15 19:45:34+00:00
2022-09-30 14:23:16,397 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('common_name', 'Amazon Root CA 1')])
2022-09-30 14:23:16,397 - MainThread ocsp_snowflake.py:1310 - validate_by_direct_connection() - DEBUG - using OCSP response cache
2022-09-30 14:23:16,398 - MainThread ocsp_asn1crypto.py:298 - process_ocsp_response() - DEBUG - Certificate is attached in Basic OCSP Response
2022-09-30 14:23:16,398 - MainThread ocsp_asn1crypto.py:300 - process_ocsp_response() - DEBUG - Verifying the attached certificate is signed by the issuer
2022-09-30 14:23:16,398 - MainThread ocsp_asn1crypto.py:303 - process_ocsp_response() - DEBUG - Valid Not After: 2025-09-15 19:45:34+00:00
2022-09-30 14:23:16,400 - MainThread ocsp_asn1crypto.py:341 - process_ocsp_response() - DEBUG - Verifying the OCSP response is signed by the issuer.
2022-09-30 14:23:16,404 - MainThread ocsp_asn1crypto.py:238 - is_valid_time() - DEBUG - Verifying the attached certificate is signed by the issuer. Valid Not After: 2023-06-22 07:00:00+00:00
2022-09-30 14:23:16,404 - MainThread ocsp_snowflake.py:733 - find_cache() - DEBUG - hit cache for subject: OrderedDict([('country_name', 'US'), ('state_or_province_name', 'Arizona'), ('locality_name', 'Scottsdale'), ('organization_name', 'Starfield Technologies, Inc.'), ('common_name', 'Starfield Services Root Certificate Authority - G2')])
2022-09-30 14:23:16,405 - MainThread ocsp_snowflake.py:1310 - validate_by_direct_connection() - DEBUG - using OCSP response cache
2022-09-30 14:23:16,406 - MainThread ocsp_asn1crypto.py:298 - process_ocsp_response() - DEBUG - Certificate is attached in Basic OCSP Response
2022-09-30 14:23:16,406 - MainThread ocsp_asn1crypto.py:300 - process_ocsp_response() - DEBUG - Verifying the attached certificate is signed by the issuer
2022-09-30 14:23:16,406 - MainThread ocsp_asn1crypto.py:303 - process_ocsp_response() - DEBUG - Valid Not After: 2023-06-22 07:00:00+00:00
2022-09-30 14:23:16,408 - MainThread ocsp_asn1crypto.py:341 - process_ocsp_response() - DEBUG - Verifying the OCSP response is signed by the issuer.
2022-09-30 14:23:16,410 - MainThread ocsp_snowflake.py:655 - write_ocsp_response_cache_file() - DEBUG - writing OCSP response cache file to /home/kotofos/.cache/snowflake/ocsp_response_cache.json
2022-09-30 14:23:16,410 - MainThread ocsp_snowflake.py:1802 - encode_ocsp_response_cache() - DEBUG - encoding OCSP response cache to JSON
2022-09-30 14:23:16,433 - MainThread ocsp_snowflake.py:1183 - _validate() - DEBUG - ok
2022-09-30 14:23:16,629 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=3fef5255-c33e-4121-a79b-658a7f2fa6f2 HTTP/1.1" 403 118
2022-09-30 14:23:16,640 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:16,641 - MainThread network.py:900 - _request_exec_wrapper() - DEBUG - retrying: errorclass=<class 'snowflake.connector.errors.ForbiddenError'>, error=000403: 403: HTTP 403: Forbidden, counter=1, sleeping=1(s)
2022-09-30 14:23:17,643 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: 18, retry cnt: 2
2022-09-30 14:23:17,644 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: d48b746c-d4f8-414b-b572-02f212031cd9
2022-09-30 14:23:17,644 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:17,844 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=d48b746c-d4f8-414b-b572-02f212031cd9 HTTP/1.1" 403 118
2022-09-30 14:23:17,847 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:17,848 - MainThread network.py:900 - _request_exec_wrapper() - DEBUG - retrying: errorclass=<class 'snowflake.connector.errors.ForbiddenError'>, error=000403: 403: HTTP 403: Forbidden, counter=2, sleeping=3(s)
2022-09-30 14:23:20,851 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: 15, retry cnt: 3
2022-09-30 14:23:20,851 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: 043c1f70-3507-48fd-a842-0dfbe670b0eb
2022-09-30 14:23:20,851 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:21,043 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=043c1f70-3507-48fd-a842-0dfbe670b0eb HTTP/1.1" 403 118
2022-09-30 14:23:21,044 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:21,044 - MainThread network.py:900 - _request_exec_wrapper() - DEBUG - retrying: errorclass=<class 'snowflake.connector.errors.ForbiddenError'>, error=000403: 403: HTTP 403: Forbidden, counter=3, sleeping=2(s)
2022-09-30 14:23:23,047 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: 13, retry cnt: 4
2022-09-30 14:23:23,047 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: 814fe1e7-30d2-45c6-9449-2d29d9102c13
2022-09-30 14:23:23,047 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:23,252 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=814fe1e7-30d2-45c6-9449-2d29d9102c13 HTTP/1.1" 403 118
2022-09-30 14:23:23,255 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:23,256 - MainThread network.py:900 - _request_exec_wrapper() - DEBUG - retrying: errorclass=<class 'snowflake.connector.errors.ForbiddenError'>, error=000403: 403: HTTP 403: Forbidden, counter=4, sleeping=4(s)
2022-09-30 14:23:27,260 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: 9, retry cnt: 5
2022-09-30 14:23:27,260 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: e22d7105-46ae-4c4f-8ba0-55d4a0844e46
2022-09-30 14:23:27,260 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:27,453 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=e22d7105-46ae-4c4f-8ba0-55d4a0844e46 HTTP/1.1" 403 118
2022-09-30 14:23:27,454 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:27,454 - MainThread network.py:900 - _request_exec_wrapper() - DEBUG - retrying: errorclass=<class 'snowflake.connector.errors.ForbiddenError'>, error=000403: 403: HTTP 403: Forbidden, counter=5, sleeping=8(s)
2022-09-30 14:23:35,460 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: 1, retry cnt: 6
2022-09-30 14:23:35,461 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: 192352f8-c433-427d-9c3c-b525dc29ae62
2022-09-30 14:23:35,461 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:35,664 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=192352f8-c433-427d-9c3c-b525dc29ae62 HTTP/1.1" 403 118
2022-09-30 14:23:35,666 - MainThread telemetry_oob.py:524 - export_queue_to_string() - DEBUG - Failed to generate a JSON dump from the passed in telemetry OOB events. String representation of logs: [{'Name': 'ForbiddenError', 'Urgent': False, 'Value': {'Stacktrace': (False, '  File "snowflake/connector/__init__.py", line 51, in Connect\n  File "snowflake/connector/connection.py", line 296, in __init__\n  File "snowflake/connector/connection.py", line 549, in connect\n  File "snowflake/connector/connection.py", line 788, in __open_connection\n  File "snowflake/connector/connection.py", line 1051, in _authenticate\n  File "snowflake/connector/connection.py", line 1071, in __authenticate\n  File "snowflake/connector/auth.py", line 257, in authenticate\n  File "snowflake/connector/network.py", line 704, in _post_request\n  File "snowflake/connector/network.py", line 794, in fetch\n  File "snowflake/connector/network.py", line 837, in _request_exec_wrapper\n  File "snowflake/connector/network.py", line 1044, in _request_exec\n  File "snowflake/connector/network.py", line 191, in get_http_retryable_error\n  File "snowflake/connector/errors.py", line 463, in __init__\n', None), 'sql_state': 'n/a', 'reason': '000403', 'ErrorNumber': '403'}, 'Tags': {<TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '483564d6-8e5a-4722-96ad-69d84f4bdc4a', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'HttpException000403: 403: HTTP 403: Forbidden', 'Urgent': False, 'Value': {'driver': 'PythonConnector', 'version': '2.8.0', 'request': 'post https://XXXX.snowflakecomputing.com:443/session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=3fef5255-c33e-4121-a79b-658a7f2fa6f2', 'sqlState': '08001', 'errorCode': 250003, 'exceptionMessage': '000403: 403: HTTP 403: Forbidden', 'exceptionStackTrace': 'Traceback (most recent call last):\n  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec\n    raise RetryRequest(error)\nsnowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden\n'}, 'Tags': {'responsestatuscode': '-1', 'sqlstate': '08001', 'errorcode': '250003', <TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': 'efb89e2e-146e-4cb4-b952-a8e8e9f6e9bd', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'ForbiddenError', 'Urgent': False, 'Value': {'Stacktrace': (False, '  File "snowflake/connector/__init__.py", line 51, in Connect\n  File "snowflake/connector/connection.py", line 296, in __init__\n  File "snowflake/connector/connection.py", line 549, in connect\n  File "snowflake/connector/connection.py", line 788, in __open_connection\n  File "snowflake/connector/connection.py", line 1051, in _authenticate\n  File "snowflake/connector/connection.py", line 1071, in __authenticate\n  File "snowflake/connector/auth.py", line 257, in authenticate\n  File "snowflake/connector/network.py", line 704, in _post_request\n  File "snowflake/connector/network.py", line 794, in fetch\n  File "snowflake/connector/network.py", line 837, in _request_exec_wrapper\n  File "snowflake/connector/network.py", line 1044, in _request_exec\n  File "snowflake/connector/network.py", line 191, in get_http_retryable_error\n  File "snowflake/connector/errors.py", line 463, in __init__\n', None), 'sql_state': 'n/a', 'reason': '000403', 'ErrorNumber': '403'}, 'Tags': {<TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '287bc4d9-ecca-43ec-9251-df61cadce1ec', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'HttpException000403: 403: HTTP 403: Forbidden', 'Urgent': False, 'Value': {'driver': 'PythonConnector', 'version': '2.8.0', 'request': 'post https://XXXX.snowflakecomputing.com:443/session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=d48b746c-d4f8-414b-b572-02f212031cd9', 'sqlState': '08001', 'errorCode': 250003, 'exceptionMessage': '000403: 403: HTTP 403: Forbidden', 'exceptionStackTrace': 'Traceback (most recent call last):\n  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec\n    raise RetryRequest(error)\nsnowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden\n'}, 'Tags': {'responsestatuscode': '-1', 'sqlstate': '08001', 'errorcode': '250003', <TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '3779fa9d-e3a3-4565-9b4d-f4a608f850ec', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'ForbiddenError', 'Urgent': False, 'Value': {'Stacktrace': (False, '  File "snowflake/connector/__init__.py", line 51, in Connect\n  File "snowflake/connector/connection.py", line 296, in __init__\n  File "snowflake/connector/connection.py", line 549, in connect\n  File "snowflake/connector/connection.py", line 788, in __open_connection\n  File "snowflake/connector/connection.py", line 1051, in _authenticate\n  File "snowflake/connector/connection.py", line 1071, in __authenticate\n  File "snowflake/connector/auth.py", line 257, in authenticate\n  File "snowflake/connector/network.py", line 704, in _post_request\n  File "snowflake/connector/network.py", line 794, in fetch\n  File "snowflake/connector/network.py", line 837, in _request_exec_wrapper\n  File "snowflake/connector/network.py", line 1044, in _request_exec\n  File "snowflake/connector/network.py", line 191, in get_http_retryable_error\n  File "snowflake/connector/errors.py", line 463, in __init__\n', None), 'sql_state': 'n/a', 'reason': '000403', 'ErrorNumber': '403'}, 'Tags': {<TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '01adeccb-7a24-4f44-a803-10b3a0fa97b8', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'HttpException000403: 403: HTTP 403: Forbidden', 'Urgent': False, 'Value': {'driver': 'PythonConnector', 'version': '2.8.0', 'request': 'post https://XXXX.snowflakecomputing.com:443/session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=043c1f70-3507-48fd-a842-0dfbe670b0eb', 'sqlState': '08001', 'errorCode': 250003, 'exceptionMessage': '000403: 403: HTTP 403: Forbidden', 'exceptionStackTrace': 'Traceback (most recent call last):\n  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec\n    raise RetryRequest(error)\nsnowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden\n'}, 'Tags': {'responsestatuscode': '-1', 'sqlstate': '08001', 'errorcode': '250003', <TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '925b3664-d088-4611-8ab0-5d268c311276', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'ForbiddenError', 'Urgent': False, 'Value': {'Stacktrace': (False, '  File "snowflake/connector/__init__.py", line 51, in Connect\n  File "snowflake/connector/connection.py", line 296, in __init__\n  File "snowflake/connector/connection.py", line 549, in connect\n  File "snowflake/connector/connection.py", line 788, in __open_connection\n  File "snowflake/connector/connection.py", line 1051, in _authenticate\n  File "snowflake/connector/connection.py", line 1071, in __authenticate\n  File "snowflake/connector/auth.py", line 257, in authenticate\n  File "snowflake/connector/network.py", line 704, in _post_request\n  File "snowflake/connector/network.py", line 794, in fetch\n  File "snowflake/connector/network.py", line 837, in _request_exec_wrapper\n  File "snowflake/connector/network.py", line 1044, in _request_exec\n  File "snowflake/connector/network.py", line 191, in get_http_retryable_error\n  File "snowflake/connector/errors.py", line 463, in __init__\n', None), 'sql_state': 'n/a', 'reason': '000403', 'ErrorNumber': '403'}, 'Tags': {<TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '371e104d-03e9-45ac-b503-fbb78fd381d1', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'HttpException000403: 403: HTTP 403: Forbidden', 'Urgent': False, 'Value': {'driver': 'PythonConnector', 'version': '2.8.0', 'request': 'post https://XXXX.snowflakecomputing.com:443/session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=814fe1e7-30d2-45c6-9449-2d29d9102c13', 'sqlState': '08001', 'errorCode': 250003, 'exceptionMessage': '000403: 403: HTTP 403: Forbidden', 'exceptionStackTrace': 'Traceback (most recent call last):\n  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec\n    raise RetryRequest(error)\nsnowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden\n'}, 'Tags': {'responsestatuscode': '-1', 'sqlstate': '08001', 'errorcode': '250003', <TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '0a9d21ff-44e7-4a40-bce1-a98cf702d6ea', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'ForbiddenError', 'Urgent': False, 'Value': {'Stacktrace': (False, '  File "snowflake/connector/__init__.py", line 51, in Connect\n  File "snowflake/connector/connection.py", line 296, in __init__\n  File "snowflake/connector/connection.py", line 549, in connect\n  File "snowflake/connector/connection.py", line 788, in __open_connection\n  File "snowflake/connector/connection.py", line 1051, in _authenticate\n  File "snowflake/connector/connection.py", line 1071, in __authenticate\n  File "snowflake/connector/auth.py", line 257, in authenticate\n  File "snowflake/connector/network.py", line 704, in _post_request\n  File "snowflake/connector/network.py", line 794, in fetch\n  File "snowflake/connector/network.py", line 837, in _request_exec_wrapper\n  File "snowflake/connector/network.py", line 1044, in _request_exec\n  File "snowflake/connector/network.py", line 191, in get_http_retryable_error\n  File "snowflake/connector/errors.py", line 463, in __init__\n', None), 'sql_state': 'n/a', 'reason': '000403', 'ErrorNumber': '403'}, 'Tags': {<TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '74fc5b79-a303-4f7f-8575-f3b9a234f194', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'HttpException000403: 403: HTTP 403: Forbidden', 'Urgent': False, 'Value': {'driver': 'PythonConnector', 'version': '2.8.0', 'request': 'post https://XXXX.snowflakecomputing.com:443/session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=e22d7105-46ae-4c4f-8ba0-55d4a0844e46', 'sqlState': '08001', 'errorCode': 250003, 'exceptionMessage': '000403: 403: HTTP 403: Forbidden', 'exceptionStackTrace': 'Traceback (most recent call last):\n  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec\n    raise RetryRequest(error)\nsnowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden\n'}, 'Tags': {'responsestatuscode': '-1', 'sqlstate': '08001', 'errorcode': '250003', <TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '7a9726ee-2035-405c-ae4a-b43e849f0d63', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}, {'Name': 'ForbiddenError', 'Urgent': False, 'Value': {'Stacktrace': (False, '  File "snowflake/connector/__init__.py", line 51, in Connect\n  File "snowflake/connector/connection.py", line 296, in __init__\n  File "snowflake/connector/connection.py", line 549, in connect\n  File "snowflake/connector/connection.py", line 788, in __open_connection\n  File "snowflake/connector/connection.py", line 1051, in _authenticate\n  File "snowflake/connector/connection.py", line 1071, in __authenticate\n  File "snowflake/connector/auth.py", line 257, in authenticate\n  File "snowflake/connector/network.py", line 704, in _post_request\n  File "snowflake/connector/network.py", line 794, in fetch\n  File "snowflake/connector/network.py", line 837, in _request_exec_wrapper\n  File "snowflake/connector/network.py", line 1044, in _request_exec\n  File "snowflake/connector/network.py", line 191, in get_http_retryable_error\n  File "snowflake/connector/errors.py", line 463, in __init__\n', None), 'sql_state': 'n/a', 'reason': '000403', 'ErrorNumber': '403'}, 'Tags': {<TelemetryField.KEY_OOB_DRIVER: 'driver'>: 'PythonConnector', <TelemetryField.KEY_OOB_VERSION: 'version'>: '2.8.0', <TelemetryField.KEY_OOB_TELEMETRY_SERVER_DEPLOYMENT: 'telemetryServerDeployment'>: 'prod', <TelemetryField.KEY_OOB_CONNECTION_STRING: 'connectionString'>: '://:', 'ctx_user': 'XXXX', 'ctx_account': 'XXXX', 'ctx_login_timeout': '20', 'ctx_session_parameters': "{'QUERY_TAG': 'EndOfMonthFinancials', 'CLIENT_PREFETCH_THREADS': 4}"}, 'UUID': '4dd660e2-f734-4f1a-9240-53cf3c9c1de6', 'Created_On': '2022-09-30 12:23:35', 'Type': 'Log', 'SchemaVersion': 1}]
Traceback (most recent call last):
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/telemetry_oob.py", line 522, in export_queue_to_string
    payload = json.dumps(logs)
  File "/home/kotofos/.pyenv/versions/3.9.8/lib/python3.9/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/home/kotofos/.pyenv/versions/3.9.8/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/kotofos/.pyenv/versions/3.9.8/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
TypeError: keys must be str, int, float, bool or None, not TelemetryField
2022-09-30 14:23:35,671 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:35,671 - MainThread network.py:900 - _request_exec_wrapper() - DEBUG - retrying: errorclass=<class 'snowflake.connector.errors.ForbiddenError'>, error=000403: 403: HTTP 403: Forbidden, counter=6, sleeping=14(s)
2022-09-30 14:23:49,750 - MainThread network.py:827 - _request_exec_wrapper() - DEBUG - remaining request timeout: -13, retry cnt: 7
2022-09-30 14:23:49,750 - MainThread network.py:808 - add_request_guid() - DEBUG - Request guid: 61fa4e57-df77-4ddb-b32b-57fa24a29960
2022-09-30 14:23:49,750 - MainThread network.py:1006 - _request_exec() - DEBUG - socket timeout: 20
2022-09-30 14:23:49,948 - MainThread connectionpool.py:456 - _make_request() - DEBUG - https://xxxx.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=c0d80547-2814-440e-9202-4729ea80af81&request_guid=61fa4e57-df77-4ddb-b32b-57fa24a29960 HTTP/1.1" 403 118
2022-09-30 14:23:49,950 - MainThread network.py:1045 - _request_exec() - DEBUG - 000403: 403: HTTP 403: Forbidden. Retrying...
2022-09-30 14:23:49,950 - MainThread network.py:932 - log_and_handle_http_error_with_cause() - ERROR - 000403: 403: HTTP 403: Forbidden
Traceback (most recent call last):
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 837, in _request_exec_wrapper
    return_object = self._request_exec(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1116, in _request_exec
    raise err
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec
    raise RetryRequest(error)
snowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden
2022-09-30 14:23:49,952 - MainThread network.py:1152 - _use_requests_session() - DEBUG - Session status for SessionPool 'xxxx.snowflakecomputing.com', SessionPool 0/1 active sessions
Traceback (most recent call last):
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 837, in _request_exec_wrapper
    return_object = self._request_exec(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1116, in _request_exec
    raise err
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 1047, in _request_exec
    raise RetryRequest(error)
snowflake.connector.network.RetryRequest: 000403: 403: HTTP 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/auth.py", line 257, in authenticate
    ret = self._rest._post_request(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 704, in _post_request
    ret = self.fetch(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 794, in fetch
    ret = self._request_exec_wrapper(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 890, in _request_exec_wrapper
    self.log_and_handle_http_error_with_cause(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/network.py", line 945, in log_and_handle_http_error_with_cause
    Error.errorhandler_wrapper_from_cause(conn, cause)
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/errors.py", line 240, in errorhandler_wrapper_from_cause
    return Error.errorhandler_wrapper(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/errors.py", line 275, in errorhandler_wrapper
    handed_over = Error.hand_to_other_handler(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/errors.py", line 333, in hand_to_other_handler
    connection.errorhandler(connection, cursor, error_class, error_value)
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/errors.py", line 209, in default_errorhandler
    raise error_class(
snowflake.connector.errors.ForbiddenError: 000403: 403: HTTP 403: Forbidden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kotofos/.config/JetBrains/PyCharm2021.2/scratches/scratch_5.py", line 22, in <module>
    con = snowflake.connector.connect(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/__init__.py", line 51, in Connect
    return SnowflakeConnection(**kwargs)
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/connection.py", line 296, in __init__
    self.connect(**kwargs)
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/connection.py", line 549, in connect
    self.__open_connection()
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/connection.py", line 788, in __open_connection
    self._authenticate(auth_instance)
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/connection.py", line 1051, in _authenticate
    self.__authenticate(self.__preprocess_auth_instance(auth_instance))
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/connection.py", line 1071, in __authenticate
    auth.authenticate(
  File "/home/kotofos/Documents/slashdb/snowflake_venv/lib/python3.9/site-packages/snowflake/connector/auth.py", line 266, in authenticate
    raise err.__class__(
snowflake.connector.errors.ForbiddenError: 250001 (08001): None: Failed to connect to DB. Verify the account name is correct: XXXX.snowflakecomputing.com:443. 000403: 403: HTTP 403: Forbidden
2022-09-30 14:23:50,004 - MainThread connection.py:564 - close() - INFO - closed
2022-09-30 14:23:50,004 - MainThread connection.py:580 - close() - DEBUG - Exception encountered in closing connection. ignoring...: 'SnowflakeConnection' object has no attribute '_telemetry'
  1. Notes

Snowflake connector tries to login until timeout when account ID is wrong. Since default login timeout is 120s it takes a while. When account ID has dot in it it fails faster.

X.X -> 10s XXXX -> 120s

The difference is how snowflake backend responds to login request depending on the subdomain.

See https://github.com/snowflakedb/snowflake-connector-python/blob/41d8ef1fcd9bb1692094e29070f4ed832d024e71/src/snowflake/connector/network.py#L1075

curl 'https://ok.id.snowflakecomputing.com:443/session/v1/login-request?request_id=b7806fec-c495-41b8-9ef9-c7a289ecdeff&databaseName=dn&schemaName=sc'

curl: (60) SSL: no alternative certificate subject name matches target host name 'ok.id.snowflakecomputing.com'
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
curl 'https://bad_id.snowflakecomputing.com:443/session/v1/login-request?request_id=b7806fec-c495-41b8-9ef9-c7a289ecdeff&databaseName=dn&schemaName=sc' 

<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>

The example code is straight from the documentation. It keeps going for 120 seconds.

The 403 error is not meant to be retried with the same credentials. Code should fail login immediately. There is login_timeout option which helps, but 403 must fail on the first attempt.

Also, the reported attempts count is wrong.

import snowflake.connector
con = snowflake.connector.connect(
    user='sdbdemo',
    password='J5ARiFDLN2bwNMn',
    account='x.x',
    login_timeout=1,
)

snowflake.connector.errors.OperationalError: 250001: 250001: Could not connect to Snowflake backend after 0 attempt(s).Aborting

Expected something above 0. That is because the counter is reset before printing the exception. See https://github.com/snowflakedb/snowflake-connector-python/blob/41d8ef1fcd9bb1692094e29070f4ed832d024e71/src/snowflake/connector/auth_by_plugin.py#L116

kotofos avatar Sep 30 '22 12:09 kotofos

These seem like something we should fix and don't seem very hard at the first glance. @sfc-gh-mkeller What do you think?

sfc-gh-sfan avatar Sep 30 '22 18:09 sfc-gh-sfan

I just want to highlight that this is still an issue and it is making it difficult to present for the user that credentials are incorrect since there is no way to configure number of authentication retries (defaults to alot) and it's currently crashing with the TypeError already reported above in the telemetry module.

tiwilliam avatar Dec 28 '22 16:12 tiwilliam

We will look at this ticket next week.

sfc-gh-achandrasekaran avatar Mar 30 '23 20:03 sfc-gh-achandrasekaran

This PR is currently under review

sfc-gh-achandrasekaran avatar Apr 25 '23 17:04 sfc-gh-achandrasekaran