SnowSQL fails with "The library Security could not be found" after upgrading to mac Big Sur
Asked Answered
K

5

5

After upgrading to macOS Big Sur my snowsql scripts all fail with "The Library Security could not be found"

$ snowsql -q "select 1 x"
User: me
Password: XXX
The library Security could not be found
If the error message is unclear, enable logging using -o log_level=DEBUG and see the log to find out the cause. Contact support for further help.
Goodbye!

This reminds me of an issue I ran into with the snowflake-connector-python library involving oscrypto library being used instead of openssl when I upgraded to macOS Catalina several months ago, the issue is documented here: https://github.com/snowflakedb/snowflake-connector-python/issues/235

When I first saw the issue today I was running an earlier version of SnowSQL (1.1.something) then I upgraded to 1.2.9 and got the same error. I tried adding the "-o log_level=DEBUG" to the SnowSQL command line but it didn't output any additional information.

Kristykristyn answered 25/11, 2020 at 20:29 Comment(0)
P
3

Could you try the following steps?

Pardoner answered 25/11, 2020 at 20:39 Comment(3)
I have the same issue with DBT connecting to Snowflake and I cant find a solution. Any ideas?Seawards
@Cristian I had the same problem. My python version is updated to 3.9 after installing Big Sur. Unfortunately dbt-snowflake does not work with python 3.9 yet. github.com/snowflakedb/snowflake-connector-python/issues/562 I am using dbt with python 3.8 without any problems on Big Sur.Reform
@Cristian Linking back to this issue - I had success with requiring oscrypto==1.2.1Mayle
V
5

I was running into the same thing and the only help I can find was this thread and a few unanswered github issues.

For me, I'm using SQLAlchemy to connect to Snowflake. Worked just fine until I upgraded to Big Sur.

After digging through the code, it looks like things were stemming from oscrypto 1.20 for me. It was specifically calling our the _security_cffi.py and around line 239, they were doing something like this:

Security = find_library('Security')

I went to their page and saw that there was a new version 1.21

After downloading it, the code changed to this:

security_path = '/System/Library/Frameworks/Security.framework/Security'

Security = ffi.dlopen(security_path)

Now I'm able to run my queries against snowflake without issue.

Vittle answered 4/12, 2020 at 21:20 Comment(1)
Specifically, pip install --upgrade oscrypto worked for me.Imparipinnate
P
3

Could you try the following steps?

Pardoner answered 25/11, 2020 at 20:39 Comment(3)
I have the same issue with DBT connecting to Snowflake and I cant find a solution. Any ideas?Seawards
@Cristian I had the same problem. My python version is updated to 3.9 after installing Big Sur. Unfortunately dbt-snowflake does not work with python 3.9 yet. github.com/snowflakedb/snowflake-connector-python/issues/562 I am using dbt with python 3.8 without any problems on Big Sur.Reform
@Cristian Linking back to this issue - I had success with requiring oscrypto==1.2.1Mayle
M
3

After reading @mwlilson 's answer I tried the following and it seems to have worked. For me the error was arising when I tried to use the dropbox python module.

# Solution
pip uninstall oscrypto
pip install oscrypto
Micrography answered 9/2, 2021 at 12:21 Comment(2)
I don't think duplicating an existing answer does anyone any good.Vittle
this is a nice tl;dr answerWales
D
3

For me oscrypto==1.2.0 worked on macOS Big Sur 11.5.1

  1. Like @Gokhan Atil's answer, I installed the latest version of SnowSQL
  2. pip uninstall oscrypto
  3. pip install oscrypto==1.2.1
Dandle answered 30/7, 2021 at 9:47 Comment(0)
W
0

This is what fixed it on mine.

  1. Download the latest snowsql installation from the snowflake website. snowflake downloads
  1. Run installation

  2. Verify the file $HOME/.snowsql/config contains your database connection settings.

  3. Write the config file to disk even if you made no changes.

After installation, I continued to see the same error until I re-saved the same config file. Perhaps there is a library cache for snowsql that does not refresh until it notices changes in the config? That fixed the problem. (Not sure if the re-installation was absolutely necessary, but it's working now).

Weight answered 18/3, 2022 at 18:6 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.