Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
lettuce Cannot retrieve initial cluster partitions from initial URIs from elasticache configuration endpoint
trait RedisCluster {
def connect: Throwable \/ StatefulRedisClusterConnection[String, String]
}
class RedisClusterWithLettuce(host: String, port: Int) extends RedisCluster {
private val client = RedisClusterWithLettuce.build(host, port)
def connect: Throwable \/ StatefulRedisClusterConnection[String, String] = {
\/.fromTryCatchNonFatal {
val connection = client.connect()
connection.setReadFrom(ReadFrom.REPLICA_PREFERRED)
connection
}
}
}
object RedisClusterWithLettuce {
def build(host: String, port: Int): RedisClusterClient = {
val client = RedisClusterClient.create(
RedisURI
.builder()
.withHost(host)
.withPort(port)
.withTimeout(Duration.ofMillis(15))
.build()
)
client
.setOptions(
ClusterClientOptions
.builder()
.autoReconnect(true)
.topologyRefreshOptions(
ClusterTopologyRefreshOptions
.builder()
.enableAllAdaptiveRefreshTriggers()
.build()
)
.build()
)
client
}
}
18-Nov-2020 20:38:53.871 SEVERE [catalina-exec-12] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [FluctBidV2] in context with path [] threw exception
com.google.common.util.concurrent.UncheckedExecutionException: io.lettuce.core.RedisException: Cannot retrieve initial cluster partitions from initial URIs [RedisURI [host='sazabi-freeza-redis-cluster.y9i5tr.clustercfg.apne1.cache.amazonaws.com', port=6379]]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2218)
at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:5053)
at sazabi.bid.common.Cache.apply(Cache.scala:16)
at sazabi.bid.core.freeza.redis.CacheableFrequencyRepository2.resolveFrequencies(FrequencyRepository2.scala:67)
at sazabi.bid.core.filter.FrequencyTargetingFilter2.$anonfun$apply$3(FrequencyTargetingFilter2.scala:25)
at sazabi.bid.core.filter.FrequencyTargetingFilter2.$anonfun$apply$3$adapted(FrequencyTargetingFilter2.scala:25)
at scala.Option.map(Option.scala:230)
at sazabi.bid.core.filter.FrequencyTargetingFilter2.apply(FrequencyTargetingFilter2.scala:25)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$14(AdFilter.scala:76)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$14$adapted(AdFilter.scala:74)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$13(AdFilter.scala:74)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$13$adapted(AdFilter.scala:73)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$12(AdFilter.scala:73)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$12$adapted(AdFilter.scala:72)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$11(AdFilter.scala:72)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$11$adapted(AdFilter.scala:71)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$10(AdFilter.scala:71)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$10$adapted(AdFilter.scala:70)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$9(AdFilter.scala:70)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$9$adapted(AdFilter.scala:69)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$8(AdFilter.scala:69)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$8$adapted(AdFilter.scala:68)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$7(AdFilter.scala:68)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$7$adapted(AdFilter.scala:67)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$6(AdFilter.scala:67)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$6$adapted(AdFilter.scala:66)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$5(AdFilter.scala:66)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$5$adapted(AdFilter.scala:65)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$4(AdFilter.scala:65)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$4$adapted(AdFilter.scala:64)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$3(AdFilter.scala:64)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$3$adapted(AdFilter.scala:63)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$2(AdFilter.scala:63)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$2$adapted(AdFilter.scala:61)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$1(AdFilter.scala:61)
at sazabi.bid.core.filter.AdFilter.$anonfun$filterByRequest$1$adapted(AdFilter.scala:60)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.filter.AdFilter.filterByRequest(AdFilter.scala:60)
at sazabi.bid.core.filter.AdFilter.filter(AdFilter.scala:42)
at sazabi.bid.core.BidServer.$anonfun$bid$14(BidServer.scala:85)
at sazabi.bid.core.BidServer.$anonfun$bid$14$adapted(BidServer.scala:84)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.BidServer.$anonfun$bid$13(BidServer.scala:84)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.core.BidServer.bid(BidServer.scala:81)
at sazabi.bid.el.common.BidClient.bid(BidClient.scala:145)
at sazabi.bid.el.common.BidClient.bid(BidClient.scala:78)
at sazabi.bid.el.servlets.BidServlet.$anonfun$bid$1(BidServlet.scala:39)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at sazabi.bid.el.servlets.BidServlet.bid(BidServlet.scala:38)
at sazabi.bid.el.servlets.BidServlet.doPost(BidServlet.scala:20)
at sazabi.bid.el.servlets.BidServlet.doPost$(BidServlet.scala:16)
at sazabi.bid.el.servlets.FluctBidV2.doPost(FluctBidV2.scala:7)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: io.lettuce.core.RedisException: Cannot retrieve initial cluster partitions from initial URIs [RedisURI [host='sazabi-freeza-redis-cluster.y9i5tr.clustercfg.apne1.cache.amazonaws.com', port=6379]]
at io.lettuce.core.cluster.RedisClusterClient.doLoadPartitions(RedisClusterClient.java:872)
at io.lettuce.core.cluster.RedisClusterClient.loadPartitions(RedisClusterClient.java:841)
at io.lettuce.core.cluster.RedisClusterClient.initializePartitions(RedisClusterClient.java:816)
at io.lettuce.core.cluster.RedisClusterClient.connect(RedisClusterClient.java:348)
at io.lettuce.core.cluster.RedisClusterClient.connect(RedisClusterClient.java:323)
at sazabi.bid.common.redis.RedisClusterWithLettuce.$anonfun$connect$1(RedisCluster.scala:20)
at scalaz.$bslash$div$.attempt(Either.scala:402)
at scalaz.$bslash$div$.fromTryCatchNonFatal(Either.scala:377)
at sazabi.bid.common.redis.RedisClusterWithLettuce.connect(RedisCluster.scala:19)
at sazabi.bid.core.freeza.redis.FrequencyRepository2WithLettuce.resolveFrequencies(FrequencyRepository2.scala:25)
at sazabi.bid.core.freeza.redis.CacheableFrequencyRepository2.$anonfun$resolveFrequencies$7(FrequencyRepository2.scala:68)
at sazabi.bid.common.Cache.$anonfun$apply$1(Cache.scala:16)
at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:5058)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
... 90 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.