In my python code, I am using pyodbc to connect to my sql server. all the sql settings are correct, and I can run my code in a linux terminal using
python main.py
The issue is that when I run the same file inside tmux, I get errors about connecting to the database. specifically:
sqlalchemy.exc.DBAPIError: (pyodbc.Error) ('HY000', "[HY000] [unixODBC][Microsoft][ODBC Driver 11 for SQL Server]SSPI Provider: Credentials cache file '/tmp/[somefilename]' not found (851968) (SQLDriverConnect)")
Any idea what may cause this and how to diagnose and fix this?
I solved it by copying one of the cache files that the bash generates with the name that tmux was looking for! for some reason, tmux was looking for a non existing file. I am still not sure why, but it solves my issue at least temporary! I would appreciate it if someone brings a more concrete answer.