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.

Issue where "server not found" but is there OR extra "classTag::" in Key?

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
KarelCemuscommented, Mar 3, 2021

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

0reactions
KarelCemuscommented, Feb 24, 2021

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:

  1. wipe redis db
  2. put some value
  3. check there exists both the key and the key with a classtag prefix
  4. check their TTL

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions About CSP | Using Caché Server ...
Answer: The web server must be configured to serve .js files through the CSP Gateway. This is not done by the Caché installer,...
Read more >
[BUG] Tapir requests hang in case of error thrown if error is not ...
If there is a specified errorOut (for auth in my case) and server logic fails with different error that is a subtype of...
Read more >
getquill/quill - Gitter
Is there a way to do this with Quill? I tried searching through the tests but it looks like there are no schemas...
Read more >
Servlet returns "HTTP Status 404 The requested resource ...
I hope, it will solve the "404 not found" issue in tomcat server during the development of java servlet application. Step 1: Right...
Read more >
TFS – Not authorized exception when Jira works thru proxy
Learn how to identify, diagnose, and solve the TFS – not authorized exception when Jira works through a proxy in Git Integration for...
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