debasishg / scala-redis

A scala library for connecting to a redis server, or a cluster of redis nodes using consistent hashing on the client side.
1.02k stars 219 forks source link

IllegalArgumentException: hostname can't be null #216

Open MourishS opened 6 years ago

MourishS commented 6 years ago

I have facing issue hostname can't be null. My source code looks like

 var keys_data = redis_client.smembers("get_info_data:"+"4536").getOrElse(Seq()).toSeq.map(d=> d.getOrElse(EMPTY)).filter(s=> s!=EMPTY)

                keys_data.map{info =>
                     logger.info(info)
                  redis_client.zscan("my_set:"+info,1,"*",10)
                } 

I got keys_data values from smembers but unable to get zscan values.

java.lang.RuntimeException: java.lang.IllegalArgumentException: ### hostname can't be null at com.redis.IO$class.connect(IO.scala:38) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.cluster.RedisCluster.connect(RedisCluster.scala:60) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.IO$class.write(IO.scala:68) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.cluster.RedisCluster.write(RedisCluster.scala:60) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.Redis$class.send(RedisClient.scala:21) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.cluster.RedisCluster.send(RedisCluster.scala:60) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.SortedSetOperations$class.zscan(SortedSetOperations.scala:152) ~[redisclient_2.11-3.3.jar:3.3] at com.redis.cluster.### RedisCluster.zscan(RedisCluster.scala:60) ~[redisclient_2.11-3.3.jar:3.3] at com.xxx.api.model.LocationDataRedisModel$class.get_location_info(LocationDataModel.scala:254) ~[classes/:na] at com.xxx.api.KafkaController$.get_location_info(KafkaController.scala:20) ~[classes/:na] at com.xxx.api.business.ProducerCommands$$anonfun$2$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5.apply(ProducerCommands.scala:170) ~[classes/:na] at com.xxx.api.business.ProducerCommands$$anonfun$2$$anonfun$apply$3$$anonfun$apply$4$$anonfun$apply$5.apply(ProducerCommands.scala:163) ~[classes/:na] at akka.http.scaladsl.server.directives.RouteDirectives$$anonfun$complete$1.apply(RouteDirectives.scala:47) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.RouteDirectives$$anonfun$complete$1.apply(RouteDirectives.scala:47) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.StandardRoute$$anon$1.apply(StandardRoute.scala:19) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.StandardRoute$$anon$1.apply(StandardRoute.scala:19) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1$$anonfun$apply$2.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1$$anonfun$apply$2.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension0$1.apply(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension0$1.apply(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.akka$http$scaladsl$util$FastFuture$$strictTransform$1(FastFuture.scala:41) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension0(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1.apply(FutureDirectives.scala:23) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1$$anonfun$apply$2.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1$$anonfun$apply$2.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension0$1.apply(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension0$1.apply(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.akka$http$scaladsl$util$FastFuture$$strictTransform$1(FastFuture.scala:41) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension0(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1.apply(FutureDirectives.scala:23) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1$$anonfun$apply$2.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1$$anonfun$apply$2.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension0$1.apply(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$$anonfun$transformWith$extension0$1.apply(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.akka$http$scaladsl$util$FastFuture$$strictTransform$1(FastFuture.scala:41) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension0(FastFuture.scala:37) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1.apply(FutureDirectives.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.FutureDirectives$$anonfun$onComplete$1$$anonfun$apply$1.apply(FutureDirectives.scala:23) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRouteResult$1$$anonfun$apply$3.apply(BasicDirectives.scala:33) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRouteResult$1$$anonfun$apply$3.apply(BasicDirectives.scala:33) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.Directive$$anonfun$recover$1$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(Directive.scala:95) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.Directive$$anonfun$recover$1$$anonfun$apply$8$$anonfun$apply$9$$anonfun$apply$10.apply(Directive.scala:95) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.Directive$$anonfun$recover$1$$anonfun$apply$8.apply(Directive.scala:95) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.Directive$$anonfun$recover$1$$anonfun$apply$8.apply(Directive.scala:92) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:24) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRequestContext$1$$anonfun$apply$1.apply(BasicDirectives.scala:24) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:28) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.util.FastFuture$.akka$http$scaladsl$util$FastFuture$$strictTransform$1(FastFuture.scala:41) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.flatMap$extension(FastFuture.scala:26) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:23) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:28) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1$$anonfun$apply$1.apply(RouteConcatenation.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.util.FastFuture$.akka$http$scaladsl$util$FastFuture$$strictTransform$1(FastFuture.scala:41) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.transformWith$extension1(FastFuture.scala:45) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.util.FastFuture$.flatMap$extension(FastFuture.scala:26) ~[akka-http-core_2.11-10.0.5.jar:10.0.5] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:25) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.RouteConcatenation$RouteWithConcatenation$$anonfun$$tilde$1.apply(RouteConcatenation.scala:23) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRouteResult$1$$anonfun$apply$3.apply(BasicDirectives.scala:33) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRouteResult$1$$anonfun$apply$3.apply(BasicDirectives.scala:33) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRouteResultWith$1$$anonfun$apply$4.apply(BasicDirectives.scala:36) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$mapRouteResultWith$1$$anonfun$apply$4.apply(BasicDirectives.scala:36) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.BasicDirectives$$anonfun$textract$1$$anonfun$apply$5.apply(BasicDirectives.scala:89) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$1.apply(ExecutionDirectives.scala:27) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.directives.ExecutionDirectives$$anonfun$handleExceptions$1$$anonfun$apply$1.apply(ExecutionDirectives.scala:23) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.Route$$anonfun$asyncHandler$1.apply(Route.scala:70) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.http.scaladsl.server.Route$$anonfun$asyncHandler$1.apply(Route.scala:69) ~[akka-http-experimental_2.11-2.4.3.jar:na] at akka.stream.impl.fusing.MapAsync$$anon$24.onPush(Ops.scala:1169) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:747) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.GraphInterpreter.processEvent(GraphInterpreter.scala:710) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:616) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:471) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:423) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:603) ~[akka-stream_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:618) ~[akka-stream_2.11-2.4.17.jar:na] at akka.actor.Actor$class.aroundReceive(Actor.scala:497) ~[akka-actor_2.11-2.4.17.jar:na] at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:529) ~[akka-stream_2.11-2.4.17.jar:na] at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) [akka-actor_2.11-2.4.17.jar:na] at akka.actor.ActorCell.invoke(ActorCell.scala:495) [akka-actor_2.11-2.4.17.jar:na] at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) [akka-actor_2.11-2.4.17.jar:na] at akka.dispatch.Mailbox.run(Mailbox.scala:224) [akka-actor_2.11-2.4.17.jar:na] at akka.dispatch.Mailbox.exec(Mailbox.scala:234) [akka-actor_2.11-2.4.17.jar:na] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [scala-library-2.11.12.jar:na] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [scala-library-2.11.12.jar:na] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [scala-library-2.11.12.jar:na] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [scala-library-2.11.12.jar:na] Caused by: java.lang.IllegalArgumentException: hostname can't be null at java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149) ~[na:1.8.0_171] at java.net.InetSocketAddress.(InetSocketAddress.java:216) ~[na:1.8.0_171] at com.redis.IO$class.connect(IO.scala:26) ~[redisclient_2.11-3.3.jar:3.3] ... 105 common frames omitted