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

Issue with PyInstaller (macOS) - Won't Return Query

Open phirst opened this issue 5 years ago • 6 comments

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using (python --version)?

3.8.6

  1. What operating system and processor architecture are you using (python -c 'import platform; print(platform.platform())')?

macOS 10.15.7

  1. What are the component versions in the environment (pip freeze)?
altgraph==0.17
asn1crypto==1.4.0
azure-common==1.1.25
azure-core==1.6.0
azure-storage-blob==12.3.2
boto3==1.13.26
botocore==1.16.26
cairocffi==1.2.0
CairoSVG==2.5.2
certifi==2020.12.5
cffi==1.14.5
chardet==3.0.4
colored==1.4.2
cryptography==2.9.2
cssselect2==0.4.1
defusedxml==0.7.1
docutils==0.15.2
Gooey==1.0.5
html5lib==1.1
idna==2.10
isodate==0.6.0
jmespath==0.10.0
kaleido==0.2.1
keyring==21.8.0
macholib==1.14
msrest==0.6.21
numpy==1.20.2
oauthlib==3.1.0
oscrypto==1.2.1
pandas==1.1.4
Pillow==8.2.0
plotly==4.14.3
psutil==5.8.0
py42==1.14.1
pyarrow==3.0.0
pycparser==2.20
pycryptodomex==3.10.1
pyinstaller==4.3
pyinstaller-hooks-contrib==2021.1
PyJWT==1.7.1
pyOpenSSL==19.1.0
Pyphen==0.10.0
PySimpleGUI==4.40.0
python-dateutil==2.8.1
pytz==2020.5
requests==2.23.0
requests-oauthlib==1.3.0
retrying==1.3.3
s3transfer==0.3.3
simplejson==3.17.2
six==1.15.0
snowflake==0.0.3
snowflake-connector-python==2.4.3
tabulate==0.8.9
tinycss2==1.1.0
tqdm==4.60.0
urllib3==1.25.9
WeasyPrint==52.5
webencodings==0.5.1
wxPython==4.1.0
XlsxWriter==1.4.0
  1. What did you do? I've got a basic Snowflake connector that works fine except when using PyInstaller to bundle it.

The connector does open the browser to validate the session (SSO either opens up, or if I'm authenticated it just returns back to Python from the browser).

However, once a query has been opened, it returns snowflake_query(): 3333] Error [ Unknown error ] returning query

def snowflake_connector(action,**kwargs):
    logging.info("[start] snowflake_connector : {}".format(action))
    show_kwargs(kwargs)

    connection = kwargs['connection'] if 'connection' in kwargs else None
    connParams = kwargs['connParams'] if 'connParams' in kwargs else default.settings['snowflake']

    try:

        if action == 'open':
            connection = snowflake.connector.connect(account=connParams['account'],user=default.settings['snowflake']['username'],password=connParams['password'],authenticator=connParams['authenticator'],warehouse=connParams['warehouse'])

        elif action == 'close':
            connection.close()
    except Exception as e:
        logging.info("Error Connecting to Snowflake : {}".format(e))

    logging.info("[end] snowflake_connector : {}".format(action))
    return connection

def snowflake_query(connection,query,**kwargs):

    fetch_type = kwargs['fetch_type'] if 'fetch_type' in kwargs else 'all'
    query_name = kwargs['query_name'] if 'query_name' in kwargs else ''

    logging.info("[start] snowflake_query : {}".format(query_name))
    show_kwargs(kwargs)

    results = None
    cursor = connection.cursor()

    try:
        if fetch_type == 'df':
            results = cursor.execute(query).fetch_pandas_all()
            cursor.close()
        else:
            results = cursor.execute(query).fetchall()
            cursor.close()
        logging.debug("Results : {}".format(results))
    except Exception as e:
        logging.info("Error [ {} ] returning query".format(e))

    logging.info("[  end] snowflake_query")
    return results

The script:

  1. Opens the connection.
  2. Loops through a series of queries.
  3. Closes the connection.

It works fine, except when complied with PyInstaller.

  1. What did you expect to see?

The snowflake connector to just work on the subsequent connections.

  1. What did you see instead?
2021-04-30 17:11:04,353 [ INFO   ] [MyScript: snowflake_connector(): 3293] [start] snowflake_connector : open
2021-04-30 17:11:04,353 [ INFO   ] [          connection:            __init__():  260] Snowflake Connector for Python Version: 2.4.3, Python Version: 3.8.6, Platform: macOS-10.15.7-x86_64-i386-64bit
2021-04-30 17:11:04,354 [ INFO   ] [          connection:            __config():  868] 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.
2021-04-30 17:11:04,354 [ INFO   ] [          connection:            __config():  886] Setting use_openssl_only mode to False
Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
2021-04-30 17:11:05,350 [ ERROR  ] [      ocsp_snowflake:_lazy_read_ca_bundle(): 1396] No cabundle file is found in _MEIPASS
2021-04-30 17:11:09,003 [ INFO   ] [MyScript: snowflake_connector(): 3310] [end] snowflake_connector : open
2021-04-30 17:11:09,006 [ INFO   ] [MyScript:   get_customer_data(): 3140] Customer : ACME Corp
2021-04-30 17:11:09,006 [ INFO   ] [MyScript:load_customer_queries(): 3013] [start] load_customer_queries
2021-04-30 17:11:09,007 [ INFO   ] [MyScript:     snowflake_query(): 3318] [start] snowflake_query : CustomerUIDs
2021-04-30 17:11:09,007 [ INFO   ] [MyScript:         show_kwargs(): 3345] kwargs : {'query_name': 'CustomerUIDs'}
2021-04-30 17:11:09,008 [ INFO   ] [              cursor:             execute():  609] query: [select * from snowflake.warehouse wh...]
2021-04-30 17:11:09,365 [ INFO   ] [              cursor:             execute():  633] query execution done
2021-04-30 17:11:09,365 [ INFO   ] [         json_result:            __next__():  127] fetching data done
2021-04-30 17:11:09,366 [ INFO   ] [MyScript:     snowflake_query(): 3336] [  end] snowflake_query
2021-04-30 17:11:09,374 [ INFO   ] [MyScript:     snowflake_query(): 3318] [start] snowflake_query : AccountInfo
2021-04-30 17:11:09,374 [ INFO   ] [MyScript:         show_kwargs(): 3345] kwargs : {'fetch_type': 'df', 'query_name': 'AccountInfo'}
2021-04-30 17:11:09,374 [ INFO   ] [              cursor:             execute():  609] query: [select * from snowflake.warehouse t wh...]
2021-04-30 17:11:09,702 [ INFO   ] [              cursor:             execute():  633] query execution done
2021-04-30 17:11:09,710 [ INFO   ] [MyScript:     snowflake_query(): 3333] Error [ Unknown error ] returning query

********** Error returning query [ select * from snowflake.warehouse t where ACCOUNT_ID = 'XXXXXXXXXXX'] : Unknown error

2021-04-30 17:11:09,710 [ INFO   ] [MyScript:     snowflake_query(): 3336] [  end] snowflake_query
  1. Can you set logging to DEBUG and collect the logs?
