Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1371225: Connector errors out when no config is present #1943

Open
der-eismann opened this issue May 8, 2024 · 3 comments
Open

SNOW-1371225: Connector errors out when no config is present #1943

der-eismann opened this issue May 8, 2024 · 3 comments
Assignees
Labels
need more information Need more information to continue triage/fix/implementation status-triage Issue is under initial triage

Comments

@der-eismann
Copy link

der-eismann commented May 8, 2024

Python version

3.9.18

Operating system and processor architecture

Linux-6.1.77-flatcar-aarch64-with-glibc2.34

Installed packages

asn1crypto==1.5.1
astroid==3.1.0
boto3==1.34.99
botocore==1.34.100
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.3.2
cryptography==42.0.7
dill==0.3.8
filelock==3.14.0
google-api-core==2.19.0
google-api-python-client==2.127.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-auth-oauthlib==1.2.0
googleapis-common-protos==1.63.0
httplib2==0.22.0
idna==3.7
isort==5.13.2
jmespath==1.0.1
mccabe==0.7.0
oauthlib==3.2.2
packaging==24.0
platformdirs==4.2.1
proto-plus==1.23.0
protobuf==4.25.3
psycopg2-binary==2.9.9
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
PyJWT==2.8.0
pylint==3.1.0
pynag==1.1.2
pyOpenSSL==24.1.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.1
requests==2.31.0
requests-oauthlib==2.0.0
rsa==4.9
s3transfer==0.10.1
six==1.16.0
snowflake-connector-python==3.10.0
sortedcontainers==2.4.0
tomli==2.0.1
tomlkit==0.12.4
typing_extensions==4.11.0
uritemplate==4.1.1
urllib3==1.26.18

What did you do?

We use the snowflake connector to run checks via Nagios. It worked fine with v3.8.1 so far, however after upgrading to 3.10.0 we started to see the following error:

(No output on stdout) stderr: Traceback (most recent call last):
File "/usr/lib64/nagios/plugins/check/check.py", line 15, in <module>
ctx = snowflake.connector.connect(
File "/opt/venv/lib64/python3.9/site-packages/snowflake/connector/__init__.py", line 55, in Connect
return SnowflakeConnection(**kwargs)
File "/opt/venv/lib64/python3.9/site-packages/snowflake/connector/connection.py", line 388, in __init__
easy_logging = EasyLoggingConfigPython()
File "/opt/venv/lib64/python3.9/site-packages/snowflake/connector/log_configuration.py", line 24, in __init__
self.parse_config_file()
File "/opt/venv/lib64/python3.9/site-packages/snowflake/connector/log_configuration.py", line 27, in parse_config_file
CONFIG_MANAGER.read_config()
File "/opt/venv/lib64/python3.9/site-packages/snowflake/connector/config_manager.py", line 323, in read_config
if not filep.exists():
File "/usr/lib64/python3.9/pathlib.py", line 1424, in exists
self.stat()
File "/usr/lib64/python3.9/pathlib.py", line 1232, in stat
return self._accessor.stat(self)
PermissionError: [Errno 13] Permission denied: '/root/.config/snowflake/config.toml'

The code at this location looks like this:

config = configparser.ConfigParser()
config.read(os.getenv('SNOWFLAKE_CONFIG'))

ctx = snowflake.connector.connect(
    user=config['snowflake']['username'],
    password=config['snowflake']['password'],
    account='vp12345.eu-west-1'
)

What did you expect to see?

I'd like to see the connector continue working as it was before. It's not mentioned anywhere that the config file is mandatory and it would be great if that error could be catched gracefully.

Can you set logging to DEBUG and collect the logs?

No response

@github-actions github-actions bot changed the title Connector errors out when no config is present SNOW-1371225: Connector errors out when no config is present May 8, 2024
@sfc-gh-sghosh sfc-gh-sghosh self-assigned this May 13, 2024
@sfc-gh-sghosh
Copy link

Hello @der-eismann ,

Thanks for raising the issue; we are checking and will update you.

Regards,
Sujan

@sfc-gh-sghosh
Copy link

Hello @der-eismann ,

You meant that before python connector 3.10.0, there was no need for a config file, and it was connecting fine, but now, with Python Connector 3.10.0, it's asking for a config file?
If yes, could you please capture the Python log with connector 3.8.1 and let us know?

Regards,
Sujan

@sfc-gh-sghosh sfc-gh-sghosh added status-triage_needed This is a new issue, and initial triage is needed and removed bug needs triage labels May 15, 2024
@sfc-gh-sghosh
Copy link

Hello @der-eismann ,

I wanted to check if you had a chance to go through the previous post; if yes, please send us logs and repro or let us know if it's resolved.

Regards,
Sujan

@sfc-gh-dszmolka sfc-gh-dszmolka added status-information_needed Additional information is required from the reporter status-triage Issue is under initial triage and removed status-triage_needed This is a new issue, and initial triage is needed labels May 23, 2024
@sfc-gh-sghosh sfc-gh-sghosh added need more information Need more information to continue triage/fix/implementation and removed status-information_needed Additional information is required from the reporter labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more information Need more information to continue triage/fix/implementation status-triage Issue is under initial triage
Projects
None yet
Development

No branches or pull requests

3 participants