You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observing that lettuce client fails to process commands successfully after 3-4 days of successful deployments and working.
The current client options are
We see the above error and after that all the requests are rejected. Is there some issue in the configuration settings? The process we follow for creating a connection with AWS ElastiCache is as follows,
Assume a role that provides with SessionToken
Pass that to a Class that extends RedisCredentialsProvider which resolvesCredentials (public Mono resolveCredentials())
Input Code
Input Code
// your code here;
Expected behavior/code
The reconnection should happen
Environment
Lettuce version(s): 6.5.1.RELEASE
Redis version: 7.1.0
Questions
What is the correct ClientOptions to use in production to allow re-connect. Is it advised to have all three together?
.autoReconnect(true))
.suspendReconnectOnProtocolFailure(true)
.disconnectedBehavior(ClientOptions.DisconnectedBehavior.REJECT_COMMANDS)
Based on the above settings, reconnect is suspended. how should we recover from this?
Restarting the deployment fixed the issue. However we cannot restart the deployment everytime. Please do provide if any documentation that explains the best practices to connect when using AWS ElastiCache
The text was updated successfully, but these errors were encountered:
I do not see something obviously wrong with your set up, from the code samples you have provided.
When reconnecting the driver would attempt to fetch new credentials from the redisCredentialsProviderFactory.
It seems that these new credentials could not be verified by the server and it is returning
WRONGPASS invalid username-password pair or user is disabled.
Have you tried logging the credentials used and trying them out manually with some other client such as redis-cli?
What is the correct ClientOptions to use in production to allow re-connect. Is it advised to have all three together?
.autoReconnect(true))
.suspendReconnectOnProtocolFailure(true)
.disconnectedBehavior(ClientOptions.DisconnectedBehavior.REJECT_COMMANDS)
AWS maintains the Amazon ElasiCache so perhaps this question is best suited for them.
Here is their documentation on the subject
Based on the above settings, reconnect is suspended. how should we recover from this?
Reconnect is suspended because the credentials used are wrong.
The driver assumes this is not recoverable so it stops any additional attempts.
I think the proper solutions is to never pass credentials that are wrong in the first place.
Otherwise you can do some manual retry attempt if you listen for such exceptions and reset the connection, but I am not sure this is a valid use case.
Restarting the deployment fixed the issue. However we cannot restart the deployment everytime. Please do provide if any documentation that explains the best practices to connect when using AWS ElastiCache
Restarting is definitely not a solution, but it is a clue to what is wrong - seems like the credentials after restart are different than the ones provided during reconnect. You need to investigate why.
Bug Report
Observing that lettuce client fails to process commands successfully after 3-4 days of successful deployments and working.
The current client options are
Current Behavior
Stack trace
We see the above error and after that all the requests are rejected. Is there some issue in the configuration settings? The process we follow for creating a connection with AWS ElastiCache is as follows,
Input Code
Input Code
// your code here;
Expected behavior/code
The reconnection should happen
Environment
Questions
What is the correct ClientOptions to use in production to allow re-connect. Is it advised to have all three together?
.autoReconnect(true))
.suspendReconnectOnProtocolFailure(true)
.disconnectedBehavior(ClientOptions.DisconnectedBehavior.REJECT_COMMANDS)
Based on the above settings, reconnect is suspended. how should we recover from this?
Restarting the deployment fixed the issue. However we cannot restart the deployment everytime. Please do provide if any documentation that explains the best practices to connect when using AWS ElastiCache
The text was updated successfully, but these errors were encountered: