com.lambdaworks.redis.RedisException: java.lang.NullPointerException

GitHub | OutOfBrain | 4 months ago
  1. 0

    GitHub comment 333#239405115

    GitHub | 4 months ago | OutOfBrain
    com.lambdaworks.redis.RedisException: java.lang.NullPointerException
  2. 0

    RedisClusterClient unable to read partition information and results in ConcurrentModificationException

    GitHub | 4 months ago | OutOfBrain
    com.lambdaworks.redis.RedisException: Cannot determine a partition to read for slot 1630 (Partitions: Partitions [RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.28', port=7001], nodeId='9fc072f1a3228f3fea613cbe7b50ab791310d625', connected=true, slaveOf='2d9f6f64b566c45f8caf0b8b0c3662185f23041a', pingSentTimestamp=0, pongReceivedTimestamp=1470761453982, configEpoch=33, flags=[SLAVE], slot count=0], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.24', port=7001], nodeId='8b2442dd5659702c59d1a6f3197b048f490d9727', connected=true, slaveOf='d30ffe3ed863cf028f6cad8f9a6babb97142a630', pingSentTimestamp=0, pongReceivedTimestamp=1470761453982, configEpoch=36, flags=[SLAVE], slot count=0], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.25', port=6379], nodeId='2494cbc3a5d0d8539d255ee0711f725655a2d06f', connected=true, slaveOf='cd836fbc2f6b9e19f9768702febb4a85759930fd', pingSentTimestamp=0, pongReceivedTimestamp=1470761451926, configEpoch=27, flags=[SLAVE], slot count=0], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.27', port=7001], nodeId='8d8f63487f1b1d8f562fee0efcd71d33c38ed612', connected=true, slaveOf='e59e15e90f131fead7cd13b43891144b14773519', pingSentTimestamp=0, pongReceivedTimestamp=1470761453982, configEpoch=32, flags=[SLAVE], slot count=0], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.25', port=7001], nodeId='2d9f6f64b566c45f8caf0b8b0c3662185f23041a', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1470761452440, configEpoch=33, flags=[MASTER], slot count=3278], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.27', port=6379], nodeId='d61059d427a992748bd63d44f26fa963a823503b', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1470761452956, configEpoch=34, flags=[MASTER], slot count=3276], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.24', port=6379], nodeId='4c41014792825ff94a596e86da9fac4da9254585', connected=true, slaveOf='d61059d427a992748bd63d44f26fa963a823503b', pingSentTimestamp=0, pongReceivedTimestamp=1470761453466, configEpoch=34, flags=[SLAVE], slot count=0], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.23', port=6379], nodeId='d30ffe3ed863cf028f6cad8f9a6babb97142a630', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=0, configEpoch=36, flags=[MASTER, MYSELF], slot count=3276], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.23', port=7001], nodeId='e59e15e90f131fead7cd13b43891144b14773519', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1470761453982, configEpoch=32, flags=[MASTER], slot count=3278], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.28', port=6379], nodeId='cd836fbc2f6b9e19f9768702febb4a85759930fd', connected=true, slaveOf='null', pingSentTimestamp=0, pongReceivedTimestamp=1470761452956, configEpoch=27, flags=[MASTER], slot count=3276], RedisClusterNodeSnapshot [uri=RedisURI [host='10.21.2.26', port=6379], nodeId='8c6623b00a586bf9f16f1b88bac1baad218a6cd7', connected=false, slaveOf='null', pingSentTimestamp=1470761451407, pongReceivedTimestamp=0, configEpoch=0, flags=[HANDSHAKE], slot count=0]]) with setting com.lambdaworks.redis.ReadFromImpl$ReadFromMaster@3003697
  3. 0

    Currently, ModuleDeployer is a disposable bean. When the container context is closed, the ModuleDeployer bean is destroyed along with its associated common context and deployed modules. Issue arises, if the connectionfactory bean associated with the deployed modules' message bus bindings is destroyed before the ModuleDeployer bean, there is exception stacktrace (at least in case of Redis MessageBus) saying "Connection closed". Adding SmartLifecycle support to ModuleDeployer will make sure all the beans are destroyed during Lifecycle processor's stop() method before any of the singletonbeans are destroyed. The stacktrace (when using Redis MessageBus is): org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is com.lambdaworks.redis.RedisException: Connection closed at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:45) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:35) at org.springframework.data.redis.connection.lettuce.LettuceConverters.toDataAccessException(LettuceConverters.java:158) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:237) at org.springframework.data.redis.connection.lettuce.LettuceConnection.bRPop(LettuceConnection.java:1449) at org.springframework.data.redis.core.DefaultListOperations$12.inRedis(DefaultListOperations.java:154) at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:50) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:181) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:149) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84) at org.springframework.data.redis.core.DefaultListOperations.rightPop(DefaultListOperations.java:151) at org.springframework.data.redis.core.DefaultBoundListOperations.rightPop(DefaultBoundListOperations.java:92) at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.popMessageAndSend(RedisQueueMessageDrivenEndpoint.java:178) at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.access$300(RedisQueueMessageDrivenEndpoint.java:51) at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint$ListenerTask.run(RedisQueueMessageDrivenEndpoint.java:291) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at java.lang.Thread.run(Thread.java:722) Caused by: com.lambdaworks.redis.RedisException: Connection closed at com.lambdaworks.redis.RedisAsyncConnection.await(RedisAsyncConnection.java:1079) at com.lambdaworks.redis.RedisConnection.await(RedisConnection.java:820) at com.lambdaworks.redis.RedisConnection.brpop(RedisConnection.java:101) at org.springframework.data.redis.connection.lettuce.LettuceConnection.bRPop(LettuceConnection.java:1447) ... 12 more 13:19:00,897 WARN Thread-5 support.DefaultLifecycleProcessor:257 - Failed to stop bean 'org.springframework.integration.redis.inbound.RedisInboundChannelAdapter#0' com.lambdaworks.redis.RedisException: Connection is closed at com.lambdaworks.redis.RedisAsyncConnection.dispatch(RedisAsyncConnection.java:1065) at com.lambdaworks.redis.pubsub.RedisPubSubConnection.unsubscribe(RedisPubSubConnection.java:82) at org.springframework.data.redis.connection.lettuce.LettuceSubscription.doUnsubscribe(LettuceSubscription.java:68) at org.springframework.data.redis.connection.util.AbstractSubscription.unsubscribe(AbstractSubscription.java:186) at org.springframework.data.redis.connection.util.AbstractSubscription.unsubscribe(AbstractSubscription.java:146) at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.cancel(RedisMessageListenerContainer.java:836) at org.springframework.data.redis.listener.RedisMessageListenerContainer.stop(RedisMessageListenerContainer.java:210) at org.springframework.integration.redis.inbound.RedisInboundChannelAdapter.doStop(RedisInboundChannelAdapter.java:127) at org.springframework.integration.endpoint.AbstractEndpoint.stop(AbstractEndpoint.java:100) at org.springframework.integration.endpoint.AbstractEndpoint.stop(AbstractEndpoint.java:115) at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229) at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51) at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363) at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202) at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:888) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:157) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:809)

    Spring JIRA | 3 years ago | Ilayaperumal Gopinathan
    com.lambdaworks.redis.RedisException: Connection is closed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Currently, ModuleDeployer is a disposable bean. When the container context is closed, the ModuleDeployer bean is destroyed along with its associated common context and deployed modules. Issue arises, if the connectionfactory bean associated with the deployed modules' message bus bindings is destroyed before the ModuleDeployer bean, there is exception stacktrace (at least in case of Redis MessageBus) saying "Connection closed". Adding SmartLifecycle support to ModuleDeployer will make sure all the beans are destroyed during Lifecycle processor's stop() method before any of the singletonbeans are destroyed. The stacktrace (when using Redis MessageBus is): org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is com.lambdaworks.redis.RedisException: Connection closed at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:45) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:35) at org.springframework.data.redis.connection.lettuce.LettuceConverters.toDataAccessException(LettuceConverters.java:158) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:237) at org.springframework.data.redis.connection.lettuce.LettuceConnection.bRPop(LettuceConnection.java:1449) at org.springframework.data.redis.core.DefaultListOperations$12.inRedis(DefaultListOperations.java:154) at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:50) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:181) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:149) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84) at org.springframework.data.redis.core.DefaultListOperations.rightPop(DefaultListOperations.java:151) at org.springframework.data.redis.core.DefaultBoundListOperations.rightPop(DefaultBoundListOperations.java:92) at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.popMessageAndSend(RedisQueueMessageDrivenEndpoint.java:178) at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.access$300(RedisQueueMessageDrivenEndpoint.java:51) at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint$ListenerTask.run(RedisQueueMessageDrivenEndpoint.java:291) at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52) at java.lang.Thread.run(Thread.java:722) Caused by: com.lambdaworks.redis.RedisException: Connection closed at com.lambdaworks.redis.RedisAsyncConnection.await(RedisAsyncConnection.java:1079) at com.lambdaworks.redis.RedisConnection.await(RedisConnection.java:820) at com.lambdaworks.redis.RedisConnection.brpop(RedisConnection.java:101) at org.springframework.data.redis.connection.lettuce.LettuceConnection.bRPop(LettuceConnection.java:1447) ... 12 more 13:19:00,897 WARN Thread-5 support.DefaultLifecycleProcessor:257 - Failed to stop bean 'org.springframework.integration.redis.inbound.RedisInboundChannelAdapter#0' com.lambdaworks.redis.RedisException: Connection is closed at com.lambdaworks.redis.RedisAsyncConnection.dispatch(RedisAsyncConnection.java:1065) at com.lambdaworks.redis.pubsub.RedisPubSubConnection.unsubscribe(RedisPubSubConnection.java:82) at org.springframework.data.redis.connection.lettuce.LettuceSubscription.doUnsubscribe(LettuceSubscription.java:68) at org.springframework.data.redis.connection.util.AbstractSubscription.unsubscribe(AbstractSubscription.java:186) at org.springframework.data.redis.connection.util.AbstractSubscription.unsubscribe(AbstractSubscription.java:146) at org.springframework.data.redis.listener.RedisMessageListenerContainer$SubscriptionTask.cancel(RedisMessageListenerContainer.java:836) at org.springframework.data.redis.listener.RedisMessageListenerContainer.stop(RedisMessageListenerContainer.java:210) at org.springframework.integration.redis.inbound.RedisInboundChannelAdapter.doStop(RedisInboundChannelAdapter.java:127) at org.springframework.integration.endpoint.AbstractEndpoint.stop(AbstractEndpoint.java:100) at org.springframework.integration.endpoint.AbstractEndpoint.stop(AbstractEndpoint.java:115) at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:229) at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:51) at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:363) at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:202) at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:118) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:888) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.doClose(EmbeddedWebApplicationContext.java:157) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:809)

    Spring JIRA | 3 years ago | Ilayaperumal Gopinathan
    com.lambdaworks.redis.RedisException: Connection is closed
  6. 0

    GitHub comment 41#48862437

    GitHub | 2 years ago | lianghaijian
    com.lambdaworks.redis.RedisException: Command timed out

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.lambdaworks.redis.RedisException

      java.lang.NullPointerException

      at com.lambdaworks.redis.cluster.PooledClusterConnectionProvider.getConnection()
    2. com.lambdaworks.redis
      ClusterDistributionChannelWriter.write
      1. com.lambdaworks.redis.cluster.PooledClusterConnectionProvider.getConnection(PooledClusterConnectionProvider.java:77)
      2. com.lambdaworks.redis.cluster.ClusterDistributionChannelWriter.write(ClusterDistributionChannelWriter.java:100)
      2 frames
    3. lettuce
      RedisChannelHandler.dispatch
      1. com.lambdaworks.redis.RedisChannelHandler.dispatch(RedisChannelHandler.java:118)
      1 frame
    4. com.lambdaworks.redis
      StatefulRedisClusterConnectionImpl.dispatch
      1. com.lambdaworks.redis.cluster.StatefulRedisClusterConnectionImpl.dispatch(StatefulRedisClusterConnectionImpl.java:178)
      1 frame
    5. lettuce
      AbstractRedisAsyncCommands.hkeys
      1. com.lambdaworks.redis.AbstractRedisAsyncCommands.dispatch(AbstractRedisAsyncCommands.java:1797)
      2. com.lambdaworks.redis.AbstractRedisAsyncCommands.hkeys(AbstractRedisAsyncCommands.java:436)
      2 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:497)
      3 frames
    7. com.lambdaworks.redis
      AbstractInvocationHandler.invoke
      1. com.lambdaworks.redis.cluster.StatefulRedisClusterConnectionImpl$ClusterFutureSyncInvocationHandler.handleInvocation(StatefulRedisClusterConnectionImpl.java:321)
      2. com.lambdaworks.redis.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:54)
      2 frames
    8. com.sun.proxy
      $Proxy18.hkeys
      1. com.sun.proxy.$Proxy18.hkeys(Unknown Source)[...snip...]
      1 frame
    9. Hadoop
      YarnChild$2.run
      1. org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
      2. org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
      3. org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
      4. org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
      4 frames
    10. Java RT
      Subject.doAs
      1. java.security.AccessController.doPrivileged(Native Method)
      2. javax.security.auth.Subject.doAs(Subject.java:422)
      2 frames
    11. Hadoop
      UserGroupInformation.doAs
      1. org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
      1 frame