Snowflake-Labs / django-snowflake

MIT License
59 stars 15 forks source link

Erroneously Looking for Config.toml File when using DATABASES dictionary in settings.py #98

Closed dnich02f closed 2 weeks ago

dnich02f commented 1 month ago

I have been using django-snowflake for awhile and just encountered this error when making a call to the Snowflake backend, per READMe instructions.

{"status": "error", "message": "[Errno 13] Permission denied: '/root/.config/snowflake/config.toml'"}

It is my understanding that since I am referencing all of my environment variables from the DATABASES dictionary (using os.getenv), that the config.toml is not necessary. So I was confused as to why all of a sudden this was file was being searched for. And to be clear, it's not just that Permission denied, it is that the file and directory did not exist at all.

How I fixed the issue: I added snowfalke-connector-python==3.8.1 to my requirements.txt file before django-snowflake==4.2.*

Why? I found this in the dist-info/METADATA for snowflake-connector-python 3.10.1:

  • v3.9.0(April 20,2024)

    • Added easy logging configuration so that users can easily generate log file by setup log config in $SNOWFLAKE_HOME/config.toml.
    • Improved s3 acceleration logic when connecting to China endpoint.

I'm not sure if this is something that django-snowflake contributors want to address, or if it just might be useful for someone searching for solutions to find this.

dnich02f commented 1 month ago

If I need to post this in snowflake-connector-python issues, please let me know.

timgraham commented 1 month ago

This looks like a snowflake-connector-python issue to me (a behavior change in 3.9.0). I don't see what django-snowflake would do about it.