Authentication Token Expired (390114) - Any solution for snowflake-sqlalchemy?
See original GitHub issuePlease answer these questions before submitting your issue. Thanks!
-
What version of Python are you using (
python --version
)? Python 3 -
What operating system and processor architecture are you using (
python -c 'import platform; print(platform.platform())'
)? Windows2012ServerR2 6.3.9600-SP0 -
What are the component versions in the environment (
pip list
)? flask SQLAlchemy snowflake-connector-python -
What did you do? If possible, provide a recipe for reproducing the error. A complete runnable program is good.
from sqlalchemy import create_engine engine = create_engine(‘snowflake://<connection-string>’ ) connection = engine.connect() names = connection.execute_query(“select names from employees”)
def sensor(): “”" Function for scheduling purposes. “”" v = cursor.execute(“”“select 1"”") v = v.fetchall() print(v)
sched = BackgroundScheduler(daemon=True) sched.add_job(sensor,‘interval’,minutes=50) sched.start()
-
What did you expect to see? Expected connection to persist
-
What did you see instead? Authentication Token expired and connection was lost
-
Can you set logging to DEBUG and collect the logs?
import logging
import os
for logger_name in ['snowflake.sqlalchemy', 'snowflake.connector', 'botocore']:
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
ch.setFormatter(logging.Formatter('%(asctime)s - %(threadName)s %(filename)s:%(lineno)d - %(funcName)s() - %(levelname)s - %(message)s'))
logger.addHandler(ch)
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Any update on this. Should we do an good old
restart server
after 3:59does
client_session_keep_alive
mean that you get a “forever” token? I don’t like this, is there any option to refresh the token manually?