Qlik Community

Qlik Replicate

Discussion board for collaboration on Qlik Replicate.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
Sashidhar
Contributor
Contributor

Authentication token has expired. The user must authenticate again.

Hi,

Replication task is throwing below message but the task is not errored out.If any one have idea please let me know  how to correct this?

Error Code: 1022502
Error details: Failed to start bulk apply transaction Failed to execute bulk update statement.
RetCode: SQL_ERROR SqlState: 25000 NativeError: 11120 Message: [Snowflake][ODBC] (11120) Outstanding transactions during disconnect.
RetCode: SQL_ERROR SqlState: 08001 NativeError: 390114 Message: Authentication token has expired. The user must authenticate again.

Sashidhar

Labels (1)
1 Solution

Accepted Solutions
john_wang
Support
Support

Hello @Sashidhar ,

In general this message means the snowflake connection expired due to inactivity. By default, the connection lasts 4 hours. From other support ticket I'd like to suggest:

1- Add the below value to the ODBC connection string for the snowflake target endpoint

CLIENT_SESSION_KEEP_ALIVE=true;ABORT_DETACHED_QUERY=true;CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY=900;

 

2- Add following registry keys on the Replication Server

HKEY_LOCAL_MACHINE/SOFTWARE/Snowflake/Driver/CLIENT_SESSION_KEEP_ALIVE
HKEY_LOCAL_MACHINE/SOFTWARE/Snowflake/Driver/CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY
HKEY_LOCAL_MACHINE/SOFTWARE/Snowflake/Driver/ABORT_DETACHED_QUERY

Values are true, 900 and true respectively

 

3- And did the following to the user

alter user user_name set CLIENT_SESSION_KEEP_ALIVE = TRUE;
alter user user_name set ABORT_DETACHED_QUERY = TRUE;
alter user user_name set CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY = 900;

 

Some links for your reference:

https://docs.snowflake.net/manuals/sql-reference/parameters.html#client-session-keep-alive
https://docs.snowflake.net/manuals/user-guide/odbc-parameters.html#connection-parameters

Hope this helps.

Regards,

John.

View solution in original post

2 Replies
john_wang
Support
Support

Hello @Sashidhar ,

In general this message means the snowflake connection expired due to inactivity. By default, the connection lasts 4 hours. From other support ticket I'd like to suggest:

1- Add the below value to the ODBC connection string for the snowflake target endpoint

CLIENT_SESSION_KEEP_ALIVE=true;ABORT_DETACHED_QUERY=true;CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY=900;

 

2- Add following registry keys on the Replication Server

HKEY_LOCAL_MACHINE/SOFTWARE/Snowflake/Driver/CLIENT_SESSION_KEEP_ALIVE
HKEY_LOCAL_MACHINE/SOFTWARE/Snowflake/Driver/CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY
HKEY_LOCAL_MACHINE/SOFTWARE/Snowflake/Driver/ABORT_DETACHED_QUERY

Values are true, 900 and true respectively

 

3- And did the following to the user

alter user user_name set CLIENT_SESSION_KEEP_ALIVE = TRUE;
alter user user_name set ABORT_DETACHED_QUERY = TRUE;
alter user user_name set CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY = 900;

 

Some links for your reference:

https://docs.snowflake.net/manuals/sql-reference/parameters.html#client-session-keep-alive
https://docs.snowflake.net/manuals/user-guide/odbc-parameters.html#connection-parameters

Hope this helps.

Regards,

John.

View solution in original post

Hrishikesh
Contributor III
Contributor III

Shouldn't Replicate do this setting at each session level through the ODBC driver?

Recently I have noticed the same issue in Qlik Compose too.

Previously we were told to set: 

CLIENT_SESSION_KEEP_ALIVE=false;