Issue where "server not found" but is there OR extra "classTag::" in Key?
See original GitHub issueI think this might just be a case of me not setting things up correctly and therefore I want to say at the outset that once this is cleared up I’m more than happy to open a PR adding to the documentation.
My setup
play-redis 2.6.1 Play 2.8.1 Scala 2.13.2
Issue
When my play application loads I see
[info] p.a.cache.redis - Redis cluster cache actor started. It is connected to localhost:7002
[info] r.a.RedisClientActor - Connect to /127.0.0.1:7002
[info] r.a.RedisClientActor - Connected to localhost/127.0.0.1:7002
[info] p.a.c.r.c.RedisCommandsCluster$$anon$2 - refreshClusterSlots: Map(ClusterSlot(10923,16383,ClusterNode(127.0.0.1,7002,6a99c1396c144fdfa3f70966f3094b8f5b8a925c),List(ClusterNode(127.0.0.1,7004,4b91647a852298dadf957121786cc05819e0c8aa))) -> RedisConnection(Actor[akka://application/user/RedisClientPool-$b#-1366800206],scala.concurrent.stm.ccstm.CCSTMRefs$BooleanRef@674ecd2b))
which makes me think that all is well.
But then when running the application, I see a few errors, the first of which is:
[error] p.a.cache.redis - Command GET for key 'classTag::eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.ff7q3dXyyvZ7_7s2SJcGByhjrIZVWhjySYNvXipkYC95YHnr-bb1xzL_Hjs2-5BPf2l62XTNviyOvwivNsiVAXcewiN1FFzz7chQZKqz6DJAmApfU-djvgh1t5njRSa0YhPidBeLLxXCzfCUfcxZlHhhtRwUwzQuOAGDb4M_9kE._epRtJX8x0rUFaB9.tc5gaIhtXB4wqR9mk-jeezr5-nyNwj3qlObYe_RL0UzzA4HWWHn2aB0zh44Vk5TUdM736anZBeeES4MocyHToBmvm3qFuv5L6XvEro87eyApJzEXE10_dO_V2yflv166WDqpzD3z9fJHidPgiD1uWPcDj00r_202g3nA21h0s3Ebyxaw_Ds7alY66wzVCwUibiyTqViDAj--NMCnd3x485m2ECNOMerD3sCo27EigALRNnn6L8BwWcYVT1uMT76UYoxN8Loi7XWD-LG43kuT.0vQFTbhbPyrmbKZvEbAPCA' failed.
java.lang.RuntimeException: server not found: no server available
at redis.RedisCluster.$anonfun$send$2(RedisCluster.scala:159)
at scala.Option.getOrElse(Option.scala:201)
at redis.RedisCluster.send(RedisCluster.scala:159)
at play.api.cache.redis.connector.RedisCommandsCluster$$anon$2.play$api$cache$redis$connector$RedisRequestTimeout$$super$send(RedisCommands.scala:106)
at play.api.cache.redis.connector.RedisRequestTimeout.continue$2(RequestTimeout.scala:74)
at play.api.cache.redis.connector.RedisRequestTimeout.$anonfun$send$4(RequestTimeout.scala:76)
at scala.Option.fold(Option.scala:263)
at play.api.cache.redis.connector.RedisRequestTimeout.send(RequestTimeout.scala:76)
at play.api.cache.redis.connector.RedisRequestTimeout.send$(RequestTimeout.scala:72)
at play.api.cache.redis.connector.RedisCommandsCluster$$anon$2.send(RedisCommands.scala:106)
I’m running a local redis cluster as per the redis cluster tutorial and via the cluster nodes
command in redis-cli
the cluster appears up and running. Furthermore, when I connect to the redis cluster listed above (or if i sea
127.0.0.1:7002> keys *
1) "eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.ff7q3dXyyvZ7_7s2SJcGByhjrIZVWhjySYNvXipkYC95YHnr-bb1xzL_Hjs2-5BPf2l62XTNviyOvwivNsiVAXcewiN1FFzz7chQZKqz6DJAmApfU-djvgh1t5njRSa0YhPidBeLLxXCzfCUfcxZlHhhtRwUwzQuOAGDb4M_9kE._epRtJX8x0rUFaB9.tc5gaIhtXB4wqR9mk-jeezr5-nyNwj3qlObYe_RL0UzzA4HWWHn2aB0zh44Vk5TUdM736anZBeeES4MocyHToBmvm3qFuv5L6XvEro87eyApJzEXE10_dO_V2yflv166WDqpzD3z9fJHidPgiD1uWPcDj00r_202g3nA21h0s3Ebyxaw_Ds7alY66wzVCwUibiyTqViDAj--NMCnd3x485m2ECNOMerD3sCo27EigALRNnn6L8BwWcYVT1uMT76UYoxN8Loi7XWD-LG43kuT.0vQFTbhbPyrmbKZvEbAPCA"
which is almost exactly the key that is wanted in the “server not found” error above.
Lastly, I’ve got the right version of play-redis in my build.sbt (2.6.1
) and here’s my config:
play.cache.redis {
bind-default = true
instances {
role-cache {
source = cluster
cluster = [
{ host = localhost, port = 7001 }
]
}
authenticated-user-cache {
source = cluster
cluster = [
{ host = localhost, port = 7002 }
]
}
play {
source = cluster
cluster = [
{ host = localhost, port = 7000 }
]
}
}
}
I noticed that the key in redis starts with eyJlbm...
but the error shows that it’s looking for a key that starts classTag::eyJlbm...
so maybe (probably) the issue is the extra classTag
?
Any ideas? It almost seems like there’s a disconnect between when the SET
and GET
, a disconnect that adds classTag::
🤔.
(Thanks so much!)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Closing the issue since you said it is already solved. For future reference, it was probably caused by an invalid config - mix of standalone and cluster config and instance.
If the issue persists, feel free to reopen and post additional details
Difficult to help here since you made lots for customizations here. It seems like there might be two possible issues. First, the connection might be unstable, second, the classtag is not set or expires too soon. To debug the second, try this:
btw you logs show that you attached just node 7000 7001 and 7002 but your redis logs show much more. What’s your current play-redis config?