2021-04-30 17:25:12,257 [ INFO   ] [MyScript: snowflake_connector(): 3293] [start] snowflake_connector : open
2021-04-30 17:25:12,257 [ INFO   ] [          connection:            __init__():  260] Snowflake Connector for Python Version: 2.4.3, Python Version: 3.8.6, Platform: macOS-10.15.7-x86_64-i386-64bit
2021-04-30 17:25:12,257 [ DEBUG  ] [          connection:             connect():  486] connect
2021-04-30 17:25:12,257 [ DEBUG  ] [          connection:            __config():  744] __config
2021-04-30 17:25:12,258 [ INFO   ] [          connection:            __config():  868] 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.
2021-04-30 17:25:12,258 [ INFO   ] [          connection:            __config():  886] Setting use_openssl_only mode to False
2021-04-30 17:25:12,258 [ DEBUG  ] [           converter:            __init__():  139] use_numpy: False
2021-04-30 17:25:12,258 [ DEBUG  ] [          connection:   __open_connection():  652] REST API object was created: mycompany.tenant.snowflakecomputing.com:443
2021-04-30 17:25:12,259 [ DEBUG  ] [                auth:_read_temporary_credential():  441] Dependency 'keyring' is not installed, cannot cache id token. You might experience multiple authentication pop ups while using ExternalBrowser Authenticator. To avoid this please install keyring module using the following command : pip install snowflake-connector-python[secure-local-storage]
2021-04-30 17:25:12,259 [ DEBUG  ] [     auth_webbrowser:        authenticate():   89] authenticating by Web Browser
Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
2021-04-30 17:25:12,260 [ DEBUG  ] [     auth_webbrowser:        authenticate():  118] step 1: query GS to obtain SSO url
2021-04-30 17:25:12,260 [ DEBUG  ] [     auth_webbrowser:        _get_sso_url():  327] account=code42, authenticator=EXTERNALBROWSER, [email protected]
2021-04-30 17:25:12,261 [ DEBUG  ] [               retry:            from_int():  230] Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2021-04-30 17:25:12,261 [ DEBUG  ] [               retry:            from_int():  230] Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2021-04-30 17:25:12,261 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
2021-04-30 17:25:12,262 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: 120, retry cnt: 1
2021-04-30 17:25:12,262 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: 9f5e2cb9-0fc6-4d99-b3b5-d30248a8ce27
2021-04-30 17:25:12,262 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
2021-04-30 17:25:12,388 [ DEBUG  ] [      connectionpool:           _new_conn():  939] Starting new HTTPS connection (1): mycompany.tenant.snowflakecomputing.com:443
2021-04-30 17:25:13,508 [ DEBUG  ] [      ocsp_snowflake:     reset_cache_dir():  464] cache directory: /Users/me/Library/Caches/Snowflake
2021-04-30 17:25:13,596 [ DEBUG  ] [     ssl_wrap_socket:ssl_wrap_socket_with_ocsp():   83] OCSP Mode: FAIL_OPEN, OCSP response cache file name: None
2021-04-30 17:25:13,596 [ DEBUG  ] [      ocsp_snowflake:reset_ocsp_response_cache_uri():  506] ocsp_response_cache_uri: file:///Users/me/Library/Caches/Snowflake/ocsp_response_cache.json
2021-04-30 17:25:13,596 [ DEBUG  ] [      ocsp_snowflake:reset_ocsp_response_cache_uri():  507] OCSP_VALIDATION_CACHE size: 0
2021-04-30 17:25:13,596 [ DEBUG  ] [      ocsp_snowflake:reset_ocsp_dynamic_cache_server_url():  289] OCSP response cache server is enabled: http://ocsp.snowflakecomputing.com/ocsp_response_cache.json
2021-04-30 17:25:13,596 [ DEBUG  ] [      ocsp_snowflake:reset_ocsp_dynamic_cache_server_url():  325] OCSP dynamic cache server RETRY URL: None
2021-04-30 17:25:13,601 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-05-12 23:58:59+00:00
2021-04-30 17:25:13,603 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2024-05-12 02:43:45+00:00
2021-04-30 17:25:13,604 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2024-05-12 02:47:38+00:00
2021-04-30 17:25:13,628 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-05-12 23:58:59+00:00
2021-04-30 17:25:13,630 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2025-05-12 23:58:59+00:00
2021-04-30 17:25:13,633 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,634 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 19:58:13+00:00
2021-04-30 17:25:13,635 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,636 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 19:58:13+00:00
2021-04-30 17:25:13,637 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 19:58:13+00:00
2021-04-30 17:25:13,638 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 19:58:13+00:00
2021-04-30 17:25:13,640 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 19:58:13+00:00
2021-04-30 17:25:13,641 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,642 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,643 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 19:58:13+00:00
2021-04-30 17:25:13,644 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,645 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,647 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2022-02-02 20:12:03+00:00
2021-04-30 17:25:13,649 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2021-12-14 07:00:00+00:00
2021-04-30 17:25:13,650 [ DEBUG  ] [      ocsp_snowflake:read_ocsp_response_cache_file():  542] Read OCSP response cache file: /Users/me/Library/Caches/Snowflake/ocsp_response_cache.json, count=148
2021-04-30 17:25:13,650 [ DEBUG  ] [      ocsp_snowflake:            validate(): 1063] validating certificate: mycompany.tenant.snowflakecomputing.com
2021-04-30 17:25:13,651 [ DEBUG  ] [     ocsp_asn1crypto:extract_certificate_chain():  434] # of certificates: 4
2021-04-30 17:25:13,651 [ DEBUG  ] [     ocsp_asn1crypto:extract_certificate_chain():  439] subject: OrderedDict([('common_name', '*.us-east-1.snowflakecomputing.com')]), issuer: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')])
2021-04-30 17:25:13,652 [ DEBUG  ] [     ocsp_asn1crypto:extract_certificate_chain():  439] 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')])
2021-04-30 17:25:13,653 [ DEBUG  ] [     ocsp_asn1crypto:extract_certificate_chain():  439] 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')])
2021-04-30 17:25:13,653 [ DEBUG  ] [     ocsp_asn1crypto:extract_certificate_chain():  439] 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')])
2021-04-30 17:25:13,655 [ ERROR  ] [      ocsp_snowflake:_lazy_read_ca_bundle(): 1396] No cabundle file is found in _MEIPASS
2021-04-30 17:25:13,655 [ DEBUG  ] [     ocsp_asn1crypto:    read_cert_bundle():  122] reading certificate bundle: /var/folders/6_/0h33z_fn7nd9ckr3qt64dfm00000gp/T/_MEIl957rE/certifi/cacert.pem
2021-04-30 17:25:13,667 [ DEBUG  ] [     ocsp_asn1crypto:create_pair_issuer_subject():  460] not found issuer_der: OrderedDict([('country_name', 'US'), ('organization_name', 'Starfield Technologies, Inc.'), ('organizational_unit_name', 'Starfield Class 2 Certification Authority')])
2021-04-30 17:25:13,668 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] hit cache for subject: OrderedDict([('common_name', '*.us-east-1.snowflakecomputing.com')])
2021-04-30 17:25:13,670 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2024-05-12 02:43:45+00:00
2021-04-30 17:25:13,671 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')])
2021-04-30 17:25:13,672 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2024-05-12 02:47:38+00:00
2021-04-30 17:25:13,672 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('common_name', 'Amazon Root CA 1')])
2021-04-30 17:25:13,674 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2021-12-14 07:00:00+00:00
2021-04-30 17:25:13,675 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] 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')])
2021-04-30 17:25:13,676 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] hit cache for subject: OrderedDict([('common_name', '*.us-east-1.snowflakecomputing.com')])
2021-04-30 17:25:13,677 [ DEBUG  ] [      ocsp_snowflake:validate_by_direct_connection(): 1237] using OCSP response cache
2021-04-30 17:25:13,677 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  328] Certificate is NOT attached in Basic OCSP Response. Using issuer's certificate
2021-04-30 17:25:13,677 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  336] Verifying the OCSP response is signed by the issuer.
2021-04-30 17:25:14,064 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2024-05-12 02:43:45+00:00
2021-04-30 17:25:14,064 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('organizational_unit_name', 'Server CA 1B'), ('common_name', 'Amazon')])
2021-04-30 17:25:14,066 [ DEBUG  ] [      ocsp_snowflake:validate_by_direct_connection(): 1237] using OCSP response cache
2021-04-30 17:25:14,067 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  293] Certificate is attached in Basic OCSP Response
2021-04-30 17:25:14,067 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  295] Verifying the attached certificate is signed by the issuer
2021-04-30 17:25:14,067 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  298] Valid Not After: 2024-05-12 02:43:45+00:00
2021-04-30 17:25:14,070 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  336] Verifying the OCSP response is signed by the issuer.
2021-04-30 17:25:14,074 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2024-05-12 02:47:38+00:00
2021-04-30 17:25:14,074 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] hit cache for subject: OrderedDict([('country_name', 'US'), ('organization_name', 'Amazon'), ('common_name', 'Amazon Root CA 1')])
2021-04-30 17:25:14,075 [ DEBUG  ] [      ocsp_snowflake:validate_by_direct_connection(): 1237] using OCSP response cache
2021-04-30 17:25:14,076 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  293] Certificate is attached in Basic OCSP Response
2021-04-30 17:25:14,076 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  295] Verifying the attached certificate is signed by the issuer
2021-04-30 17:25:14,076 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  298] Valid Not After: 2024-05-12 02:47:38+00:00
2021-04-30 17:25:14,078 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  336] Verifying the OCSP response is signed by the issuer.
2021-04-30 17:25:14,082 [ DEBUG  ] [     ocsp_asn1crypto:       is_valid_time():  233] Verifying the attached certificate is signed by the issuer. Valid Not After: 2021-12-14 07:00:00+00:00
2021-04-30 17:25:14,083 [ DEBUG  ] [      ocsp_snowflake:          find_cache():  682] 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')])
2021-04-30 17:25:14,084 [ DEBUG  ] [      ocsp_snowflake:validate_by_direct_connection(): 1237] using OCSP response cache
2021-04-30 17:25:14,085 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  293] Certificate is attached in Basic OCSP Response
2021-04-30 17:25:14,086 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  295] Verifying the attached certificate is signed by the issuer
2021-04-30 17:25:14,086 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  298] Valid Not After: 2021-12-14 07:00:00+00:00
2021-04-30 17:25:14,087 [ DEBUG  ] [     ocsp_asn1crypto:process_ocsp_response():  336] Verifying the OCSP response is signed by the issuer.
2021-04-30 17:25:14,091 [ DEBUG  ] [      ocsp_snowflake:write_ocsp_response_cache_file():  604] writing OCSP response cache file to /Users/me/Library/Caches/Snowflake/ocsp_response_cache.json
2021-04-30 17:25:14,091 [ DEBUG  ] [      ocsp_snowflake:encode_ocsp_response_cache(): 1715] encoding OCSP response cache to JSON
2021-04-30 17:25:14,111 [ DEBUG  ] [      ocsp_snowflake:           _validate(): 1115] ok
2021-04-30 17:25:14,373 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.tenant.snowflakecomputing.com:443 "POST /session/authenticator-request?request_guid=9f5e2cb9-0fc6-4d99-b3b5-d30248a8ce27 HTTP/1.1" 200 935
2021-04-30 17:25:14,375 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
2021-04-30 17:25:14,375 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
2021-04-30 17:25:14,375 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
2021-04-30 17:25:14,376 [ DEBUG  ] [     auth_webbrowser:        authenticate():  123] step 2: open a browser
2021-04-30 17:25:14,765 [ DEBUG  ] [     auth_webbrowser:        authenticate():  136] step 3: accept SAML token
2021-04-30 17:25:17,872 [ DEBUG  ] [     auth_webbrowser:     _get_user_agent():  298] User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
2021-04-30 17:25:17,873 [ DEBUG  ] [                auth:        authenticate():  169] authenticate
2021-04-30 17:25:17,873 [ DEBUG  ] [                auth:        authenticate():  199] assertion content: 7Vlbl[REMOVED FOR BREVITY]iqf_gs=
2021-04-30 17:25:17,874 [ DEBUG  ] [                auth:        authenticate():  202] account=code42, [email protected], database=None, schema=None, warehouse=BIDATA, role=None, request_id=f65eeb9b-0627-4b66-bcff-6fec6fd27164
2021-04-30 17:25:17,874 [ DEBUG  ] [                auth:        authenticate():  235] body['data']: {'CLIENT_APP_ID': 'PythonConnector', 'CLIENT_APP_VERSION': '2.4.3', 'SVN_REVISION': None, 'ACCOUNT_NAME': 'code42', 'LOGIN_NAME': '[email protected]', 'CLIENT_ENVIRONMENT': {'APPLICATION': 'PythonConnector', 'OS': 'Darwin', 'OS_VERSION': 'macOS-10.15.7-x86_64-i386-64bit', 'PYTHON_VERSION': '3.8.6', 'PYTHON_RUNTIME': 'CPython', 'PYTHON_COMPILER': 'Clang 12.0.0 (clang-1200.0.32.29)', 'OCSP_MODE': 'FAIL_OPEN', 'TRACING': 10, 'LOGIN_TIMEOUT': 120, 'NETWORK_TIMEOUT': None}, 'AUTHENTICATOR': 'EXTERNALBROWSER', 'TOKEN': '7Vlbl5[REMOVED FOR BREVITY]f_gs=', 'PROOF_KEY': 'w3g2gtXXXXXXXXXXXXXXXXXXXIVk=_-1_0', 'SESSION_PARAMETERS': {'CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY': 900, 'CLIENT_PREFETCH_THREADS': 4, 'CLIENT_STORE_TEMPORARY_CREDENTIAL': True}}
2021-04-30 17:25:17,875 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
2021-04-30 17:25:17,876 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: 120, retry cnt: 1
2021-04-30 17:25:17,876 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: fdab43f1-f32b-4bee-8fa2-4733e6e97c99
2021-04-30 17:25:17,876 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
2021-04-30 17:25:18,098 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.tenant.snowflakecomputing.com:443 "POST /session/v1/login-request?request_id=f65eeb9b-0627-4b66-bcff-6fec6fd27164&warehouse=BIDATA&request_guid=fdab43f1-f32b-4bee-8fa2-4733e6e97c99 HTTP/1.1" 200 1596
2021-04-30 17:25:18,100 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
2021-04-30 17:25:18,101 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
2021-04-30 17:25:18,101 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
2021-04-30 17:25:18,102 [ DEBUG  ] [                auth:        authenticate():  354] completed authentication
2021-04-30 17:25:18,102 [ DEBUG  ] [                auth:        authenticate():  397] token = ******
2021-04-30 17:25:18,102 [ DEBUG  ] [                auth:        authenticate():  400] master_token = ******
2021-04-30 17:25:18,102 [ DEBUG  ] [                auth:        authenticate():  404] id_token = ******
2021-04-30 17:25:18,103 [ DEBUG  ] [                auth:        authenticate():  408] mfa_token = NULL
2021-04-30 17:25:18,103 [ DEBUG  ] [                auth:_write_temporary_credential():  484] Dependency 'keyring' is not installed, cannot cache id token. You might experience multiple authentication pop ups while using ExternalBrowser Authenticator. To avoid this please install keyring module using the following command : pip install snowflake-connector-python[secure-local-storage]
2021-04-30 17:25:18,103 [ INFO   ] [MyScript: snowflake_connector(): 3310] [end] snowflake_connector : open
2021-04-30 17:25:18,105 [ INFO   ] [MyScript:   get_customer_data(): 3140] Customer : ACME Corp
2021-04-30 17:25:18,106 [ INFO   ] [MyScript:load_customer_queries(): 3013] [start] load_customer_queries
2021-04-30 17:25:18,109 [ INFO   ] [MyScript:     snowflake_query(): 3318] [start] snowflake_query : CustomerUIDs
2021-04-30 17:25:18,109 [ INFO   ] [MyScript:         show_kwargs(): 3345] kwargs : {'query_name': 'CustomerUIDs'}
2021-04-30 17:25:18,109 [ DEBUG  ] [          connection:              cursor():  571] cursor
2021-04-30 17:25:18,110 [ DEBUG  ] [              cursor:             execute():  542] executing SQL/command
2021-04-30 17:25:18,110 [ DEBUG  ] [              cursor:             execute():  572] binding: [select * from SNOWFLAKE.WAREHOUSE wh...] with input=[None], processed=[{}]
2021-04-30 17:25:18,110 [ INFO   ] [              cursor:             execute():  609] query: [select * from SNOWFLAKE.WAREHOUSE wh...]
2021-04-30 17:25:18,110 [ DEBUG  ] [              cursor:     _execute_helper():  357] Cannot use arrow result format, fallback to json format
2021-04-30 17:25:18,110 [ DEBUG  ] [          connection:_next_sequence_counter(): 1170] sequence counter: 1
2021-04-30 17:25:18,111 [ DEBUG  ] [              cursor:     _execute_helper():  376] Request id: 072e941b-b1f8-4887-91a3-dd5ecf4df0cb
2021-04-30 17:25:18,111 [ DEBUG  ] [              cursor:     _execute_helper():  379] running query [select * from SNOWFLAKE.WAREHOUSE wh...]
2021-04-30 17:25:18,111 [ DEBUG  ] [              cursor:     _execute_helper():  388] is_file_transfer: False
2021-04-30 17:25:18,111 [ DEBUG  ] [          connection:           cmd_query():  912] _cmd_query
2021-04-30 17:25:18,111 [ DEBUG  ] [          connection:           cmd_query():  933] sql=[select * from SNOWFLAKE.WAREHOUSE wh...], sequence_id=[1], is_file_transfer=[False]
2021-04-30 17:25:18,112 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
2021-04-30 17:25:18,112 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: None, retry cnt: 1
2021-04-30 17:25:18,112 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: 6a643bd9-cdd5-4ae3-bc8b-c52fe9d5e9b8
2021-04-30 17:25:18,112 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
2021-04-30 17:25:18,344 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.tenant.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=072e941b-b1f8-4887-91a3-dd5ecf4df0cb&request_guid=6a643bd9-cdd5-4ae3-bc8b-c52fe9d5e9b8 HTTP/1.1" 200 1127
2021-04-30 17:25:18,345 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
2021-04-30 17:25:18,346 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
2021-04-30 17:25:18,346 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
2021-04-30 17:25:18,346 [ DEBUG  ] [             network:       _post_request():  664] Query id: 019bf15d-0601-f64d-0000-25210954c14a
2021-04-30 17:25:18,347 [ DEBUG  ] [              cursor:             execute():  631] sfqid: 019bf15d-0601-f64d-0000-25210954c14a
2021-04-30 17:25:18,347 [ INFO   ] [              cursor:             execute():  633] query execution done
2021-04-30 17:25:18,347 [ DEBUG  ] [              cursor:             execute():  635] SUCCESS
2021-04-30 17:25:18,347 [ DEBUG  ] [              cursor:             execute():  638] PUT OR GET: None
2021-04-30 17:25:18,347 [ DEBUG  ] [              cursor:_init_result_and_meta():  719] Query result format: json
2021-04-30 17:25:18,348 [ INFO   ] [         json_result:            __next__():  127] fetching data done
2021-04-30 17:25:18,348 [ DEBUG  ] [MyScript:     snowflake_query(): 3331] Results :/n[(####, '##################', 'abcdabcdabcdabcd', '1a2b3c4-5e6f-7890-1a2b-ababab')]
2021-04-30 17:25:18,348 [ INFO   ] [MyScript:     snowflake_query(): 3336] [  end] snowflake_query

2021-04-30 17:25:18,357 [ INFO   ] [MyScript:     snowflake_query(): 3318] [start] snowflake_query : AccountInfo
2021-04-30 17:25:18,357 [ INFO   ] [MyScript:         show_kwargs(): 3345] kwargs : {'fetch_type': 'df', 'query_name': 'AccountInfo'}
2021-04-30 17:25:18,357 [ DEBUG  ] [          connection:              cursor():  571] cursor
2021-04-30 17:25:18,357 [ DEBUG  ] [              cursor:             execute():  542] executing SQL/command
2021-04-30 17:25:18,357 [ DEBUG  ] [              cursor:             execute():  572] binding: [select * from SNOWFLAKE.WAREHOUSE t where ACCOUNT_ID = '0018...] with input=[None], processed=[{}]
2021-04-30 17:25:18,358 [ INFO   ] [              cursor:             execute():  609] query: [select * from SNOWFLAKE.WAREHOUSE t where ACCOUNT_ID = '0018...]
2021-04-30 17:25:18,358 [ DEBUG  ] [              cursor:     _execute_helper():  357] Cannot use arrow result format, fallback to json format
2021-04-30 17:25:18,358 [ DEBUG  ] [          connection:_next_sequence_counter(): 1170] sequence counter: 2
2021-04-30 17:25:18,358 [ DEBUG  ] [              cursor:     _execute_helper():  376] Request id: debdfd7d-6009-40bc-9d59-df24f9756b98
2021-04-30 17:25:18,358 [ DEBUG  ] [              cursor:     _execute_helper():  379] running query [select * from SNOWFLAKE.WAREHOUSE t where ACCOUNT_ID = '0018...]
2021-04-30 17:25:18,358 [ DEBUG  ] [              cursor:     _execute_helper():  388] is_file_transfer: False
2021-04-30 17:25:18,359 [ DEBUG  ] [          connection:           cmd_query():  912] _cmd_query
2021-04-30 17:25:18,359 [ DEBUG  ] [          connection:           cmd_query():  933] sql=[select * from SNOWFLAKE.WAREHOUSE t where ACCOUNT_ID = '0018...], sequence_id=[2], is_file_transfer=[False]
2021-04-30 17:25:18,359 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
2021-04-30 17:25:18,359 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: None, retry cnt: 1
2021-04-30 17:25:18,359 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: 9cd4ddcd-d6f3-4aec-a991-6b816875cabb
2021-04-30 17:25:18,359 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
2021-04-30 17:25:18,531 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.tenant.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=debdfd7d-6009-40bc-9d59-df24f9756b98&request_guid=9cd4ddcd-d6f3-4aec-a991-6b816875cabb HTTP/1.1" 200 3458
2021-04-30 17:25:18,532 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
2021-04-30 17:25:18,534 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
2021-04-30 17:25:18,534 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
2021-04-30 17:25:18,534 [ DEBUG  ] [             network:       _post_request():  664] Query id: 019bf15d-0602-050a-0000-25210954bfda
2021-04-30 17:25:18,534 [ DEBUG  ] [              cursor:             execute():  631] sfqid: 019bf15d-0602-050a-0000-25210954bfda
2021-04-30 17:25:18,535 [ INFO   ] [              cursor:             execute():  633] query execution done
2021-04-30 17:25:18,535 [ DEBUG  ] [              cursor:             execute():  635] SUCCESS
2021-04-30 17:25:18,535 [ DEBUG  ] [              cursor:             execute():  638] PUT OR GET: None
2021-04-30 17:25:18,535 [ DEBUG  ] [              cursor:_init_result_and_meta():  719] Query result format: json
2021-04-30 17:25:18,545 [ INFO   ] [MyScript:     snowflake_query(): 3333] Error [ Unknown error ] returning query
2021-04-30 17:25:18,546 [ INFO   ] [MyScript:     snowflake_query(): 3336] [  end] snowflake_query
2021-04-30 17:25:18,603 [ INFO   ] [          connection:               close():  506] closed
2021-04-30 17:25:18,603 [ DEBUG  ] [           telemetry:               close():  134] Closing telemetry client.
2021-04-30 17:25:18,603 [ INFO   ] [          connection:               close():  509] No async queries seem to be running, deleting session
2021-04-30 17:25:18,604 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
2021-04-30 17:25:18,604 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: 5, retry cnt: 1
2021-04-30 17:25:18,604 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: d30176c9-e3b4-4dbd-9487-d16c441250cb
2021-04-30 17:25:18,604 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
2021-04-30 17:25:18,713 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.tenant.snowflakecomputing.com:443 "POST /session?delete=true&request_guid=d30176c9-e3b4-4dbd-9487-d16c441250cb HTTP/1.1" 200 76
2021-04-30 17:25:18,714 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
2021-04-30 17:25:18,715 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
2021-04-30 17:25:18,715 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
2021-04-30 17:25:18,719 [ DEBUG  ] [          connection:               close():  520] Session is closed

phirst avatar Apr 30 '21 23:04 phirst

Updated Debug Log:

2021-07-29 09:12:18,322 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3965] [start] snowflake_query : AccountInfo
07-29 09:12 [ INFO   ] [CustomerSuccessReport:         show_kwargs(): 3995] kwargs : {'fetch_type': 'df', 'query_name': 'AccountInfo'}
2021-07-29 09:12:18,322 [ INFO   ] [CustomerSuccessReport:         show_kwargs(): 3995] kwargs : {'fetch_type': 'df', 'query_name': 'AccountInfo'}
07-29 09:12 [ DEBUG  ] [          connection:              cursor():  571] cursor
2021-07-29 09:12:18,322 [ DEBUG  ] [          connection:              cursor():  571] cursor
07-29 09:12 [ DEBUG  ] [              cursor:             execute():  542] executing SQL/command
2021-07-29 09:12:18,322 [ DEBUG  ] [              cursor:             execute():  542] executing SQL/command
07-29 09:12 [ DEBUG  ] [              cursor:             execute():  572] binding: [select * from account.info.table t where ACCOUNT_ID = '1234...] with input=[None], processed=[{}]
2021-07-29 09:12:18,323 [ DEBUG  ] [              cursor:             execute():  572] binding: [select * from account.info.table t where ACCOUNT_ID = '1234...] with input=[None], processed=[{}]
07-29 09:12 [ INFO   ] [              cursor:             execute():  609] query: [select * from account.info.table t where ACCOUNT_ID = '1234...]
2021-07-29 09:12:18,323 [ INFO   ] [              cursor:             execute():  609] query: [select * from account.info.table t where ACCOUNT_ID = '1234...]
07-29 09:12 [ DEBUG  ] [              cursor:     _execute_helper():  357] Cannot use arrow result format, fallback to json format
2021-07-29 09:12:18,323 [ DEBUG  ] [              cursor:     _execute_helper():  357] Cannot use arrow result format, fallback to json format
07-29 09:12 [ DEBUG  ] [          connection:_next_sequence_counter(): 1170] sequence counter: 2
2021-07-29 09:12:18,323 [ DEBUG  ] [          connection:_next_sequence_counter(): 1170] sequence counter: 2
07-29 09:12 [ DEBUG  ] [              cursor:     _execute_helper():  376] Request id: 123a6979-b421-42c4-a6fb-4b99a73791b1
2021-07-29 09:12:18,323 [ DEBUG  ] [              cursor:     _execute_helper():  376] Request id: 123a6979-b421-42c4-a6fb-4b99a73791b1
07-29 09:12 [ DEBUG  ] [              cursor:     _execute_helper():  379] running query [select * from account.info.table t where ACCOUNT_ID = '1234...]
2021-07-29 09:12:18,323 [ DEBUG  ] [              cursor:     _execute_helper():  379] running query [select * from account.info.table t where ACCOUNT_ID = '1234...]
07-29 09:12 [ DEBUG  ] [              cursor:     _execute_helper():  388] is_file_transfer: False
2021-07-29 09:12:18,323 [ DEBUG  ] [              cursor:     _execute_helper():  388] is_file_transfer: False
07-29 09:12 [ DEBUG  ] [          connection:           cmd_query():  912] _cmd_query
2021-07-29 09:12:18,323 [ DEBUG  ] [          connection:           cmd_query():  912] _cmd_query
07-29 09:12 [ DEBUG  ] [          connection:           cmd_query():  933] sql=[select * from account.info.table t where ACCOUNT_ID = '1234...], sequence_id=[2], is_file_transfer=[False]
2021-07-29 09:12:18,323 [ DEBUG  ] [          connection:           cmd_query():  933] sql=[select * from account.info.table t where ACCOUNT_ID = '1234...], sequence_id=[2], is_file_transfer=[False]
07-29 09:12 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
2021-07-29 09:12:18,324 [ DEBUG  ] [             network:_use_requests_session(): 1077] Active requests sessions: 1, idle: 0
07-29 09:12 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: None, retry cnt: 1
2021-07-29 09:12:18,324 [ DEBUG  ] [             network:_request_exec_wrapper():  752] remaining request timeout: None, retry cnt: 1
07-29 09:12 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: bc539db6-1f15-4e82-83d0-254cd3ab4496
2021-07-29 09:12:18,324 [ DEBUG  ] [             network:    add_request_guid():  733] Request guid: bc539db6-1f15-4e82-83d0-254cd3ab4496
07-29 09:12 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
2021-07-29 09:12:18,324 [ DEBUG  ] [             network:       _request_exec():  911] socket timeout: 60
07-29 09:12 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.us-east-1.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=123a6979-b421-42c4-a6fb-4b99a73791b1&request_guid=bc539db6-1f15-4e82-83d0-254cd3ab4496 HTTP/1.1" 200 3255
2021-07-29 09:12:18,567 [ DEBUG  ] [      connectionpool:       _make_request():  433] https://mycompany.us-east-1.snowflakecomputing.com:443 "POST /queries/v1/query-request?requestId=123a6979-b421-42c4-a6fb-4b99a73791b1&request_guid=bc539db6-1f15-4e82-83d0-254cd3ab4496 HTTP/1.1" 200 3255
07-29 09:12 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
2021-07-29 09:12:18,569 [ DEBUG  ] [             network:       _request_exec():  940] SUCCESS
07-29 09:12 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
2021-07-29 09:12:18,570 [ DEBUG  ] [             network:_use_requests_session(): 1093] Active requests sessions: 0, idle: 1
07-29 09:12 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
2021-07-29 09:12:18,570 [ DEBUG  ] [             network:       _post_request():  640] ret[code] = None, after post request
07-29 09:12 [ DEBUG  ] [             network:       _post_request():  664] Query id: 019de9b0-0602-cd30-0000-25210a4bcfba
2021-07-29 09:12:18,570 [ DEBUG  ] [             network:       _post_request():  664] Query id: 019de9b0-0602-cd30-0000-25210a4bcfba
07-29 09:12 [ DEBUG  ] [              cursor:             execute():  631] sfqid: 019de9b0-0602-cd30-0000-25210a4bcfba
2021-07-29 09:12:18,571 [ DEBUG  ] [              cursor:             execute():  631] sfqid: 019de9b0-0602-cd30-0000-25210a4bcfba
07-29 09:12 [ INFO   ] [              cursor:             execute():  633] query execution done
2021-07-29 09:12:18,571 [ INFO   ] [              cursor:             execute():  633] query execution done
07-29 09:12 [ DEBUG  ] [              cursor:             execute():  635] SUCCESS
2021-07-29 09:12:18,571 [ DEBUG  ] [              cursor:             execute():  635] SUCCESS
07-29 09:12 [ DEBUG  ] [              cursor:             execute():  638] PUT OR GET: None
2021-07-29 09:12:18,571 [ DEBUG  ] [              cursor:             execute():  638] PUT OR GET: None
07-29 09:12 [ DEBUG  ] [              cursor:_init_result_and_meta():  719] Query result format: json
2021-07-29 09:12:18,571 [ DEBUG  ] [              cursor:_init_result_and_meta():  719] Query result format: json
07-29 09:12 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3980] Error [ Unknown error ] returning query
2021-07-29 09:12:18,576 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3980] Error [ Unknown error ] returning query
07-29 09:12 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3981] Snowflake Error : []
2021-07-29 09:12:18,576 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3981] Snowflake Error : []
07-29 09:12 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3986] [  end] snowflake_query
2021-07-29 09:12:18,577 [ INFO   ] [CustomerSuccessReport:     snowflake_query(): 3986] [  end] snowflake_query

Feels like an issue with PyArrow due to the 2021-07-29 09:12:18,323 [ DEBUG ] [ cursor: _execute_helper(): 357] Cannot use arrow result format, fallback to json format log line.

phirst avatar Jul 29 '21 15:07 phirst

Same issue with trying a Windows build.

phirst avatar Jul 29 '21 16:07 phirst

07-30 09:51 [ ERROR  ] [      ocsp_snowflake:_lazy_read_ca_bundle(): 1396] No cabundle file is found in _MEIPASS
2021-07-30 09:51:41,782 [ ERROR  ] [      ocsp_snowflake:_lazy_read_ca_bundle(): 1396] No cabundle file is found in _MEIPASS

phirst avatar Jul 30 '21 15:07 phirst

Looks like I can fix it with a modification to the .spec file.

assetFiles.extend([
("/<path-to-python>/site-packages/snowflake","snowflake")
])

datas = assetFiles
datas.append(copy_metadata('snowflake-connector-python')[0])

(modify as necessary for each OS)

It still looks like the hooks file needs to be updated by Snowflake, but it's working for now for me.

phirst avatar Aug 12 '21 13:08 phirst

Create the following file named "hook-snowflake.py" in your root folder

# hook-snowflake.py
# snow_logging is mandatory to get arrow working

hiddenimports = ["snowflake.connector.snow_logging"]

when you generate your exe, just add --additional-hooks-dir . to take the hook file in account.

example: pyinstaller --additional-hooks-dir . --noconfirm --onefile main.py

lilian-arnaud avatar Jan 03 '23 09:01 lilian-arnaud