question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authentication Token Expired (390114) - Any solution for snowflake-sqlalchemy?

See original GitHub issue

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using (python --version)? Python 3

  2. What operating system and processor architecture are you using (python -c 'import platform; print(platform.platform())')? Windows2012ServerR2 6.3.9600-SP0

  3. What are the component versions in the environment (pip list)? flask SQLAlchemy snowflake-connector-python

  4. 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()

  1. What did you expect to see? Expected connection to persist

  2. What did you see instead? Authentication Token expired and connection was lost

  3. 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:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
delijaticommented, Nov 19, 2019

Any update on this. Should we do an good old restart server after 3:59

0reactions
eyalyolicommented, Jul 17, 2022

does 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 3.x - Snowflake Authentication Token expired (390114)
I implemented a heartbeat code using APScheduler which fires "Select 1" every 50 mins but if the session is active in the browser...
Read more >
Authentication token has expired. The user must authenticate ...
The error indicates that a session has lived past its 4-hour lifetime with no activity. Snowflake sessions obtain a Master Token that is ......
Read more >
Long runs cause the authentication token to expire - GitLab
snowflake.connector.errors.ProgrammingError: 390114 (08001): Authentication token has expired. The user must authenticate again.
Read more >
Snowflake Authentication Token expires : DBE-12185
From time to time DataGrip will report: [XX000][390114] Authentication token has expired. The user must authenticate again. It would seem that instead of ......
Read more >
Mask data in an xarray and changing values for both True and ...
Snowflake Authentication Token expired (390114) - Is there a heartbeat code for Snowflake-SQLAlchemy? Why do 3 pip modules exist after a virtual environment ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found