Authentication token has expired. The user must authenticate again error

See original GitHub issue

Issue description

When left for a period of time without using it, the snowflake driver seems to throw an “Authentication token has expired. The user must authenticate again” exception the next time you go to use it even on a freshly initialised connection. This goes away when restarting the application. I suspect the currently internal connection pool controls may fix this, but I’m not sure. Is there a way we can re-fetch an Authentication token with the driver currently so a fresh connection is actually a new connection?

Example code

N/A

Error log

If you have an error log, please paste it here.
System.Exception: - Error: Authentication token has expired. The user must authenticate again. SqlState: , VendorCode: 390114, QueryId: - Snowflake.Data.Client.SnowflakeDbException

### Configuration
Version: 2.0.16

Framework Version: Dotnet 6

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

3reactions
ehertleincommented, Sep 18, 2022

Unless I am misunderstanding your issues, these are all from the same root problem in that the connection pooling isn’t implemented correctly. We had similar issue and downgraded to 2.0.13 before connection pooling was introduced.

You can see here that your OpenAsync() is really just pulling from the pool and your CloseAsync() is just releasing connections into the pool.

0reactions
garethreptoncommented, Oct 19, 2022

I haven’t seen this error since updating to this version. Combined with others saying this is fixed for them, I think it’s safe to close right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication token has expired. The user must ...
I am facing the same session issue in my project. Exception - "Error: Authentication token has expired. The user must authenticate again.
Read more >
ERROR: "Authentication token has expired. The user must ...
This issue occurs because the connection remains idle at the Snowflake end before getting timed out. ... 1) For Solution, enter CR with...
Read more >
Solved: Authentication token has expired. The user must a...
Hi,. Replication task is throwing below message but the task is not errored out.If any one have idea please let me know how...
Read more >
Using Snowflake, get "Authentication token has expired. ...
Using Snowflake, get "Authentication token has expired. The user must authenticate again." after idle time Follow. Answered.
Read more >
Snowflake connector fails with error net.snowflake.client. ...
Message : net.snowflake.client.jdbc.SnowflakeReauthenticationRequest: Authentication token has expired. The user must authenticate again.
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