Skip to content

SNOW-1641112: Connector throws a user warning about connections.toml CHMOD, even when it will not use that file for connection details #2036

@surpatean

Description

@surpatean

Python version

Python 3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)]

Operating system and processor architecture

Windows-10-10.0.19045-SP0

Installed packages

snowflake-connector-python==3.12.1

What did you do?

I create a connection:

  • without specifying a TOML connection_name= parameter value,
  • and without connections.toml having a [default] connection either.
con = snowflake.connector.connect(
    account=...,
    user=...,
    private_key=...,
    role=...,
    database=...,
    schema=...,
    session_parameters={'QUERY_TAG': job_name})

A user warning is thrown
lib\site-packages\snowflake\connector\config_manager.py:351: UserWarning: Bad owner or permissions on ~\.snowflake\connections.toml

My system does have a connections.toml file (used by the Snowflake VSCode extension)

["tl...1"]
name = "tl...1"
account = "tl...1"
user = "..."
authenticator = "externalbrowser"
password = ""

but no default connection, and this connection is not requested in connection_name=.

What did you expect to see?

If no TOML connection_name is provided, and connection details are provided in-line instead of via a TOML (default) connection, then the connector should not complain about the CHMOD of this file.

Can you set logging to DEBUG and collect the logs?

2024-08-27 12:33:23,534 - MainThread ssl_wrap_socket.py:44 - inject_into_urllib3() - DEBUG - Injecting ssl_wrap_socket_with_ocsp
2024-08-27 12:33:23,534 - MainThread _auth.py:91 - <module>() - DEBUG - cache directory: ~\AppData\Local\Snowflake\Caches
~\AppData\Local\miniconda3\envs\Glue_Python39_Analytics\lib\site-packages\snowflake\connector\config_manager.py:351: UserWarning: Bad owner or permissions on ~\.snowflake\connections.toml
  warn(f"Bad owner or permissions on {str(filep)}{chmod_message}")
2024-08-27 12:33:23,580 - MainThread config_manager.py:352 - read_config() - DEBUG - reading configuration file from ~\.snowflake\connections.toml
2024-08-27 12:33:23,592 - MainThread connection.py:413 - __init__() - INFO - Snowflake Connector for Python Version: 3.12.1, Python Version: 3.9.18, Platform: Windows-10-10.0.19045-SP0
2024-08-27 12:33:23,593 - MainThread connection.py:730 - connect() - DEBUG - connect
2024-08-27 12:33:23,593 - MainThread connection.py:1114 - __config() - DEBUG - __config
2024-08-27 12:33:23,593 - MainThread connection.py:1196 - __config() - INFO - Connecting to GLOBAL Snowflake domain

Metadata

Metadata

Assignees

Labels

enhancementThe issue is a request for improvement or a new featurestatus-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions